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

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

View File

@@ -0,0 +1,6 @@
import React from 'react';
export declare const APIKey: React.FC<{
readonly enabled: boolean;
readonly readOnly?: boolean;
}>;
//# sourceMappingURL=APIKey.d.ts.map

View File

@@ -0,0 +1,13 @@
import React from 'react';
export type FileMetaProps = {
filename: string;
filesize: number;
height?: number;
mimeType: string;
sizes?: unknown;
url: string;
width?: number;
};
import './index.scss';
export declare const FileMeta: React.FC<FileMetaProps>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/exports/sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAA;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,cAAc,oBAAoB,CAAA"}

View File

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

View File

@@ -0,0 +1,3 @@
const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
export { floatRegex };

View File

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

View File

@@ -0,0 +1,22 @@
import {Value} from './index';
/**
* Sass's [function type](https://sass-lang.com/documentation/values/functions).
*
* **Heads up!** Although first-class Sass functions can be processed by custom
* functions, there's no way to invoke them outside of a Sass stylesheet.
*
* @category Custom Function
*/
export class SassFunction extends Value {
/**
* Creates a new first-class function that can be invoked using
* [`meta.call()`](https://sass-lang.com/documentation/modules/meta#call).
*
* @param signature - The function signature, like you'd write for the
* [`@function rule`](https://sass-lang.com/documentation/at-rules/function).
* @param callback - The callback that's invoked when this function is called,
* just like for a {@link CustomFunction}.
*/
constructor(signature: string, callback: (args: Value[]) => Value);
}

View File

@@ -0,0 +1,76 @@
/**
* Copyright (c) 2017, Dirk-Jan Rutten
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../../error.js';
import { parseDate, serializeDate } from './formatter.js';
import { validateDate, validateJSDate } from './validator.js';
export const GraphQLDateConfig = /*#__PURE__*/ {
name: 'Date',
description: 'A date string, such as 2007-12-03, compliant with the `full-date` ' +
'format outlined in section 5.6 of the RFC 3339 profile of the ' +
'ISO 8601 standard for representation of dates and times using ' +
'the Gregorian calendar.',
serialize(value) {
if (value instanceof Date) {
if (validateJSDate(value)) {
return serializeDate(value);
}
throw createGraphQLError('Date cannot represent an invalid Date instance');
}
else if (typeof value === 'string') {
if (validateDate(value)) {
return value;
}
throw createGraphQLError(`Date cannot represent an invalid date-string ${value}.`);
}
else {
throw createGraphQLError('Date cannot represent a non string, or non Date type ' + JSON.stringify(value));
}
},
parseValue(value) {
if (!(typeof value === 'string')) {
throw createGraphQLError(`Date cannot represent non string type ${JSON.stringify(value)}`);
}
if (validateDate(value)) {
return parseDate(value);
}
throw createGraphQLError(`Date cannot represent an invalid date-string ${value}.`);
},
parseLiteral(ast) {
if (ast.kind !== Kind.STRING) {
throw createGraphQLError(`Date cannot represent non string type ${'value' in ast && ast.value}`, { nodes: ast });
}
const { value } = ast;
if (validateDate(value)) {
return parseDate(value);
}
throw createGraphQLError(`Date cannot represent an invalid date-string ${String(value)}.`, {
nodes: ast,
});
},
extensions: {
codegenScalarType: 'Date | string',
jsonSchema: {
type: 'string',
format: 'date',
},
},
};
/**
* An RFC 3339 compliant date scalar.
*
* Input:
* This scalar takes an RFC 3339 date string as input and
* parses it to a javascript Date.
*
* Output:
* This scalar serializes javascript Dates and
* RFC 3339 date strings to RFC 3339 date strings.
*/
export const GraphQLDate = /*#__PURE__*/ new GraphQLScalarType(GraphQLDateConfig);

View File

@@ -0,0 +1 @@
{"version":3,"file":"format-fields.cjs","names":["fields"],"sources":["../../src/utils/format-fields.ts"],"sourcesContent":["export const formatFields = (fields: (string | Record<string, any>)[]) => {\n\ttype FieldItem = (typeof fields)[number];\n\n\tconst walkFields = (value: FieldItem, chain: string[] = []): string | string[] => {\n\t\tif (typeof value === 'object') {\n\t\t\tconst result = [];\n\n\t\t\tfor (const key in value) {\n\t\t\t\tconst nestedField = value[key as keyof typeof value] ?? [];\n\n\t\t\t\tif (Array.isArray(nestedField)) {\n\t\t\t\t\t// regular nested fields\n\t\t\t\t\tfor (const item of nestedField) {\n\t\t\t\t\t\tresult.push(walkFields(item as FieldItem, [...chain, key]));\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof nestedField === 'object') {\n\t\t\t\t\t// many to any nested\n\t\t\t\t\tfor (const scope of Object.keys(nestedField)) {\n\t\t\t\t\t\tconst fields = (nestedField as Record<string, FieldItem[]>)[scope]!;\n\n\t\t\t\t\t\tfor (const item of fields) {\n\t\t\t\t\t\t\tresult.push(walkFields(item as FieldItem, [...chain, `${key}:${scope}`]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result.flatMap((items) => items);\n\t\t}\n\n\t\treturn [...chain, String(value)].join('.');\n\t};\n\n\treturn fields.flatMap((value) => walkFields(value));\n};\n"],"mappings":"AAAA,MAAa,EAAgB,GAA6C,CAGzE,IAAM,GAAc,EAAkB,EAAkB,EAAE,GAAwB,CACjF,GAAI,OAAO,GAAU,SAAU,CAC9B,IAAM,EAAS,EAAE,CAEjB,IAAK,IAAM,KAAO,EAAO,CACxB,IAAM,EAAc,EAAM,IAA8B,EAAE,CAE1D,GAAI,MAAM,QAAQ,EAAY,CAE7B,IAAK,IAAM,KAAQ,EAClB,EAAO,KAAK,EAAW,EAAmB,CAAC,GAAG,EAAO,EAAI,CAAC,CAAC,SAElD,OAAO,GAAgB,SAEjC,IAAK,IAAM,KAAS,OAAO,KAAK,EAAY,CAAE,CAC7C,IAAMA,EAAU,EAA4C,GAE5D,IAAK,IAAM,KAAQA,EAClB,EAAO,KAAK,EAAW,EAAmB,CAAC,GAAG,EAAO,GAAG,EAAI,GAAG,IAAQ,CAAC,CAAC,EAM7E,OAAO,EAAO,QAAS,GAAU,EAAM,CAGxC,MAAO,CAAC,GAAG,EAAO,OAAO,EAAM,CAAC,CAAC,KAAK,IAAI,EAG3C,OAAO,EAAO,QAAS,GAAU,EAAW,EAAM,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/columns/macaddr.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyPgTable } from '../table.ts';\nimport { PgColumn, PgColumnBuilder } from './common.ts';\n\nexport type PgMacaddrBuilderInitial<TName extends string> = PgMacaddrBuilder<{\n\tname: TName;\n\tdataType: 'string';\n\tcolumnType: 'PgMacaddr';\n\tdata: string;\n\tdriverParam: string;\n\tenumValues: undefined;\n}>;\n\nexport class PgMacaddrBuilder<T extends ColumnBuilderBaseConfig<'string', 'PgMacaddr'>> extends PgColumnBuilder<T> {\n\tstatic override readonly [entityKind]: string = 'PgMacaddrBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'string', 'PgMacaddr');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgMacaddr<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgMacaddr<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);\n\t}\n}\n\nexport class PgMacaddr<T extends ColumnBaseConfig<'string', 'PgMacaddr'>> extends PgColumn<T> {\n\tstatic override readonly [entityKind]: string = 'PgMacaddr';\n\n\tgetSQLType(): string {\n\t\treturn 'macaddr';\n\t}\n}\n\nexport function macaddr(): PgMacaddrBuilderInitial<''>;\nexport function macaddr<TName extends string>(name: TName): PgMacaddrBuilderInitial<TName>;\nexport function macaddr(name?: string) {\n\treturn new PgMacaddrBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAE3B,oBAA0C;AAWnC,MAAM,yBAAmF,8BAAmB;AAAA,EAClH,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,UAAU,WAAW;AAAA,EAClC;AAAA;AAAA,EAGS,MACR,OAC6C;AAC7C,WAAO,IAAI,UAA2C,OAAO,KAAK,MAA8C;AAAA,EACjH;AACD;AAEO,MAAM,kBAAqE,uBAAY;AAAA,EAC7F,QAA0B,wBAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAIO,SAAS,QAAQ,MAAe;AACtC,SAAO,IAAI,iBAAiB,QAAQ,EAAE;AACvC;","names":[]}

View File

@@ -0,0 +1,27 @@
"use strict";
exports.mn = void 0;
var _index = require("./mn/_lib/formatDistance.js");
var _index2 = require("./mn/_lib/formatLong.js");
var _index3 = require("./mn/_lib/formatRelative.js");
var _index4 = require("./mn/_lib/localize.js");
var _index5 = require("./mn/_lib/match.js");
/**
* @category Locales
* @summary Mongolian locale.
* @language Mongolian
* @iso-639-2 mon
* @author Bilguun Ochirbat [@bilguun0203](https://github.com/bilguun0203)
*/
const mn = (exports.mn = {
code: "mn",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
});

View File

@@ -0,0 +1,25 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const HeadphoneOff = createLucideIcon("HeadphoneOff", [
["path", { d: "M21 14h-1.343", key: "1jdnxi" }],
["path", { d: "M9.128 3.47A9 9 0 0 1 21 12v3.343", key: "6kipu2" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }],
["path", { d: "M20.414 20.414A2 2 0 0 1 19 21h-1a2 2 0 0 1-2-2v-3", key: "9x50f4" }],
[
"path",
{
d: "M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 2.636-6.364",
key: "1bkxnm"
}
]
]);
export { HeadphoneOff as default };
//# sourceMappingURL=headphone-off.js.map

View File

@@ -0,0 +1,58 @@
/*
This source code has been taken and modified from https://github.com/vercel/next.js/blob/39498d604c3b25d92a483153fe648a7ee456fbda/packages/next/src/lib/resolve-from.ts
License:
The MIT License (MIT)
Copyright (c) 2024 Vercel, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ // source: https://github.com/sindresorhus/resolve-from
import { createRequire } from 'module';
import path from 'path';
import { isError } from './isError.js';
import { realpathSync } from './realPath.js';
export const resolveFrom = (fromDirectory, moduleId, silent)=>{
if (typeof fromDirectory !== 'string') {
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``);
}
if (typeof moduleId !== 'string') {
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
}
try {
fromDirectory = realpathSync(fromDirectory);
} catch (error) {
if (isError(error) && error.code === 'ENOENT') {
fromDirectory = path.resolve(fromDirectory);
} else if (silent) {
return;
} else {
throw error;
}
}
const fromFile = path.join(fromDirectory, 'noop.js');
const require = createRequire(import.meta.url);
const Module = require('module');
const resolveFileName = ()=>{
return Module._resolveFilename(moduleId, {
id: fromFile,
filename: fromFile,
paths: Module._nodeModulePaths(fromDirectory)
});
};
if (silent) {
try {
return resolveFileName();
} catch (ignore) {
return;
}
}
return resolveFileName();
};
//# sourceMappingURL=resolveFrom.js.map

View File

@@ -0,0 +1,24 @@
import { entityKind } from "../entity.cjs";
import type { SQL } from "../sql/sql.cjs";
import type { PgRole } from "./roles.cjs";
import type { PgTable } from "./table.cjs";
export type PgPolicyToOption = 'public' | 'current_role' | 'current_user' | 'session_user' | (string & {}) | PgPolicyToOption[] | PgRole;
export interface PgPolicyConfig {
as?: 'permissive' | 'restrictive';
for?: 'all' | 'select' | 'insert' | 'update' | 'delete';
to?: PgPolicyToOption;
using?: SQL;
withCheck?: SQL;
}
export declare class PgPolicy implements PgPolicyConfig {
readonly name: string;
static readonly [entityKind]: string;
readonly as: PgPolicyConfig['as'];
readonly for: PgPolicyConfig['for'];
readonly to: PgPolicyConfig['to'];
readonly using: PgPolicyConfig['using'];
readonly withCheck: PgPolicyConfig['withCheck'];
constructor(name: string, config?: PgPolicyConfig);
link(table: PgTable): this;
}
export declare function pgPolicy(name: string, config?: PgPolicyConfig): PgPolicy;

View File

@@ -0,0 +1,492 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { mergeRegister, calculateZoomLevel } from '@lexical/utils';
import { createCommand, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, KEY_ENTER_COMMAND, COMMAND_PRIORITY_LOW, $getSelection, $isRangeSelection, isDOMNode } from 'lexical';
import * as React from 'react';
import { useLayoutEffect, useEffect, useState, useCallback, useMemo, useRef } from 'react';
import { jsx } from 'react/jsx-runtime';
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
// This workaround is no longer necessary in React 19,
// but we currently support React >=17.x
// https://github.com/facebook/react/pull/26395
const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
class MenuOption {
constructor(key) {
this.key = key;
this.ref = {
current: null
};
this.setRefElement = this.setRefElement.bind(this);
}
setRefElement(element) {
this.ref = {
current: element
};
}
}
const scrollIntoViewIfNeeded = target => {
const typeaheadContainerNode = document.getElementById('typeahead-menu');
if (!typeaheadContainerNode) {
return;
}
const typeaheadRect = typeaheadContainerNode.getBoundingClientRect();
if (typeaheadRect.top + typeaheadRect.height > window.innerHeight) {
typeaheadContainerNode.scrollIntoView({
block: 'center'
});
}
if (typeaheadRect.top < 0) {
typeaheadContainerNode.scrollIntoView({
block: 'center'
});
}
target.scrollIntoView({
block: 'nearest'
});
};
/**
* Walk backwards along user input and forward through entity title to try
* and replace more of the user's text with entity.
*/
function getFullMatchOffset(documentText, entryText, offset) {
let triggerOffset = offset;
for (let i = triggerOffset; i <= entryText.length; i++) {
if (documentText.slice(-i) === entryText.substring(0, i)) {
triggerOffset = i;
}
}
return triggerOffset;
}
/**
* Split Lexical TextNode and return a new TextNode only containing matched text.
* Common use cases include: removing the node, replacing with a new node.
*/
function $splitNodeContainingQuery(match) {
const selection = $getSelection();
if (!$isRangeSelection(selection) || !selection.isCollapsed()) {
return null;
}
const anchor = selection.anchor;
if (anchor.type !== 'text') {
return null;
}
const anchorNode = anchor.getNode();
if (!anchorNode.isSimpleText()) {
return null;
}
const selectionOffset = anchor.offset;
const textContent = anchorNode.getTextContent().slice(0, selectionOffset);
const characterOffset = match.replaceableString.length;
const queryOffset = getFullMatchOffset(textContent, match.matchingString, characterOffset);
const startOffset = selectionOffset - queryOffset;
if (startOffset < 0) {
return null;
}
let newNode;
if (startOffset === 0) {
[newNode] = anchorNode.splitText(selectionOffset);
} else {
[, newNode] = anchorNode.splitText(startOffset, selectionOffset);
}
return newNode;
}
// Got from https://stackoverflow.com/a/42543908/2013580
function getScrollParent(element, includeHidden) {
let style = getComputedStyle(element);
const excludeStaticParent = style.position === 'absolute';
const overflowRegex = /(auto|scroll)/;
if (style.position === 'fixed') {
return document.body;
}
for (let parent = element; parent = parent.parentElement;) {
style = getComputedStyle(parent);
if (excludeStaticParent && style.position === 'static') {
continue;
}
if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) {
return parent;
}
}
return document.body;
}
function isTriggerVisibleInNearestScrollContainer(targetElement, containerElement) {
const tRect = targetElement.getBoundingClientRect();
const cRect = containerElement.getBoundingClientRect();
return tRect.top > cRect.top && tRect.top < cRect.bottom;
}
// Reposition the menu on scroll, window resize, and element resize.
function useDynamicPositioning(resolution, targetElement, onReposition, onVisibilityChange) {
const [editor] = useLexicalComposerContext();
useEffect(() => {
if (targetElement != null && resolution != null) {
const rootElement = editor.getRootElement();
const rootScrollParent = rootElement != null ? getScrollParent(rootElement) : document.body;
let ticking = false;
let previousIsInView = isTriggerVisibleInNearestScrollContainer(targetElement, rootScrollParent);
const handleScroll = function () {
if (!ticking) {
window.requestAnimationFrame(function () {
onReposition();
ticking = false;
});
ticking = true;
}
const isInView = isTriggerVisibleInNearestScrollContainer(targetElement, rootScrollParent);
if (isInView !== previousIsInView) {
previousIsInView = isInView;
if (onVisibilityChange != null) {
onVisibilityChange(isInView);
}
}
};
const resizeObserver = new ResizeObserver(onReposition);
window.addEventListener('resize', onReposition);
document.addEventListener('scroll', handleScroll, {
capture: true,
passive: true
});
resizeObserver.observe(targetElement);
return () => {
resizeObserver.unobserve(targetElement);
window.removeEventListener('resize', onReposition);
document.removeEventListener('scroll', handleScroll, true);
};
}
}, [targetElement, editor, onVisibilityChange, onReposition, resolution]);
}
const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND = createCommand('SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND');
function LexicalMenu({
close,
editor,
anchorElementRef,
resolution,
options,
menuRenderFn,
onSelectOption,
shouldSplitNodeWithQuery = false,
commandPriority = COMMAND_PRIORITY_LOW,
preselectFirstItem = true
}) {
const [selectedIndex, setHighlightedIndex] = useState(null);
const matchingString = resolution.match && resolution.match.matchingString;
useEffect(() => {
if (preselectFirstItem) {
setHighlightedIndex(0);
}
}, [matchingString, preselectFirstItem]);
const selectOptionAndCleanUp = useCallback(selectedEntry => {
editor.update(() => {
const textNodeContainingQuery = resolution.match != null && shouldSplitNodeWithQuery ? $splitNodeContainingQuery(resolution.match) : null;
onSelectOption(selectedEntry, textNodeContainingQuery, close, resolution.match ? resolution.match.matchingString : '');
});
}, [editor, shouldSplitNodeWithQuery, resolution.match, onSelectOption, close]);
const updateSelectedIndex = useCallback(index => {
const rootElem = editor.getRootElement();
if (rootElem !== null) {
rootElem.setAttribute('aria-activedescendant', 'typeahead-item-' + index);
setHighlightedIndex(index);
}
}, [editor]);
useEffect(() => {
return () => {
const rootElem = editor.getRootElement();
if (rootElem !== null) {
rootElem.removeAttribute('aria-activedescendant');
}
};
}, [editor]);
useLayoutEffectImpl(() => {
if (options === null) {
setHighlightedIndex(null);
} else if (selectedIndex === null && preselectFirstItem) {
updateSelectedIndex(0);
}
}, [options, selectedIndex, updateSelectedIndex, preselectFirstItem]);
useEffect(() => {
return mergeRegister(editor.registerCommand(SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND, ({
option
}) => {
if (option.ref && option.ref.current != null) {
scrollIntoViewIfNeeded(option.ref.current);
return true;
}
return false;
}, commandPriority));
}, [editor, updateSelectedIndex, commandPriority]);
useEffect(() => {
return mergeRegister(editor.registerCommand(KEY_ARROW_DOWN_COMMAND, payload => {
const event = payload;
if (options !== null && options.length) {
const newSelectedIndex = selectedIndex === null ? 0 : selectedIndex !== options.length - 1 ? selectedIndex + 1 : 0;
updateSelectedIndex(newSelectedIndex);
const option = options[newSelectedIndex];
if (option.ref != null && option.ref.current) {
editor.dispatchCommand(SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND, {
index: newSelectedIndex,
option
});
}
event.preventDefault();
event.stopImmediatePropagation();
}
return true;
}, commandPriority), editor.registerCommand(KEY_ARROW_UP_COMMAND, payload => {
const event = payload;
if (options !== null && options.length) {
const newSelectedIndex = selectedIndex === null ? options.length - 1 : selectedIndex !== 0 ? selectedIndex - 1 : options.length - 1;
updateSelectedIndex(newSelectedIndex);
const option = options[newSelectedIndex];
if (option.ref != null && option.ref.current) {
scrollIntoViewIfNeeded(option.ref.current);
}
event.preventDefault();
event.stopImmediatePropagation();
}
return true;
}, commandPriority), editor.registerCommand(KEY_ESCAPE_COMMAND, payload => {
const event = payload;
event.preventDefault();
event.stopImmediatePropagation();
close();
return true;
}, commandPriority), editor.registerCommand(KEY_TAB_COMMAND, payload => {
const event = payload;
if (options === null || selectedIndex === null || options[selectedIndex] == null) {
return false;
}
event.preventDefault();
event.stopImmediatePropagation();
selectOptionAndCleanUp(options[selectedIndex]);
return true;
}, commandPriority), editor.registerCommand(KEY_ENTER_COMMAND, event => {
if (options === null || selectedIndex === null || options[selectedIndex] == null) {
return false;
}
if (event !== null) {
event.preventDefault();
event.stopImmediatePropagation();
}
selectOptionAndCleanUp(options[selectedIndex]);
return true;
}, commandPriority));
}, [selectOptionAndCleanUp, close, editor, options, selectedIndex, updateSelectedIndex, commandPriority]);
const listItemProps = useMemo(() => ({
options,
selectOptionAndCleanUp,
selectedIndex,
setHighlightedIndex
}), [selectOptionAndCleanUp, selectedIndex, options]);
return menuRenderFn(anchorElementRef, listItemProps, resolution.match ? resolution.match.matchingString : '');
}
function setContainerDivAttributes(containerDiv, className) {
if (className != null) {
containerDiv.className = className;
}
containerDiv.setAttribute('aria-label', 'Typeahead menu');
containerDiv.setAttribute('role', 'listbox');
containerDiv.style.display = 'block';
containerDiv.style.position = 'absolute';
}
function useMenuAnchorRef(resolution, setResolution, className, parent = CAN_USE_DOM ? document.body : undefined, shouldIncludePageYOffset__EXPERIMENTAL = true) {
const [editor] = useLexicalComposerContext();
const initialAnchorElement = CAN_USE_DOM ? document.createElement('div') : null;
const anchorElementRef = useRef(initialAnchorElement);
const positionMenu = useCallback(() => {
if (anchorElementRef.current === null || parent === undefined) {
return;
}
anchorElementRef.current.style.top = anchorElementRef.current.style.bottom;
const rootElement = editor.getRootElement();
const containerDiv = anchorElementRef.current;
const menuEle = containerDiv.firstChild;
if (rootElement !== null && resolution !== null) {
const {
left,
top,
width,
height
} = resolution.getRect();
const anchorHeight = anchorElementRef.current.offsetHeight; // use to position under anchor
containerDiv.style.top = `${top + anchorHeight + 3 + (shouldIncludePageYOffset__EXPERIMENTAL ? window.pageYOffset : 0)}px`;
containerDiv.style.left = `${left + window.pageXOffset}px`;
containerDiv.style.height = `${height}px`;
containerDiv.style.width = `${width}px`;
if (menuEle !== null) {
menuEle.style.top = `${top}`;
const menuRect = menuEle.getBoundingClientRect();
const menuHeight = menuRect.height;
const menuWidth = menuRect.width;
const rootElementRect = rootElement.getBoundingClientRect();
if (left + menuWidth > rootElementRect.right) {
containerDiv.style.left = `${rootElementRect.right - menuWidth + window.pageXOffset}px`;
}
if ((top + menuHeight > window.innerHeight || top + menuHeight > rootElementRect.bottom) && top - rootElementRect.top > menuHeight + height) {
containerDiv.style.top = `${top - menuHeight - height + (shouldIncludePageYOffset__EXPERIMENTAL ? window.pageYOffset : 0)}px`;
}
}
if (!containerDiv.isConnected) {
setContainerDivAttributes(containerDiv, className);
parent.append(containerDiv);
}
containerDiv.setAttribute('id', 'typeahead-menu');
rootElement.setAttribute('aria-controls', 'typeahead-menu');
}
}, [editor, resolution, shouldIncludePageYOffset__EXPERIMENTAL, className, parent]);
useEffect(() => {
const rootElement = editor.getRootElement();
if (resolution !== null) {
positionMenu();
}
return () => {
if (rootElement !== null) {
rootElement.removeAttribute('aria-controls');
}
// eslint-disable-next-line react-hooks/exhaustive-deps
const containerDiv = anchorElementRef.current;
if (containerDiv !== null && containerDiv.isConnected) {
containerDiv.remove();
containerDiv.removeAttribute('id');
}
};
}, [editor, positionMenu, resolution]);
const onVisibilityChange = useCallback(isInView => {
if (resolution !== null) {
if (!isInView) {
setResolution(null);
}
}
}, [resolution, setResolution]);
useDynamicPositioning(resolution, anchorElementRef.current, positionMenu, onVisibilityChange);
// Append the context for the menu immediately
if (initialAnchorElement != null && initialAnchorElement === anchorElementRef.current) {
setContainerDivAttributes(initialAnchorElement, className);
if (parent != null) {
parent.append(initialAnchorElement);
}
}
return anchorElementRef;
}
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const PRE_PORTAL_DIV_SIZE = 1;
/**
* @deprecated Use LexicalNodeContextMenuPlugin instead.
*/
function LexicalContextMenuPlugin({
options,
onWillOpen,
onClose,
onOpen,
onSelectOption,
menuRenderFn: contextMenuRenderFn,
anchorClassName,
commandPriority = COMMAND_PRIORITY_LOW,
parent
}) {
const [editor] = useLexicalComposerContext();
const [resolution, setResolution] = useState(null);
const menuRef = React.useRef(null);
const anchorElementRef = useMenuAnchorRef(resolution, setResolution, anchorClassName, parent);
const closeNodeMenu = useCallback(() => {
setResolution(null);
if (onClose != null && resolution !== null) {
onClose();
}
}, [onClose, resolution]);
const openNodeMenu = useCallback(res => {
setResolution(res);
if (onOpen != null && resolution === null) {
onOpen(res);
}
}, [onOpen, resolution]);
const handleContextMenu = useCallback(event => {
event.preventDefault();
if (onWillOpen != null) {
onWillOpen(event);
}
const zoom = calculateZoomLevel(event.target);
openNodeMenu({
getRect: () => new DOMRect(event.clientX / zoom, event.clientY / zoom, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
});
}, [openNodeMenu, onWillOpen]);
const handleClick = useCallback(event => {
if (resolution !== null && menuRef.current != null && event.target != null && isDOMNode(event.target) && !menuRef.current.contains(event.target)) {
closeNodeMenu();
}
}, [closeNodeMenu, resolution]);
useEffect(() => {
const editorElement = editor.getRootElement();
if (editorElement) {
editorElement.addEventListener('contextmenu', handleContextMenu);
return () => editorElement.removeEventListener('contextmenu', handleContextMenu);
}
}, [editor, handleContextMenu]);
useEffect(() => {
document.addEventListener('click', handleClick);
return () => document.removeEventListener('click', handleClick);
}, [editor, handleClick]);
return anchorElementRef.current === null || resolution === null || editor === null ? null : /*#__PURE__*/jsx(LexicalMenu, {
close: closeNodeMenu,
resolution: resolution,
editor: editor,
anchorElementRef: anchorElementRef,
options: options,
menuRenderFn: (anchorRef, itemProps) => contextMenuRenderFn(anchorRef, itemProps, {
setMenuRef: ref => {
menuRef.current = ref;
}
}),
onSelectOption: onSelectOption,
commandPriority: commandPriority
});
}
export { LexicalContextMenuPlugin, MenuOption };

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/postgres/predefinedMigrations/v2-v3/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;AAEtC,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACjD,CAAA"}

View File

@@ -0,0 +1,34 @@
"use strict";
exports.startOfDecade = startOfDecade;
var _index = require("./toDate.js");
/**
* @name startOfDecade
* @category Decade Helpers
* @summary Return the start of a decade for the given date.
*
* @description
* Return the start of a decade for the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The start of a decade
*
* @example
* // The start of a decade for 21 October 2015 00:00:00:
* const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00))
* //=> Jan 01 2010 00:00:00
*/
function startOfDecade(date) {
// TODO: Switch to more technical definition in of decades that start with 1
// end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking
// change, so it can only be done in 4.0.
const _date = (0, _index.toDate)(date);
const year = _date.getFullYear();
const decade = Math.floor(year / 10) * 10;
_date.setFullYear(decade, 0, 1);
_date.setHours(0, 0, 0, 0);
return _date;
}

View File

@@ -0,0 +1 @@
module.exports={C:{"60":0.02908,"68":0.01163,"84":0.01163,"115":0.08141,"125":0.20934,"135":0.05815,"141":0.08723,"143":0.02908,"145":0.15119,"146":0.86644,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 126 127 128 129 130 131 132 133 134 136 137 138 139 140 142 144 147 148 149 3.5 3.6"},D:{"70":0.11049,"71":0.05234,"74":0.01163,"76":1.52353,"81":0.04071,"86":0.01163,"89":0.01163,"103":0.01745,"104":0.04071,"109":3.19244,"111":0.01163,"116":0.01163,"119":0.04071,"120":0.02908,"123":0.01163,"125":0.15701,"126":0.04071,"127":0.04071,"130":0.08723,"131":0.01163,"134":0.04071,"135":0.01745,"137":0.01745,"138":0.05234,"139":0.04071,"140":0.08723,"141":0.81992,"142":8.64109,"143":12.97908,"144":0.01163,"145":0.05234,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 72 73 75 77 78 79 80 83 84 85 87 88 90 91 92 93 94 95 96 97 98 99 100 101 102 105 106 107 108 110 112 113 114 115 117 118 121 122 124 128 129 132 133 136 146"},F:{"60":0.01745,"79":0.11049,"93":0.05234,"124":0.25005,"125":0.12793,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"100":0.01745,"109":0.05815,"110":0.15701,"113":0.01163,"117":0.01163,"133":0.01163,"141":0.01745,"142":0.27912,"143":2.12248,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 111 112 114 115 116 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 134 135 136 137 138 139 140"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.4 17.5 17.6 18.0 18.1 18.2 18.3 18.4 26.3","13.1":0.04071,"15.6":0.08723,"16.6":0.01163,"17.2":1.48283,"17.3":0.01163,"18.5-18.6":0.09886,"26.0":0.01163,"26.1":0.15119,"26.2":0.01163},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00094,"5.0-5.1":0,"6.0-6.1":0.00188,"7.0-7.1":0.00141,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00376,"10.0-10.2":0.00047,"10.3":0.00657,"11.0-11.2":0.08076,"11.3-11.4":0.00235,"12.0-12.1":0.00188,"12.2-12.5":0.02113,"13.0-13.1":0.00047,"13.2":0.00329,"13.3":0.00094,"13.4-13.7":0.00329,"14.0-14.4":0.00657,"14.5-14.8":0.00704,"15.0-15.1":0.00751,"15.2-15.3":0.00563,"15.4":0.0061,"15.5":0.00657,"15.6-15.8":0.10189,"16.0":0.01174,"16.1":0.02254,"16.2":0.01174,"16.3":0.02113,"16.4":0.00517,"16.5":0.00892,"16.6-16.7":0.13242,"17.0":0.00751,"17.1":0.01221,"17.2":0.00892,"17.3":0.01362,"17.4":0.02301,"17.5":0.04508,"17.6-17.7":0.10424,"18.0":0.02348,"18.1":0.04883,"18.2":0.02583,"18.3":0.08405,"18.4":0.0432,"18.5-18.7":3.10189,"26.0":0.06057,"26.1":0.50383,"26.2":0.09579,"26.3":0.00423},P:{"4":0.56949,"22":0.02034,"23":0.02034,"24":0.05085,"25":0.05085,"26":0.03051,"27":0.11187,"28":0.07119,"29":0.74238,_:"20 21 5.0-5.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 19.0","6.2-6.4":0.01017,"7.2-7.4":0.02034,"16.0":0.04068,"17.0":0.28475,"18.0":0.01017},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},A:{"11":3.70416,_:"6 7 8 9 10 5.5"},K:{"0":0.44709,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.113},H:{"0":0.03},L:{"0":38.23228},R:{_:"0"},M:{"0":0.02093}};

View File

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

View File

@@ -0,0 +1,36 @@
import { DirectusUser } from "../../../schema/user.js";
import { ApplyQueryFields } from "../../../types/output.js";
import { Query } from "../../../types/query.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/read/users.d.ts
type ReadUserOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusUser<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* List all users that exist in Directus.
*
* @param query The query parameters
*
* @returns An array of up to limit user objects. If no items are available, data will be an empty array.
*/
declare const readUsers: <Schema, const TQuery extends Query<Schema, DirectusUser<Schema>>>(query?: TQuery) => RestCommand<ReadUserOutput<Schema, TQuery>[], Schema>;
/**
* List an existing user by primary key.
*
* @param key The primary key of the user
* @param query The query parameters
*
* @returns Returns the requested user object.
* @throws Will throw if key is empty
*/
declare const readUser: <Schema, const TQuery extends Query<Schema, DirectusUser<Schema>>>(key: DirectusUser<Schema>["id"], query?: TQuery) => RestCommand<ReadUserOutput<Schema, TQuery>, Schema>;
/**
* Retrieve the currently authenticated user.
*
* @param query The query parameters
*
* @returns Returns the user object for the currently authenticated user.
*/
declare const readMe: <Schema, const TQuery extends Query<Schema, DirectusUser<Schema>>>(query?: TQuery) => RestCommand<ReadUserOutput<Schema, TQuery>, Schema>;
//#endregion
export { ReadUserOutput, readMe, readUser, readUsers };
//# sourceMappingURL=users.d.ts.map

View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'أخر' eeee 'عند' p",
yesterday: "'أمس عند' p",
today: "'اليوم عند' p",
tomorrow: "'غداً عند' p",
nextWeek: "eeee 'عند' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,17 @@
import { DirectusField } from "../../../schema/field.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/delete/fields.d.ts
/**
* Deletes the given field in the given collection.
* @param collection
* @param field
* @returns
* @throws Will throw if collection is empty
* @throws Will throw if field is empty
*/
declare const deleteField: <Schema>(collection: DirectusField<Schema>["collection"], field: DirectusField<Schema>["field"]) => RestCommand<void, Schema>;
//#endregion
export { deleteField };
//# sourceMappingURL=fields.d.ts.map

View File

@@ -0,0 +1,11 @@
"use strict";
var _class_apply_descriptor_set = require("./_class_apply_descriptor_set.cjs");
var _class_extract_field_descriptor = require("./_class_extract_field_descriptor.cjs");
function _class_private_field_set(receiver, privateMap, value) {
var descriptor = _class_extract_field_descriptor._(receiver, privateMap, "set");
_class_apply_descriptor_set._(receiver, descriptor, value);
return value;
}
exports._ = _class_private_field_set;

View File

@@ -0,0 +1,181 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const types = require('../types.js');
const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v3__';
/**
* Add an instrumentation handler for when an XHR request happens.
* The handler function is called once when the request starts and once when it ends,
* which can be identified by checking if it has an `endTimestamp`.
*
* Use at your own risk, this might break without changelog notice, only used internally.
* @hidden
*/
function addXhrInstrumentationHandler(handler) {
const type = 'xhr';
core.addHandler(type, handler);
core.maybeInstrument(type, instrumentXHR);
}
/** Exported only for tests. */
function instrumentXHR() {
if (!(types.WINDOW ).XMLHttpRequest) {
return;
}
const xhrproto = XMLHttpRequest.prototype;
// eslint-disable-next-line @typescript-eslint/unbound-method
xhrproto.open = new Proxy(xhrproto.open, {
apply(
originalOpen,
xhrOpenThisArg,
xhrOpenArgArray
,
) {
// NOTE: If you are a Sentry user, and you are seeing this stack frame,
// it means the error, that was caused by your XHR call did not
// have a stack trace. If you are using HttpClient integration,
// this is the expected behavior, as we are using this virtual error to capture
// the location of your XHR call, and group your HttpClient events accordingly.
const virtualError = new Error();
const startTimestamp = core.timestampInSeconds() * 1000;
// open() should always be called with two or more arguments
// But to be on the safe side, we actually validate this and bail out if we don't have a method & url
const method = core.isString(xhrOpenArgArray[0]) ? xhrOpenArgArray[0].toUpperCase() : undefined;
const url = parseXhrUrlArg(xhrOpenArgArray[1]);
if (!method || !url) {
return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray);
}
xhrOpenThisArg[SENTRY_XHR_DATA_KEY] = {
method,
url,
request_headers: {},
};
// if Sentry key appears in URL, don't capture it as a request
if (method === 'POST' && url.match(/sentry_key/)) {
xhrOpenThisArg.__sentry_own_request__ = true;
}
const onreadystatechangeHandler = () => {
// For whatever reason, this is not the same instance here as from the outer method
const xhrInfo = xhrOpenThisArg[SENTRY_XHR_DATA_KEY];
if (!xhrInfo) {
return;
}
if (xhrOpenThisArg.readyState === 4) {
try {
// touching statusCode in some platforms throws
// an exception
xhrInfo.status_code = xhrOpenThisArg.status;
} catch {
/* do nothing */
}
const handlerData = {
endTimestamp: core.timestampInSeconds() * 1000,
startTimestamp,
xhr: xhrOpenThisArg,
virtualError,
};
core.triggerHandlers('xhr', handlerData);
}
};
if ('onreadystatechange' in xhrOpenThisArg && typeof xhrOpenThisArg.onreadystatechange === 'function') {
xhrOpenThisArg.onreadystatechange = new Proxy(xhrOpenThisArg.onreadystatechange, {
apply(originalOnreadystatechange, onreadystatechangeThisArg, onreadystatechangeArgArray) {
onreadystatechangeHandler();
return originalOnreadystatechange.apply(onreadystatechangeThisArg, onreadystatechangeArgArray);
},
});
} else {
xhrOpenThisArg.addEventListener('readystatechange', onreadystatechangeHandler);
}
// Intercepting `setRequestHeader` to access the request headers of XHR instance.
// This will only work for user/library defined headers, not for the default/browser-assigned headers.
// Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.
xhrOpenThisArg.setRequestHeader = new Proxy(xhrOpenThisArg.setRequestHeader, {
apply(
originalSetRequestHeader,
setRequestHeaderThisArg,
setRequestHeaderArgArray,
) {
const [header, value] = setRequestHeaderArgArray;
const xhrInfo = setRequestHeaderThisArg[SENTRY_XHR_DATA_KEY];
if (xhrInfo && core.isString(header) && core.isString(value)) {
xhrInfo.request_headers[header.toLowerCase()] = value;
}
return originalSetRequestHeader.apply(setRequestHeaderThisArg, setRequestHeaderArgArray);
},
});
return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray);
},
});
// eslint-disable-next-line @typescript-eslint/unbound-method
xhrproto.send = new Proxy(xhrproto.send, {
apply(originalSend, sendThisArg, sendArgArray) {
const sentryXhrData = sendThisArg[SENTRY_XHR_DATA_KEY];
if (!sentryXhrData) {
return originalSend.apply(sendThisArg, sendArgArray);
}
if (sendArgArray[0] !== undefined) {
sentryXhrData.body = sendArgArray[0];
}
const handlerData = {
startTimestamp: core.timestampInSeconds() * 1000,
xhr: sendThisArg,
};
core.triggerHandlers('xhr', handlerData);
return originalSend.apply(sendThisArg, sendArgArray);
},
});
}
/**
* Parses the URL argument of a XHR method to a string.
*
* See: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open#url
* url: A string or any other object with a stringifier — including a URL object — that provides the URL of the resource to send the request to.
*
* @param url - The URL argument of an XHR method
* @returns The parsed URL string or undefined if the URL is invalid
*/
function parseXhrUrlArg(url) {
if (core.isString(url)) {
return url;
}
try {
// If the passed in argument is not a string, it should have a `toString` method as a stringifier.
// If that fails, we just return undefined (like in IE11 where URL is not available)
return (url ).toString();
} catch {} // eslint-disable-line no-empty
return undefined;
}
exports.SENTRY_XHR_DATA_KEY = SENTRY_XHR_DATA_KEY;
exports.addXhrInstrumentationHandler = addXhrInstrumentationHandler;
exports.instrumentXHR = instrumentXHR;
//# sourceMappingURL=xhr.js.map

View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from './LexicalEditor';
export declare function getIsProcessingMutations(): boolean;
export declare function flushRootMutations(editor: LexicalEditor): void;
export declare function initMutationObserver(editor: LexicalEditor): void;

View File

@@ -0,0 +1,5 @@
export { useWindowInfo } from './useWindowInfo/index.js';
export { WindowInfo } from './WindowInfo/index.js';
export { WindowInfoContext } from './WindowInfoProvider/context.js';
export { WindowInfoProvider } from './WindowInfoProvider/index.js';
export { withWindowInfo } from './withWindowInfo/index.js';

View File

@@ -0,0 +1,67 @@
'use server';
import { getPayload } from 'payload';
import { setPayloadAuthCookie } from '../utilities/setPayloadAuthCookie.js';
export async function login({
collection,
config,
email,
password,
username
}) {
const payload = await getPayload({
config,
cron: true
});
const authConfig = payload.collections[collection]?.config.auth;
if (!authConfig) {
throw new Error(`No auth config found for collection: ${collection}`);
}
const loginWithUsername = authConfig?.loginWithUsername ?? false;
if (loginWithUsername) {
if (loginWithUsername.allowEmailLogin) {
if (!email && !username) {
throw new Error('Email or username is required.');
}
} else {
if (!username) {
throw new Error('Username is required.');
}
}
} else {
if (!email) {
throw new Error('Email is required.');
}
}
let loginData;
if (loginWithUsername) {
loginData = username ? {
password,
username
} : {
email,
password
};
} else {
loginData = {
email,
password
};
}
const result = await payload.login({
collection,
data: loginData
});
if (result.token) {
await setPayloadAuthCookie({
authConfig,
cookiePrefix: payload.config.cookiePrefix,
token: result.token
});
}
if ('removeTokenFromResponses' in config && config.removeTokenFromResponses) {
delete result.token;
}
return result;
}
//# sourceMappingURL=login.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"WatchCondition.d.ts","sourceRoot":"","sources":["../../../src/forms/withCondition/WatchCondition.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;CACb,CAYA,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"invalid-span-constants.js","sourceRoot":"","sources":["../../../src/trace/invalid-span-constants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,+CAA2C;AAE9B,QAAA,cAAc,GAAG,kBAAkB,CAAC;AACpC,QAAA,eAAe,GAAG,kCAAkC,CAAC;AACrD,QAAA,oBAAoB,GAAgB;IAC/C,OAAO,EAAE,uBAAe;IACxB,MAAM,EAAE,sBAAc;IACtB,UAAU,EAAE,wBAAU,CAAC,IAAI;CAC5B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SpanContext } from './span_context';\nimport { TraceFlags } from './trace_flags';\n\nexport const INVALID_SPANID = '0000000000000000';\nexport const INVALID_TRACEID = '00000000000000000000000000000000';\nexport const INVALID_SPAN_CONTEXT: SpanContext = {\n traceId: INVALID_TRACEID,\n spanId: INVALID_SPANID,\n traceFlags: TraceFlags.NONE,\n};\n"]}

View File

@@ -0,0 +1,133 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /\d+/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(нтө|нт)/i,
abbreviated: /^(нтө|нт)/i,
wide: /^(нийтийн тооллын өмнө|нийтийн тооллын)/i,
};
const parseEraPatterns = {
any: [/^(нтө|нийтийн тооллын өмнө)/i, /^(нт|нийтийн тооллын)/i],
};
const matchQuarterPatterns = {
narrow: /^(iv|iii|ii|i)/i,
abbreviated: /^(iv|iii|ii|i) улирал/i,
wide: /^[1-4]-р улирал/i,
};
const parseQuarterPatterns = {
any: [/^(i(\s|$)|1)/i, /^(ii(\s|$)|2)/i, /^(iii(\s|$)|3)/i, /^(iv(\s|$)|4)/i],
};
const matchMonthPatterns = {
narrow: /^(xii|xi|x|ix|viii|vii|vi|v|iv|iii|ii|i)/i,
abbreviated:
/^(1-р сар|2-р сар|3-р сар|4-р сар|5-р сар|6-р сар|7-р сар|8-р сар|9-р сар|10-р сар|11-р сар|12-р сар)/i,
wide: /^(нэгдүгээр сар|хоёрдугаар сар|гуравдугаар сар|дөрөвдүгээр сар|тавдугаар сар|зургаадугаар сар|долоодугаар сар|наймдугаар сар|есдүгээр сар|аравдугаар сар|арван нэгдүгээр сар|арван хоёрдугаар сар)/i,
};
const parseMonthPatterns = {
narrow: [
/^i$/i,
/^ii$/i,
/^iii$/i,
/^iv$/i,
/^v$/i,
/^vi$/i,
/^vii$/i,
/^viii$/i,
/^ix$/i,
/^x$/i,
/^xi$/i,
/^xii$/i,
],
any: [
/^(1|нэгдүгээр)/i,
/^(2|хоёрдугаар)/i,
/^(3|гуравдугаар)/i,
/^(4|дөрөвдүгээр)/i,
/^(5|тавдугаар)/i,
/^(6|зургаадугаар)/i,
/^(7|долоодугаар)/i,
/^(8|наймдугаар)/i,
/^(9|есдүгээр)/i,
/^(10|аравдугаар)/i,
/^(11|арван нэгдүгээр)/i,
/^(12|арван хоёрдугаар)/i,
],
};
const matchDayPatterns = {
narrow: /^[ндмлпбб]/i,
short: /^(ня|да|мя|лх|пү|ба|бя)/i,
abbreviated: /^(ням|дав|мяг|лха|пүр|баа|бям)/i,
wide: /^(ням|даваа|мягмар|лхагва|пүрэв|баасан|бямба)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^д/i, /^м/i, /^л/i, /^п/i, /^б/i, /^б/i],
any: [/^ня/i, /^да/i, /^мя/i, /^лх/i, /^пү/i, /^ба/i, /^бя/i],
};
const matchDayPeriodPatterns = {
narrow: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i,
any: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ү\.ө\./i,
pm: /^ү\.х\./i,
midnight: /^шөнө дунд/i,
noon: /^үд дунд/i,
morning: /өглөө/i,
afternoon: /өдөр/i,
evening: /орой/i,
night: /шөнө/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => 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",
}),
};

View File

@@ -0,0 +1,30 @@
"use strict";
exports.millisecondsToMinutes = millisecondsToMinutes;
var _index = require("./constants.cjs");
/**
* @name millisecondsToMinutes
* @category Conversion Helpers
* @summary Convert milliseconds to minutes.
*
* @description
* Convert a number of milliseconds to a full number of minutes.
*
* @param milliseconds - The number of milliseconds to be converted
*
* @returns The number of milliseconds converted in minutes
*
* @example
* // Convert 60000 milliseconds to minutes:
* const result = millisecondsToMinutes(60000)
* //=> 1
*
* @example
* // It uses floor rounding:
* const result = millisecondsToMinutes(119999)
* //=> 1
*/
function millisecondsToMinutes(milliseconds) {
const minutes = milliseconds / _index.millisecondsInMinute;
return Math.trunc(minutes);
}

View File

@@ -0,0 +1,164 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["aC", "dC"],
abbreviated: ["a.C.", "d.C."],
wide: ["avanti Cristo", "dopo Cristo"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["T1", "T2", "T3", "T4"],
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"],
};
const monthValues = {
narrow: ["G", "F", "M", "A", "M", "G", "L", "A", "S", "O", "N", "D"],
abbreviated: [
"gen",
"feb",
"mar",
"apr",
"mag",
"giu",
"lug",
"ago",
"set",
"ott",
"nov",
"dic",
],
wide: [
"gennaio",
"febbraio",
"marzo",
"aprile",
"maggio",
"giugno",
"luglio",
"agosto",
"settembre",
"ottobre",
"novembre",
"dicembre",
],
};
const dayValues = {
narrow: ["D", "L", "M", "M", "G", "V", "S"],
short: ["dom", "lun", "mar", "mer", "gio", "ven", "sab"],
abbreviated: ["dom", "lun", "mar", "mer", "gio", "ven", "sab"],
wide: [
"domenica",
"lunedì",
"martedì",
"mercoledì",
"giovedì",
"venerdì",
"sabato",
],
};
const dayPeriodValues = {
narrow: {
am: "m.",
pm: "p.",
midnight: "mezzanotte",
noon: "mezzogiorno",
morning: "mattina",
afternoon: "pomeriggio",
evening: "sera",
night: "notte",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "mezzanotte",
noon: "mezzogiorno",
morning: "mattina",
afternoon: "pomeriggio",
evening: "sera",
night: "notte",
},
wide: {
am: "AM",
pm: "PM",
midnight: "mezzanotte",
noon: "mezzogiorno",
morning: "mattina",
afternoon: "pomeriggio",
evening: "sera",
night: "notte",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "m.",
pm: "p.",
midnight: "mezzanotte",
noon: "mezzogiorno",
morning: "di mattina",
afternoon: "del pomeriggio",
evening: "di sera",
night: "di notte",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "mezzanotte",
noon: "mezzogiorno",
morning: "di mattina",
afternoon: "del pomeriggio",
evening: "di sera",
night: "di notte",
},
wide: {
am: "AM",
pm: "PM",
midnight: "mezzanotte",
noon: "mezzogiorno",
morning: "di mattina",
afternoon: "del pomeriggio",
evening: "di sera",
night: "di notte",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return String(number);
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,39 @@
import { toDate } from "./toDate.js";
/**
* The {@link endOfQuarter} function options.
*/
/**
* @name endOfQuarter
* @category Quarter Helpers
* @summary Return the end of a year quarter for the given date.
*
* @description
* Return the end of a year quarter for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The end of a quarter
*
* @example
* // The end of a quarter for 2 September 2014 11:55:00:
* const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 30 2014 23:59:59.999
*/
export function endOfQuarter(date, options) {
const _date = toDate(date, options?.in);
const currentMonth = _date.getMonth();
const month = currentMonth - (currentMonth % 3) + 3;
_date.setMonth(month, 0);
_date.setHours(23, 59, 59, 999);
return _date;
}
// Fallback for modularized imports:
export default endOfQuarter;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Versions/cells/AutosaveCell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,cAAc,CAAA;AAIrB,KAAK,iBAAiB,GAAG;IACvB,yBAAyB,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAA;IAChD,kBAAkB,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAA;IACzC,OAAO,EAAE;QACP,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;QACnB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,EAAE;YACP,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;YACtB,OAAO,EAAE,OAAO,GAAG,WAAW,CAAA;YAC9B,SAAS,EAAE,MAAM,CAAA;SAClB,CAAA;KACF,CAAA;CACF,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoBpD,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/pg-core/foreign-keys.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport { TableName } from '~/table.utils.ts';\nimport type { AnyPgColumn, PgColumn } from './columns/index.ts';\nimport type { PgTable } from './table.ts';\n\nexport type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default';\n\nexport type Reference = () => {\n\treadonly name?: string;\n\treadonly columns: PgColumn[];\n\treadonly foreignTable: PgTable;\n\treadonly foreignColumns: PgColumn[];\n};\n\nexport class ForeignKeyBuilder {\n\tstatic readonly [entityKind]: string = 'PgForeignKeyBuilder';\n\n\t/** @internal */\n\treference: Reference;\n\n\t/** @internal */\n\t_onUpdate: UpdateDeleteAction | undefined = 'no action';\n\n\t/** @internal */\n\t_onDelete: UpdateDeleteAction | undefined = 'no action';\n\n\tconstructor(\n\t\tconfig: () => {\n\t\t\tname?: string;\n\t\t\tcolumns: PgColumn[];\n\t\t\tforeignColumns: PgColumn[];\n\t\t},\n\t\tactions?: {\n\t\t\tonUpdate?: UpdateDeleteAction;\n\t\t\tonDelete?: UpdateDeleteAction;\n\t\t} | undefined,\n\t) {\n\t\tthis.reference = () => {\n\t\t\tconst { name, columns, foreignColumns } = config();\n\t\t\treturn { name, columns, foreignTable: foreignColumns[0]!.table as PgTable, foreignColumns };\n\t\t};\n\t\tif (actions) {\n\t\t\tthis._onUpdate = actions.onUpdate;\n\t\t\tthis._onDelete = actions.onDelete;\n\t\t}\n\t}\n\n\tonUpdate(action: UpdateDeleteAction): this {\n\t\tthis._onUpdate = action === undefined ? 'no action' : action;\n\t\treturn this;\n\t}\n\n\tonDelete(action: UpdateDeleteAction): this {\n\t\tthis._onDelete = action === undefined ? 'no action' : action;\n\t\treturn this;\n\t}\n\n\t/** @internal */\n\tbuild(table: PgTable): ForeignKey {\n\t\treturn new ForeignKey(table, this);\n\t}\n}\n\nexport type AnyForeignKeyBuilder = ForeignKeyBuilder;\n\nexport class ForeignKey {\n\tstatic readonly [entityKind]: string = 'PgForeignKey';\n\n\treadonly reference: Reference;\n\treadonly onUpdate: UpdateDeleteAction | undefined;\n\treadonly onDelete: UpdateDeleteAction | undefined;\n\n\tconstructor(readonly table: PgTable, builder: ForeignKeyBuilder) {\n\t\tthis.reference = builder.reference;\n\t\tthis.onUpdate = builder._onUpdate;\n\t\tthis.onDelete = builder._onDelete;\n\t}\n\n\tgetName(): string {\n\t\tconst { name, columns, foreignColumns } = this.reference();\n\t\tconst columnNames = columns.map((column) => column.name);\n\t\tconst foreignColumnNames = foreignColumns.map((column) => column.name);\n\t\tconst chunks = [\n\t\t\tthis.table[TableName],\n\t\t\t...columnNames,\n\t\t\tforeignColumns[0]!.table[TableName],\n\t\t\t...foreignColumnNames,\n\t\t];\n\t\treturn name ?? `${chunks.join('_')}_fk`;\n\t}\n}\n\ntype ColumnsWithTable<\n\tTTableName extends string,\n\tTColumns extends PgColumn[],\n> = { [Key in keyof TColumns]: AnyPgColumn<{ tableName: TTableName }> };\n\nexport function foreignKey<\n\tTTableName extends string,\n\tTForeignTableName extends string,\n\tTColumns extends [AnyPgColumn<{ tableName: TTableName }>, ...AnyPgColumn<{ tableName: TTableName }>[]],\n>(\n\tconfig: {\n\t\tname?: string;\n\t\tcolumns: TColumns;\n\t\tforeignColumns: ColumnsWithTable<TForeignTableName, TColumns>;\n\t},\n): ForeignKeyBuilder {\n\tfunction mappedConfig() {\n\t\tconst { name, columns, foreignColumns } = config;\n\t\treturn {\n\t\t\tname,\n\t\t\tcolumns,\n\t\t\tforeignColumns,\n\t\t};\n\t}\n\n\treturn new ForeignKeyBuilder(mappedConfig);\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAanB,MAAM,kBAAkB;AAAA,EAC9B,QAAiB,UAAU,IAAY;AAAA;AAAA,EAGvC;AAAA;AAAA,EAGA,YAA4C;AAAA;AAAA,EAG5C,YAA4C;AAAA,EAE5C,YACC,QAKA,SAIC;AACD,SAAK,YAAY,MAAM;AACtB,YAAM,EAAE,MAAM,SAAS,eAAe,IAAI,OAAO;AACjD,aAAO,EAAE,MAAM,SAAS,cAAc,eAAe,CAAC,EAAG,OAAkB,eAAe;AAAA,IAC3F;AACA,QAAI,SAAS;AACZ,WAAK,YAAY,QAAQ;AACzB,WAAK,YAAY,QAAQ;AAAA,IAC1B;AAAA,EACD;AAAA,EAEA,SAAS,QAAkC;AAC1C,SAAK,YAAY,WAAW,SAAY,cAAc;AACtD,WAAO;AAAA,EACR;AAAA,EAEA,SAAS,QAAkC;AAC1C,SAAK,YAAY,WAAW,SAAY,cAAc;AACtD,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,MAAM,OAA4B;AACjC,WAAO,IAAI,WAAW,OAAO,IAAI;AAAA,EAClC;AACD;AAIO,MAAM,WAAW;AAAA,EAOvB,YAAqB,OAAgB,SAA4B;AAA5C;AACpB,SAAK,YAAY,QAAQ;AACzB,SAAK,WAAW,QAAQ;AACxB,SAAK,WAAW,QAAQ;AAAA,EACzB;AAAA,EAVA,QAAiB,UAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAAA,EACA;AAAA,EAQT,UAAkB;AACjB,UAAM,EAAE,MAAM,SAAS,eAAe,IAAI,KAAK,UAAU;AACzD,UAAM,cAAc,QAAQ,IAAI,CAAC,WAAW,OAAO,IAAI;AACvD,UAAM,qBAAqB,eAAe,IAAI,CAAC,WAAW,OAAO,IAAI;AACrE,UAAM,SAAS;AAAA,MACd,KAAK,MAAM,SAAS;AAAA,MACpB,GAAG;AAAA,MACH,eAAe,CAAC,EAAG,MAAM,SAAS;AAAA,MAClC,GAAG;AAAA,IACJ;AACA,WAAO,QAAQ,GAAG,OAAO,KAAK,GAAG,CAAC;AAAA,EACnC;AACD;AAOO,SAAS,WAKf,QAKoB;AACpB,WAAS,eAAe;AACvB,UAAM,EAAE,MAAM,SAAS,eAAe,IAAI;AAC1C,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,SAAO,IAAI,kBAAkB,YAAY;AAC1C;","names":[]}

View File

@@ -0,0 +1,16 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SquareM = createLucideIcon("SquareM", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M8 16V8l4 4 4-4v8", key: "141u4e" }]
]);
export { SquareM as default };
//# sourceMappingURL=square-m.js.map

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Brian Donovan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,38 @@
import { addWeeks } from "./addWeeks.mjs";
import { millisecondsInWeek } from "./constants.mjs";
import { startOfISOWeekYear } from "./startOfISOWeekYear.mjs";
/**
* @name getISOWeeksInYear
* @category ISO Week-Numbering Year Helpers
* @summary Get the number of weeks in an ISO week-numbering year of the given date.
*
* @description
* Get the number of weeks in an ISO week-numbering year of the given date.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
*
* @returns The number of ISO weeks in a year
*
* @example
* // How many weeks are in ISO week-numbering year 2015?
* const result = getISOWeeksInYear(new Date(2015, 1, 11))
* //=> 53
*/
export function getISOWeeksInYear(date) {
const thisYear = startOfISOWeekYear(date);
const nextYear = startOfISOWeekYear(addWeeks(thisYear, 60));
const diff = +nextYear - +thisYear;
// Round the number of weeks to the nearest integer because the number of
// milliseconds in a week is not constant (e.g. it's different in the week of
// the daylight saving time clock shift).
return Math.round(diff / millisecondsInWeek);
}
// Fallback for modularized imports:
export default getISOWeeksInYear;

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/baseFields/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAEzD,eAAO,MAAM,cAAc,EAAE,KAAK,EAqBjC,CAAA"}

View File

@@ -0,0 +1,27 @@
{
"name": "@babel/helper-validator-option",
"version": "7.27.1",
"description": "Validate plugin/preset options",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helper-validator-option"
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "./lib/index.js",
"exports": {
".": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
},
"./package.json": "./package.json"
},
"engines": {
"node": ">=6.9.0"
},
"author": "The Babel Team (https://babel.dev/team)",
"type": "commonjs"
}

View File

@@ -0,0 +1,7 @@
import type { Locale, PayloadRequest } from 'payload';
type GetRequestLocalesArgs = {
req: PayloadRequest;
};
export declare function getRequestLocale({ req }: GetRequestLocalesArgs): Promise<Locale>;
export {};
//# sourceMappingURL=getRequestLocale.d.ts.map

View File

@@ -0,0 +1,55 @@
{
"name": "undici-types",
"version": "6.21.0",
"description": "A stand-alone types package for Undici",
"homepage": "https://undici.nodejs.org",
"bugs": {
"url": "https://github.com/nodejs/undici/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nodejs/undici.git"
},
"license": "MIT",
"types": "index.d.ts",
"files": [
"*.d.ts"
],
"contributors": [
{
"name": "Daniele Belardi",
"url": "https://github.com/dnlup",
"author": true
},
{
"name": "Ethan Arrowood",
"url": "https://github.com/ethan-arrowood",
"author": true
},
{
"name": "Matteo Collina",
"url": "https://github.com/mcollina",
"author": true
},
{
"name": "Matthew Aitken",
"url": "https://github.com/KhafraDev",
"author": true
},
{
"name": "Robert Nagy",
"url": "https://github.com/ronag",
"author": true
},
{
"name": "Szymon Marczak",
"url": "https://github.com/szmarczak",
"author": true
},
{
"name": "Tomas Della Vedova",
"url": "https://github.com/delvedor",
"author": true
}
]
}

View File

@@ -0,0 +1,224 @@
function isPluralType(val) {
return val.one !== undefined;
}
const formatDistanceLocale = {
lessThanXSeconds: {
one: {
default: "ஒரு வினாடிக்கு குறைவாக",
in: "ஒரு வினாடிக்குள்",
ago: "ஒரு வினாடிக்கு முன்பு",
},
other: {
default: "{{count}} வினாடிகளுக்கு குறைவாக",
in: "{{count}} வினாடிகளுக்குள்",
ago: "{{count}} வினாடிகளுக்கு முன்பு",
},
},
xSeconds: {
one: {
default: "1 வினாடி",
in: "1 வினாடியில்",
ago: "1 வினாடி முன்பு",
},
other: {
default: "{{count}} விநாடிகள்",
in: "{{count}} வினாடிகளில்",
ago: "{{count}} விநாடிகளுக்கு முன்பு",
},
},
halfAMinute: {
default: "அரை நிமிடம்",
in: "அரை நிமிடத்தில்",
ago: "அரை நிமிடம் முன்பு",
},
lessThanXMinutes: {
one: {
default: "ஒரு நிமிடத்திற்கும் குறைவாக",
in: "ஒரு நிமிடத்திற்குள்",
ago: "ஒரு நிமிடத்திற்கு முன்பு",
},
other: {
default: "{{count}} நிமிடங்களுக்கும் குறைவாக",
in: "{{count}} நிமிடங்களுக்குள்",
ago: "{{count}} நிமிடங்களுக்கு முன்பு",
},
},
xMinutes: {
one: {
default: "1 நிமிடம்",
in: "1 நிமிடத்தில்",
ago: "1 நிமிடம் முன்பு",
},
other: {
default: "{{count}} நிமிடங்கள்",
in: "{{count}} நிமிடங்களில்",
ago: "{{count}} நிமிடங்களுக்கு முன்பு",
},
},
aboutXHours: {
one: {
default: "சுமார் 1 மணி நேரம்",
in: "சுமார் 1 மணி நேரத்தில்",
ago: "சுமார் 1 மணி நேரத்திற்கு முன்பு",
},
other: {
default: "சுமார் {{count}} மணி நேரம்",
in: "சுமார் {{count}} மணி நேரத்திற்கு முன்பு",
ago: "சுமார் {{count}} மணி நேரத்தில்",
},
},
xHours: {
one: {
default: "1 மணி நேரம்",
in: "1 மணி நேரத்தில்",
ago: "1 மணி நேரத்திற்கு முன்பு",
},
other: {
default: "{{count}} மணி நேரம்",
in: "{{count}} மணி நேரத்தில்",
ago: "{{count}} மணி நேரத்திற்கு முன்பு",
},
},
xDays: {
one: {
default: "1 நாள்",
in: "1 நாளில்",
ago: "1 நாள் முன்பு",
},
other: {
default: "{{count}} நாட்கள்",
in: "{{count}} நாட்களில்",
ago: "{{count}} நாட்களுக்கு முன்பு",
},
},
aboutXWeeks: {
one: {
default: "சுமார் 1 வாரம்",
in: "சுமார் 1 வாரத்தில்",
ago: "சுமார் 1 வாரம் முன்பு",
},
other: {
default: "சுமார் {{count}} வாரங்கள்",
in: "சுமார் {{count}} வாரங்களில்",
ago: "சுமார் {{count}} வாரங்களுக்கு முன்பு",
},
},
xWeeks: {
one: {
default: "1 வாரம்",
in: "1 வாரத்தில்",
ago: "1 வாரம் முன்பு",
},
other: {
default: "{{count}} வாரங்கள்",
in: "{{count}} வாரங்களில்",
ago: "{{count}} வாரங்களுக்கு முன்பு",
},
},
aboutXMonths: {
one: {
default: "சுமார் 1 மாதம்",
in: "சுமார் 1 மாதத்தில்",
ago: "சுமார் 1 மாதத்திற்கு முன்பு",
},
other: {
default: "சுமார் {{count}} மாதங்கள்",
in: "சுமார் {{count}} மாதங்களில்",
ago: "சுமார் {{count}} மாதங்களுக்கு முன்பு",
},
},
xMonths: {
one: {
default: "1 மாதம்",
in: "1 மாதத்தில்",
ago: "1 மாதம் முன்பு",
},
other: {
default: "{{count}} மாதங்கள்",
in: "{{count}} மாதங்களில்",
ago: "{{count}} மாதங்களுக்கு முன்பு",
},
},
aboutXYears: {
one: {
default: "சுமார் 1 வருடம்",
in: "சுமார் 1 ஆண்டில்",
ago: "சுமார் 1 வருடம் முன்பு",
},
other: {
default: "சுமார் {{count}} ஆண்டுகள்",
in: "சுமார் {{count}} ஆண்டுகளில்",
ago: "சுமார் {{count}} ஆண்டுகளுக்கு முன்பு",
},
},
xYears: {
one: {
default: "1 வருடம்",
in: "1 ஆண்டில்",
ago: "1 வருடம் முன்பு",
},
other: {
default: "{{count}} ஆண்டுகள்",
in: "{{count}} ஆண்டுகளில்",
ago: "{{count}} ஆண்டுகளுக்கு முன்பு",
},
},
overXYears: {
one: {
default: "1 வருடத்திற்கு மேல்",
in: "1 வருடத்திற்கும் மேலாக",
ago: "1 வருடம் முன்பு",
},
other: {
default: "{{count}} ஆண்டுகளுக்கும் மேலாக",
in: "{{count}} ஆண்டுகளில்",
ago: "{{count}} ஆண்டுகளுக்கு முன்பு",
},
},
almostXYears: {
one: {
default: "கிட்டத்தட்ட 1 வருடம்",
in: "கிட்டத்தட்ட 1 ஆண்டில்",
ago: "கிட்டத்தட்ட 1 வருடம் முன்பு",
},
other: {
default: "கிட்டத்தட்ட {{count}} ஆண்டுகள்",
in: "கிட்டத்தட்ட {{count}} ஆண்டுகளில்",
ago: "கிட்டத்தட்ட {{count}} ஆண்டுகளுக்கு முன்பு",
},
},
};
export const formatDistance = (token, count, options) => {
const tense = options?.addSuffix
? options.comparison && options.comparison > 0
? "in"
: "ago"
: "default";
const tokenValue = formatDistanceLocale[token];
if (!isPluralType(tokenValue)) return tokenValue[tense];
if (count === 1) {
return tokenValue.one[tense];
} else {
return tokenValue.other[tense].replace("{{count}}", String(count));
}
};

View File

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

View File

@@ -0,0 +1,95 @@
import { setDay } from "../../../setDay.mjs";
import { Parser } from "../Parser.mjs";
import { mapValue, parseNDigits } from "../utils.mjs";
// Stand-alone local day of week
export class StandAloneLocalDayParser extends Parser {
priority = 90;
parse(dateString, token, match, options) {
const valueCallback = (value) => {
// We want here floor instead of trunc, so we get -7 for value 0 instead of 0
const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays;
};
switch (token) {
// 3
case "c":
case "cc": // 03
return mapValue(parseNDigits(token.length, dateString), valueCallback);
// 3rd
case "co":
return mapValue(
match.ordinalNumber(dateString, {
unit: "day",
}),
valueCallback,
);
// Tue
case "ccc":
return (
match.day(dateString, {
width: "abbreviated",
context: "standalone",
}) ||
match.day(dateString, { width: "short", context: "standalone" }) ||
match.day(dateString, { width: "narrow", context: "standalone" })
);
// T
case "ccccc":
return match.day(dateString, {
width: "narrow",
context: "standalone",
});
// Tu
case "cccccc":
return (
match.day(dateString, { width: "short", context: "standalone" }) ||
match.day(dateString, { width: "narrow", context: "standalone" })
);
// Tuesday
case "cccc":
default:
return (
match.day(dateString, { width: "wide", context: "standalone" }) ||
match.day(dateString, {
width: "abbreviated",
context: "standalone",
}) ||
match.day(dateString, { width: "short", context: "standalone" }) ||
match.day(dateString, { width: "narrow", context: "standalone" })
);
}
}
validate(_date, value) {
return value >= 0 && value <= 6;
}
set(date, _flags, value, options) {
date = setDay(date, value, options);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = [
"y",
"R",
"u",
"q",
"Q",
"M",
"L",
"I",
"d",
"D",
"E",
"i",
"e",
"t",
"T",
];
}

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("util");
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1,480 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const breadcrumbs = require('../breadcrumbs.js');
const debugBuild = require('../debug-build.js');
const _exports = require('../exports.js');
const integration = require('../integration.js');
const semanticAttributes = require('../semanticAttributes.js');
const debugLogger = require('../utils/debug-logger.js');
const misc = require('../utils/misc.js');
const is = require('../utils/is.js');
const spanstatus = require('../tracing/spanstatus.js');
const trace = require('../tracing/trace.js');
// Based on Kamil Ogórek's work on:
// https://github.com/supabase-community/sentry-integration-js
const AUTH_OPERATIONS_TO_INSTRUMENT = [
'reauthenticate',
'signInAnonymously',
'signInWithOAuth',
'signInWithIdToken',
'signInWithOtp',
'signInWithPassword',
'signInWithSSO',
'signOut',
'signUp',
'verifyOtp',
];
const AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT = [
'createUser',
'deleteUser',
'listUsers',
'getUserById',
'updateUserById',
'inviteUserByEmail',
];
const FILTER_MAPPINGS = {
eq: 'eq',
neq: 'neq',
gt: 'gt',
gte: 'gte',
lt: 'lt',
lte: 'lte',
like: 'like',
'like(all)': 'likeAllOf',
'like(any)': 'likeAnyOf',
ilike: 'ilike',
'ilike(all)': 'ilikeAllOf',
'ilike(any)': 'ilikeAnyOf',
is: 'is',
in: 'in',
cs: 'contains',
cd: 'containedBy',
sr: 'rangeGt',
nxl: 'rangeGte',
sl: 'rangeLt',
nxr: 'rangeLte',
adj: 'rangeAdjacent',
ov: 'overlaps',
fts: '',
plfts: 'plain',
phfts: 'phrase',
wfts: 'websearch',
not: 'not',
};
const DB_OPERATIONS_TO_INSTRUMENT = ['select', 'insert', 'upsert', 'update', 'delete'];
function markAsInstrumented(fn) {
try {
(fn ).__SENTRY_INSTRUMENTED__ = true;
} catch {
// ignore errors here
}
}
function isInstrumented(fn) {
try {
return (fn ).__SENTRY_INSTRUMENTED__;
} catch {
return false;
}
}
/**
* Extracts the database operation type from the HTTP method and headers
* @param method - The HTTP method of the request
* @param headers - The request headers
* @returns The database operation type ('select', 'insert', 'upsert', 'update', or 'delete')
*/
function extractOperation(method, headers = {}) {
switch (method) {
case 'GET': {
return 'select';
}
case 'POST': {
if (headers['Prefer']?.includes('resolution=')) {
return 'upsert';
} else {
return 'insert';
}
}
case 'PATCH': {
return 'update';
}
case 'DELETE': {
return 'delete';
}
default: {
return '<unknown-op>';
}
}
}
/**
* Translates Supabase filter parameters into readable method names for tracing
* @param key - The filter key from the URL search parameters
* @param query - The filter value from the URL search parameters
* @returns A string representation of the filter as a method call
*/
function translateFiltersIntoMethods(key, query) {
if (query === '' || query === '*') {
return 'select(*)';
}
if (key === 'select') {
return `select(${query})`;
}
if (key === 'or' || key.endsWith('.or')) {
return `${key}${query}`;
}
const [filter, ...value] = query.split('.');
let method;
// Handle optional `configPart` of the filter
if (filter?.startsWith('fts')) {
method = 'textSearch';
} else if (filter?.startsWith('plfts')) {
method = 'textSearch[plain]';
} else if (filter?.startsWith('phfts')) {
method = 'textSearch[phrase]';
} else if (filter?.startsWith('wfts')) {
method = 'textSearch[websearch]';
} else {
method = (filter && FILTER_MAPPINGS[filter ]) || 'filter';
}
return `${method}(${key}, ${value.join('.')})`;
}
function instrumentAuthOperation(operation, isAdmin = false) {
return new Proxy(operation, {
apply(target, thisArg, argumentsList) {
return trace.startSpan(
{
name: `auth ${isAdmin ? '(admin) ' : ''}${operation.name}`,
attributes: {
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',
'db.system': 'postgresql',
'db.operation': `auth.${isAdmin ? 'admin.' : ''}${operation.name}`,
},
},
span => {
return Reflect.apply(target, thisArg, argumentsList)
.then((res) => {
if (res && typeof res === 'object' && 'error' in res && res.error) {
span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR });
_exports.captureException(res.error, {
mechanism: {
handled: false,
type: 'auto.db.supabase.auth',
},
});
} else {
span.setStatus({ code: spanstatus.SPAN_STATUS_OK });
}
span.end();
return res;
})
.catch((err) => {
span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR });
span.end();
_exports.captureException(err, {
mechanism: {
handled: false,
type: 'auto.db.supabase.auth',
},
});
throw err;
})
.then(...argumentsList);
},
);
},
});
}
function instrumentSupabaseAuthClient(supabaseClientInstance) {
const auth = supabaseClientInstance.auth;
if (!auth || isInstrumented(supabaseClientInstance.auth)) {
return;
}
for (const operation of AUTH_OPERATIONS_TO_INSTRUMENT) {
const authOperation = auth[operation];
if (!authOperation) {
continue;
}
if (typeof supabaseClientInstance.auth[operation] === 'function') {
supabaseClientInstance.auth[operation] = instrumentAuthOperation(authOperation);
}
}
for (const operation of AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT) {
const authOperation = auth.admin[operation];
if (!authOperation) {
continue;
}
if (typeof supabaseClientInstance.auth.admin[operation] === 'function') {
supabaseClientInstance.auth.admin[operation] = instrumentAuthOperation(authOperation, true);
}
}
markAsInstrumented(supabaseClientInstance.auth);
}
function instrumentSupabaseClientConstructor(SupabaseClient) {
if (isInstrumented((SupabaseClient ).prototype.from)) {
return;
}
(SupabaseClient ).prototype.from = new Proxy(
(SupabaseClient ).prototype.from,
{
apply(target, thisArg, argumentsList) {
const rv = Reflect.apply(target, thisArg, argumentsList);
const PostgRESTQueryBuilder = (rv ).constructor;
instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder );
return rv;
},
},
);
markAsInstrumented((SupabaseClient ).prototype.from);
}
function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder) {
if (isInstrumented((PostgRESTFilterBuilder.prototype ).then)) {
return;
}
(PostgRESTFilterBuilder.prototype ).then = new Proxy(
(PostgRESTFilterBuilder.prototype ).then,
{
apply(target, thisArg, argumentsList) {
const operations = DB_OPERATIONS_TO_INSTRUMENT;
const typedThis = thisArg ;
const operation = extractOperation(typedThis.method, typedThis.headers);
if (!operations.includes(operation)) {
return Reflect.apply(target, thisArg, argumentsList);
}
if (!typedThis?.url?.pathname || typeof typedThis.url.pathname !== 'string') {
return Reflect.apply(target, thisArg, argumentsList);
}
const pathParts = typedThis.url.pathname.split('/');
const table = pathParts.length > 0 ? pathParts[pathParts.length - 1] : '';
const queryItems = [];
for (const [key, value] of typedThis.url.searchParams.entries()) {
// It's possible to have multiple entries for the same key, eg. `id=eq.7&id=eq.3`,
// so we need to use array instead of object to collect them.
queryItems.push(translateFiltersIntoMethods(key, value));
}
const body = Object.create(null);
if (is.isPlainObject(typedThis.body)) {
for (const [key, value] of Object.entries(typedThis.body)) {
body[key] = value;
}
}
// Adding operation to the beginning of the description if it's not a `select` operation
// For example, it can be an `insert` or `update` operation but the query can be `select(...)`
// For `select` operations, we don't need repeat it in the description
const description = `${operation === 'select' ? '' : `${operation}${body ? '(...) ' : ''}`}${queryItems.join(
' ',
)} from(${table})`;
const attributes = {
'db.table': table,
'db.schema': typedThis.schema,
'db.url': typedThis.url.origin,
'db.sdk': typedThis.headers['X-Client-Info'],
'db.system': 'postgresql',
'db.operation': operation,
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.supabase',
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',
};
if (queryItems.length) {
attributes['db.query'] = queryItems;
}
if (Object.keys(body).length) {
attributes['db.body'] = body;
}
return trace.startSpan(
{
name: description,
attributes,
},
span => {
return (Reflect.apply(target, thisArg, []) )
.then(
(res) => {
if (span) {
if (res && typeof res === 'object' && 'status' in res) {
spanstatus.setHttpStatus(span, res.status || 500);
}
span.end();
}
if (res.error) {
const err = new Error(res.error.message) ;
if (res.error.code) {
err.code = res.error.code;
}
if (res.error.details) {
err.details = res.error.details;
}
const supabaseContext = {};
if (queryItems.length) {
supabaseContext.query = queryItems;
}
if (Object.keys(body).length) {
supabaseContext.body = body;
}
_exports.captureException(err, scope => {
scope.addEventProcessor(e => {
misc.addExceptionMechanism(e, {
handled: false,
type: 'auto.db.supabase.postgres',
});
return e;
});
scope.setContext('supabase', supabaseContext);
return scope;
});
}
const breadcrumb = {
type: 'supabase',
category: `db.${operation}`,
message: description,
};
const data = {};
if (queryItems.length) {
data.query = queryItems;
}
if (Object.keys(body).length) {
data.body = body;
}
if (Object.keys(data).length) {
breadcrumb.data = data;
}
breadcrumbs.addBreadcrumb(breadcrumb);
return res;
},
(err) => {
// TODO: shouldn't we capture this error?
if (span) {
spanstatus.setHttpStatus(span, 500);
span.end();
}
throw err;
},
)
.then(...argumentsList);
},
);
},
},
);
markAsInstrumented((PostgRESTFilterBuilder.prototype ).then);
}
function instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder) {
// We need to wrap _all_ operations despite them sharing the same `PostgRESTFilterBuilder`
// constructor, as we don't know which method will be called first, and we don't want to miss any calls.
for (const operation of DB_OPERATIONS_TO_INSTRUMENT) {
if (isInstrumented((PostgRESTQueryBuilder.prototype )[operation])) {
continue;
}
(PostgRESTQueryBuilder.prototype )[operation ] = new Proxy(
(PostgRESTQueryBuilder.prototype )[operation ],
{
apply(target, thisArg, argumentsList) {
const rv = Reflect.apply(target, thisArg, argumentsList);
const PostgRESTFilterBuilder = (rv ).constructor;
debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Instrumenting ${operation} operation's PostgRESTFilterBuilder`);
instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder);
return rv;
},
},
);
markAsInstrumented((PostgRESTQueryBuilder.prototype )[operation]);
}
}
const instrumentSupabaseClient = (supabaseClient) => {
if (!supabaseClient) {
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('Supabase integration was not installed because no Supabase client was provided.');
return;
}
const SupabaseClientConstructor =
supabaseClient.constructor === Function ? supabaseClient : supabaseClient.constructor;
instrumentSupabaseClientConstructor(SupabaseClientConstructor);
instrumentSupabaseAuthClient(supabaseClient );
};
const INTEGRATION_NAME = 'Supabase';
const _supabaseIntegration = ((supabaseClient) => {
return {
setupOnce() {
instrumentSupabaseClient(supabaseClient);
},
name: INTEGRATION_NAME,
};
}) ;
const supabaseIntegration = integration.defineIntegration((options) => {
return _supabaseIntegration(options.supabaseClient);
}) ;
exports.DB_OPERATIONS_TO_INSTRUMENT = DB_OPERATIONS_TO_INSTRUMENT;
exports.FILTER_MAPPINGS = FILTER_MAPPINGS;
exports.extractOperation = extractOperation;
exports.instrumentSupabaseClient = instrumentSupabaseClient;
exports.supabaseIntegration = supabaseIntegration;
exports.translateFiltersIntoMethods = translateFiltersIntoMethods;
//# sourceMappingURL=supabase.js.map

View File

@@ -0,0 +1,131 @@
import { describe, it, expect } from 'vitest';
import { combineWhereConstraints } from './combineWhereConstraints.js';
describe('combineWhereConstraints', ()=>{
it('should merge matching constraint keys', async ()=>{
const constraint = {
test: {
equals: 'value'
}
};
// should merge and queries
const andConstraint = {
and: [
constraint
]
};
expect(combineWhereConstraints([
andConstraint
], 'and')).toEqual(andConstraint);
// should merge multiple and queries
expect(combineWhereConstraints([
andConstraint,
andConstraint
], 'and')).toEqual({
and: [
constraint,
constraint
]
});
// should merge or queries
const orConstraint = {
or: [
constraint
]
};
expect(combineWhereConstraints([
orConstraint
], 'or')).toEqual(orConstraint);
// should merge multiple or queries
expect(combineWhereConstraints([
orConstraint,
orConstraint
], 'or')).toEqual({
or: [
constraint,
constraint
]
});
});
it('should push mismatching constraints keys into `as` key', async ()=>{
const constraint = {
test: {
equals: 'value'
}
};
// should push `and` into `or` key
const andConstraint = {
and: [
constraint
]
};
expect(combineWhereConstraints([
andConstraint
], 'or')).toEqual({
or: [
andConstraint
]
});
// should push `or` into `and` key
const orConstraint = {
or: [
constraint
]
};
expect(combineWhereConstraints([
orConstraint
], 'and')).toEqual({
and: [
orConstraint
]
});
// should merge `and` but push `or` into `and` key
expect(combineWhereConstraints([
andConstraint,
orConstraint
], 'and')).toEqual({
and: [
constraint,
orConstraint
]
});
});
it('should push non and/or constraint key into `as` key', async ()=>{
const basicConstraint = {
test: {
equals: 'value'
}
};
expect(combineWhereConstraints([
basicConstraint
], 'and')).toEqual({
and: [
basicConstraint
]
});
expect(combineWhereConstraints([
basicConstraint
], 'or')).toEqual({
or: [
basicConstraint
]
});
});
it('should return an empty object when no constraints are provided', async ()=>{
expect(combineWhereConstraints([], 'and')).toEqual({});
expect(combineWhereConstraints([], 'or')).toEqual({});
});
it('should return an empty object when all constraints are empty', async ()=>{
expect(combineWhereConstraints([
{},
{},
undefined
], 'and')).toEqual({});
expect(combineWhereConstraints([
{},
{},
undefined
], 'or')).toEqual({});
});
});
//# sourceMappingURL=combineWhereConstraints.spec.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"unevaluatedProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedProperties.ts"],"names":[],"mappings":";;AAMA,mDAA6D;AAC7D,6CAA0D;AAC1D,+CAAmC;AAQnC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,sCAAsC;IAC/C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,yBAAyB,MAAM,CAAC,mBAAmB,GAAG;CAC9E,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAG;QACN,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9C,wBAAwB;QACxB,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC3D,MAAM,EAAC,SAAS,EAAE,KAAK,EAAC,GAAG,EAAE,CAAA;QAC7B,IAAI,KAAK,YAAY,cAAI,EAAE,CAAC;YAC1B,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,WAAW,EAAE,GAAG,EAAE,CAChC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAS,EAAE,EAAE,CACnC,GAAG,CAAC,EAAE,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CACvE,CACF,CAAA;QACH,CAAC;aAAM,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAC1B,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAS,EAAE,EAAE,CACnC,KAAK,KAAK,SAAS;gBACjB,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC;gBAC1B,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAC1E,CAAA;QACH,CAAC;QACD,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,QAAQ,eAAC,CAAC,MAAM,EAAE,CAAC,CAAA;QAEvC,SAAS,mBAAmB,CAAC,GAAS;YACpC,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;gBACrB,GAAG,CAAC,SAAS,CAAC,EAAC,mBAAmB,EAAE,GAAG,EAAC,CAAC,CAAA;gBACzC,GAAG,CAAC,KAAK,EAAE,CAAA;gBACX,IAAI,CAAC,SAAS;oBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;gBAC3B,OAAM;YACR,CAAC;YAED,IAAI,CAAC,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;gBACnC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;gBAC/B,GAAG,CAAC,SAAS,CACX;oBACE,OAAO,EAAE,uBAAuB;oBAChC,QAAQ,EAAE,GAAG;oBACb,YAAY,EAAE,WAAI,CAAC,GAAG;iBACvB,EACD,KAAK,CACN,CAAA;gBACD,IAAI,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YACvD,CAAC;QACH,CAAC;QAED,SAAS,kBAAkB,CAAC,cAAoB,EAAE,GAAS;YACzD,OAAO,IAAA,WAAC,EAAA,IAAI,cAAc,QAAQ,cAAc,IAAI,GAAG,GAAG,CAAA;QAC5D,CAAC;QAED,SAAS,iBAAiB,CAAC,cAAsC,EAAE,GAAS;YAC1E,MAAM,EAAE,GAAW,EAAE,CAAA;YACrB,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC;gBAC/B,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;oBAAE,EAAE,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;YAC7D,CAAC;YACD,OAAO,IAAA,aAAG,EAAC,GAAG,EAAE,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}

View File

@@ -0,0 +1,16 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/**
* Converts a string-based level into a `SeverityLevel`, normalizing it along the way.
*
* @param level String representation of desired `SeverityLevel`.
* @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.
*/
function severityLevelFromString(level) {
return (
level === 'warn' ? 'warning' : ['fatal', 'error', 'warning', 'log', 'info', 'debug'].includes(level) ? level : 'log'
) ;
}
exports.severityLevelFromString = severityLevelFromString;
//# sourceMappingURL=severity.js.map

View File

@@ -0,0 +1,43 @@
'use strict';
// lib/utils/bit-reader.ts
var BitReader = class {
constructor(input, endianness) {
this.input = input;
this.endianness = endianness;
// Skip the first 16 bits (2 bytes) of signature
this.byteOffset = 2;
this.bitOffset = 0;
}
/** Reads a specified number of bits, and move the offset */
getBits(length = 1) {
let result = 0;
let bitsRead = 0;
while (bitsRead < length) {
if (this.byteOffset >= this.input.length) {
throw new Error("Reached end of input");
}
const currentByte = this.input[this.byteOffset];
const bitsLeft = 8 - this.bitOffset;
const bitsToRead = Math.min(length - bitsRead, bitsLeft);
if (this.endianness === "little-endian") {
const mask = (1 << bitsToRead) - 1;
const bits = currentByte >> this.bitOffset & mask;
result |= bits << bitsRead;
} else {
const mask = (1 << bitsToRead) - 1 << 8 - this.bitOffset - bitsToRead;
const bits = (currentByte & mask) >> 8 - this.bitOffset - bitsToRead;
result = result << bitsToRead | bits;
}
bitsRead += bitsToRead;
this.bitOffset += bitsToRead;
if (this.bitOffset === 8) {
this.byteOffset++;
this.bitOffset = 0;
}
}
return result;
}
};
exports.BitReader = BitReader;

View File

@@ -0,0 +1,167 @@
'use strict'
const dns = require('dns')
const defaults = require('./defaults')
const parse = require('pg-connection-string').parse // parses a connection string
const val = function (key, config, envVar) {
if (envVar === undefined) {
envVar = process.env['PG' + key.toUpperCase()]
} else if (envVar === false) {
// do nothing ... use false
} else {
envVar = process.env[envVar]
}
return config[key] || envVar || defaults[key]
}
const readSSLConfigFromEnvironment = function () {
switch (process.env.PGSSLMODE) {
case 'disable':
return false
case 'prefer':
case 'require':
case 'verify-ca':
case 'verify-full':
return true
case 'no-verify':
return { rejectUnauthorized: false }
}
return defaults.ssl
}
// Convert arg to a string, surround in single quotes, and escape single quotes and backslashes
const quoteParamValue = function (value) {
return "'" + ('' + value).replace(/\\/g, '\\\\').replace(/'/g, "\\'") + "'"
}
const add = function (params, config, paramName) {
const value = config[paramName]
if (value !== undefined && value !== null) {
params.push(paramName + '=' + quoteParamValue(value))
}
}
class ConnectionParameters {
constructor(config) {
// if a string is passed, it is a raw connection string so we parse it into a config
config = typeof config === 'string' ? parse(config) : config || {}
// if the config has a connectionString defined, parse IT into the config we use
// this will override other default values with what is stored in connectionString
if (config.connectionString) {
config = Object.assign({}, config, parse(config.connectionString))
}
this.user = val('user', config)
this.database = val('database', config)
if (this.database === undefined) {
this.database = this.user
}
this.port = parseInt(val('port', config), 10)
this.host = val('host', config)
// "hiding" the password so it doesn't show up in stack traces
// or if the client is console.logged
Object.defineProperty(this, 'password', {
configurable: true,
enumerable: false,
writable: true,
value: val('password', config),
})
this.binary = val('binary', config)
this.options = val('options', config)
this.ssl = typeof config.ssl === 'undefined' ? readSSLConfigFromEnvironment() : config.ssl
if (typeof this.ssl === 'string') {
if (this.ssl === 'true') {
this.ssl = true
}
}
// support passing in ssl=no-verify via connection string
if (this.ssl === 'no-verify') {
this.ssl = { rejectUnauthorized: false }
}
if (this.ssl && this.ssl.key) {
Object.defineProperty(this.ssl, 'key', {
enumerable: false,
})
}
this.client_encoding = val('client_encoding', config)
this.replication = val('replication', config)
// a domain socket begins with '/'
this.isDomainSocket = !(this.host || '').indexOf('/')
this.application_name = val('application_name', config, 'PGAPPNAME')
this.fallback_application_name = val('fallback_application_name', config, false)
this.statement_timeout = val('statement_timeout', config, false)
this.lock_timeout = val('lock_timeout', config, false)
this.idle_in_transaction_session_timeout = val('idle_in_transaction_session_timeout', config, false)
this.query_timeout = val('query_timeout', config, false)
if (config.connectionTimeoutMillis === undefined) {
this.connect_timeout = process.env.PGCONNECT_TIMEOUT || 0
} else {
this.connect_timeout = Math.floor(config.connectionTimeoutMillis / 1000)
}
if (config.keepAlive === false) {
this.keepalives = 0
} else if (config.keepAlive === true) {
this.keepalives = 1
}
if (typeof config.keepAliveInitialDelayMillis === 'number') {
this.keepalives_idle = Math.floor(config.keepAliveInitialDelayMillis / 1000)
}
}
getLibpqConnectionString(cb) {
const params = []
add(params, this, 'user')
add(params, this, 'password')
add(params, this, 'port')
add(params, this, 'application_name')
add(params, this, 'fallback_application_name')
add(params, this, 'connect_timeout')
add(params, this, 'options')
const ssl = typeof this.ssl === 'object' ? this.ssl : this.ssl ? { sslmode: this.ssl } : {}
add(params, ssl, 'sslmode')
add(params, ssl, 'sslca')
add(params, ssl, 'sslkey')
add(params, ssl, 'sslcert')
add(params, ssl, 'sslrootcert')
if (this.database) {
params.push('dbname=' + quoteParamValue(this.database))
}
if (this.replication) {
params.push('replication=' + quoteParamValue(this.replication))
}
if (this.host) {
params.push('host=' + quoteParamValue(this.host))
}
if (this.isDomainSocket) {
return cb(null, params.join(' '))
}
if (this.client_encoding) {
params.push('client_encoding=' + quoteParamValue(this.client_encoding))
}
dns.lookup(this.host, function (err, address) {
if (err) return cb(err, null)
params.push('hostaddr=' + quoteParamValue(address))
return cb(null, params.join(' '))
})
}
}
module.exports = ConnectionParameters

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLHexColorCode = exports.GraphQLHexColorCodeConfig = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const HEX_COLOR_CODE = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (!HEX_COLOR_CODE.test(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid HexColorCode: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
const specifiedByURL = 'https://en.wikipedia.org/wiki/Web_colors';
exports.GraphQLHexColorCodeConfig = {
name: `HexColorCode`,
description: `A field whose value is a hex color code: https://en.wikipedia.org/wiki/Web_colors.`,
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 hex color codes but got a: ${ast.kind}`, { nodes: ast });
}
return validate(ast.value, ast);
},
specifiedByURL,
specifiedByUrl: specifiedByURL,
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'HexColorCode',
type: 'string',
pattern: HEX_COLOR_CODE.source,
},
},
};
exports.GraphQLHexColorCode = new graphql_1.GraphQLScalarType(exports.GraphQLHexColorCodeConfig);

View File

@@ -0,0 +1 @@
{"version":3,"file":"hand-helping.js","sources":["../../../src/icons/hand-helping.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HandHelping\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMTJoMmEyIDIgMCAxIDAgMC00aC0zYy0uNiAwLTEuMS4yLTEuNC42TDMgMTQiIC8+CiAgPHBhdGggZD0ibTcgMTggMS42LTEuNGMuMy0uNC44LS42IDEuNC0uNmg0YzEuMSAwIDIuMS0uNCAyLjgtMS4ybDQuNi00LjRhMiAyIDAgMCAwLTIuNzUtMi45MWwtNC4yIDMuOSIgLz4KICA8cGF0aCBkPSJtMiAxMyA2IDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/hand-helping\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 HandHelping = createLucideIcon('HandHelping', [\n ['path', { d: 'M11 12h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 14', key: '1j4xps' }],\n [\n 'path',\n {\n d: 'm7 18 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9',\n key: 'uospg8',\n },\n ],\n ['path', { d: 'm2 13 6 6', key: '16e5sb' }],\n]);\n\nexport default HandHelping;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACjF,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,11 @@
import React from 'react';
import { Modifiers } from '../../modifiers';
import type { PositionedOverlayProps } from './components';
import type { DropAnimation } from './hooks';
export interface Props extends Pick<PositionedOverlayProps, 'adjustScale' | 'children' | 'className' | 'style' | 'transition'> {
dropAnimation?: DropAnimation | null | undefined;
modifiers?: Modifiers;
wrapperElement?: keyof JSX.IntrinsicElements;
zIndex?: number;
}
export declare const DragOverlay: React.MemoExoticComponent<({ adjustScale, children, dropAnimation: dropAnimationConfig, style, transition, modifiers, wrapperElement, className, zIndex, }: Props) => JSX.Element>;

View File

@@ -0,0 +1,32 @@
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { HtmlDiff } from './diff/index.js';
import './index.scss';
const baseClass = 'html-diff';
export const getHTMLDiffComponents = ({
fromHTML,
toHTML,
tokenizeByCharacter
}) => {
const diffHTML = new HtmlDiff(fromHTML, toHTML, {
tokenizeByCharacter
});
const [oldHTML, newHTML] = diffHTML.getSideBySideContents();
const From = oldHTML ? /*#__PURE__*/_jsx("div", {
className: `${baseClass}__diff-old html-diff`,
dangerouslySetInnerHTML: {
__html: oldHTML
}
}) : null;
const To = newHTML ? /*#__PURE__*/_jsx("div", {
className: `${baseClass}__diff-new html-diff`,
dangerouslySetInnerHTML: {
__html: newHTML
}
}) : null;
return {
From,
To
};
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,31 @@
import { scale, alpha } from '../../../value/types/numbers/index.mjs';
import { degrees, px, progressPercentage } from '../../../value/types/numbers/units.mjs';
const transformValueTypes = {
rotate: degrees,
rotateX: degrees,
rotateY: degrees,
rotateZ: degrees,
scale,
scaleX: scale,
scaleY: scale,
scaleZ: scale,
skew: degrees,
skewX: degrees,
skewY: degrees,
distance: px,
translateX: px,
translateY: px,
translateZ: px,
x: px,
y: px,
z: px,
perspective: px,
transformPerspective: px,
opacity: alpha,
originX: progressPercentage,
originY: progressPercentage,
originZ: px,
};
export { transformValueTypes };

View File

@@ -0,0 +1,37 @@
var isInteger = require('./isInteger');
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
* double precision number which isn't the result of a rounded unsafe integer.
*
* **Note:** This method is based on
* [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
* @example
*
* _.isSafeInteger(3);
* // => true
*
* _.isSafeInteger(Number.MIN_VALUE);
* // => false
*
* _.isSafeInteger(Infinity);
* // => false
*
* _.isSafeInteger('3');
* // => false
*/
function isSafeInteger(value) {
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
}
module.exports = isSafeInteger;

View File

@@ -0,0 +1,31 @@
<p align="center">
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
</a>
</p>
# Sentry Bundler Plugin Core
Core package containing the bundler-agnostic functionality used by the bundler plugins.
Check out the individual packages for more information and examples:
- [Rollup](https://www.npmjs.com/package/@sentry/rollup-plugin)
- [Vite](https://www.npmjs.com/package/@sentry/vite-plugin)
- [esbuild](https://www.npmjs.com/package/@sentry/esbuild-plugin)
- [Webpack](https://www.npmjs.com/package/@sentry/webpack-plugin)
### Features
The Sentry bundler plugin core package contains the following functionality:
- Sourcemap upload
- Release creation in Sentry
- Automatic release name discovery (based on CI environment - Vercel, AWS, Heroku, CircleCI, or current Git SHA)
- Automatically associate errors with releases (Release injection)
### More information
- [Sentry Documentation](https://docs.sentry.io/quickstart/)
- [Sentry Discord](https://discord.gg/Ww9hbqr)
- [Sentry Stackoverflow](http://stackoverflow.com/questions/tagged/sentry)

View File

@@ -0,0 +1,90 @@
import { LANGGRAPH_INTEGRATION_NAME, defineIntegration } from '@sentry/core';
import { generateInstrumentOnce } from '@sentry/node-core';
import { SentryLangGraphInstrumentation } from './instrumentation.js';
const instrumentLangGraph = generateInstrumentOnce(
LANGGRAPH_INTEGRATION_NAME,
options => new SentryLangGraphInstrumentation(options),
);
const _langGraphIntegration = ((options = {}) => {
return {
name: LANGGRAPH_INTEGRATION_NAME,
setupOnce() {
instrumentLangGraph(options);
},
};
}) ;
/**
* Adds Sentry tracing instrumentation for LangGraph.
*
* This integration is enabled by default.
*
* When configured, this integration automatically instruments LangGraph StateGraph and compiled graph instances
* to capture telemetry data following OpenTelemetry Semantic Conventions for Generative AI.
*
* @example
* ```javascript
* import * as Sentry from '@sentry/node';
*
* Sentry.init({
* integrations: [Sentry.langGraphIntegration()],
* });
* ```
*
* ## Options
*
* - `recordInputs`: Whether to record input messages (default: respects `sendDefaultPii` client option)
* - `recordOutputs`: Whether to record response text (default: respects `sendDefaultPii` client option)
*
* ### Default Behavior
*
* By default, the integration will:
* - Record inputs and outputs ONLY if `sendDefaultPii` is set to `true` in your Sentry client options
* - Otherwise, inputs and outputs are NOT recorded unless explicitly enabled
*
* @example
* ```javascript
* // Record inputs and outputs when sendDefaultPii is false
* Sentry.init({
* integrations: [
* Sentry.langGraphIntegration({
* recordInputs: true,
* recordOutputs: true
* })
* ],
* });
*
* // Never record inputs/outputs regardless of sendDefaultPii
* Sentry.init({
* sendDefaultPii: true,
* integrations: [
* Sentry.langGraphIntegration({
* recordInputs: false,
* recordOutputs: false
* })
* ],
* });
* ```
*
* ## Captured Operations
*
* The integration captures the following LangGraph operations:
* - **Agent Creation** (`StateGraph.compile()`) - Creates a `gen_ai.create_agent` span
* - **Agent Invocation** (`CompiledGraph.invoke()`) - Creates a `gen_ai.invoke_agent` span
*
* ## Captured Data
*
* When `recordInputs` and `recordOutputs` are enabled, the integration captures:
* - Input messages from the graph state
* - Output messages and LLM responses
* - Tool calls made during agent execution
* - Agent and graph names
* - Available tools configured in the graph
*
*/
const langGraphIntegration = defineIntegration(_langGraphIntegration);
export { instrumentLangGraph, langGraphIntegration };
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,3 @@
import type { Vocabulary } from "../types";
declare const next: Vocabulary;
export default next;

View File

@@ -0,0 +1,270 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const dc = require('node:diagnostics_channel');
const core = require('@sentry/core');
const nodeCore = require('@sentry/node-core');
const debugBuild = require('../../../debug-build.js');
const index = require('./fastify-otel/index.js');
const instrumentation = require('./v3/instrumentation.js');
/**
* Options for the Fastify integration.
*
* `shouldHandleError` - Callback method deciding whether error should be captured and sent to Sentry
* This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.
* Fastify v3 and v4 use `setupFastifyErrorHandler` instead.
*
* @example
*
* ```javascript
* Sentry.init({
* integrations: [
* Sentry.fastifyIntegration({
* shouldHandleError(_error, _request, reply) {
* return reply.statusCode >= 500;
* },
* });
* },
* });
* ```
*
*/
const INTEGRATION_NAME = 'Fastify';
const instrumentFastifyV3 = nodeCore.generateInstrumentOnce(
`${INTEGRATION_NAME}.v3`,
() => new instrumentation.FastifyInstrumentationV3(),
);
function getFastifyIntegration() {
const client = core.getClient();
if (!client) {
return undefined;
} else {
return client.getIntegrationByName(INTEGRATION_NAME);
}
}
function handleFastifyError(
error,
request,
reply,
handlerOrigin,
) {
const shouldHandleError = getFastifyIntegration()?.getShouldHandleError() || defaultShouldHandleError;
// Diagnostics channel runs before the onError hook, so we can use it to check if the handler was already registered
if (handlerOrigin === 'diagnostics-channel') {
this.diagnosticsChannelExists = true;
}
if (this.diagnosticsChannelExists && handlerOrigin === 'onError-hook') {
debugBuild.DEBUG_BUILD &&
core.debug.warn(
'Fastify error handler was already registered via diagnostics channel.',
'You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.',
);
// If the diagnostics channel already exists, we don't need to handle the error again
return;
}
if (shouldHandleError(error, request, reply)) {
core.captureException(error, { mechanism: { handled: false, type: 'auto.function.fastify' } });
}
}
const instrumentFastify = nodeCore.generateInstrumentOnce(`${INTEGRATION_NAME}.v5`, () => {
const fastifyOtelInstrumentationInstance = new index.FastifyOtelInstrumentation();
const plugin = fastifyOtelInstrumentationInstance.plugin();
// This message handler works for Fastify versions 3, 4 and 5
dc.subscribe('fastify.initialization', message => {
const fastifyInstance = (message ).fastify;
fastifyInstance?.register(plugin).after(err => {
if (err) {
debugBuild.DEBUG_BUILD && core.debug.error('Failed to setup Fastify instrumentation', err);
} else {
instrumentClient();
if (fastifyInstance) {
instrumentOnRequest(fastifyInstance);
}
}
});
});
// This diagnostics channel only works on Fastify version 5
// For versions 3 and 4, we use `setupFastifyErrorHandler` instead
dc.subscribe('tracing:fastify.request.handler:error', message => {
const { error, request, reply } = message
;
handleFastifyError.call(handleFastifyError, error, request, reply, 'diagnostics-channel');
});
// Returning this as unknown not to deal with the internal types of the FastifyOtelInstrumentation
return fastifyOtelInstrumentationInstance ;
});
const _fastifyIntegration = (({ shouldHandleError }) => {
let _shouldHandleError;
return {
name: INTEGRATION_NAME,
setupOnce() {
_shouldHandleError = shouldHandleError || defaultShouldHandleError;
instrumentFastifyV3();
instrumentFastify();
},
getShouldHandleError() {
return _shouldHandleError;
},
setShouldHandleError(fn) {
_shouldHandleError = fn;
},
};
}) ;
/**
* Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).
*
* If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.
*
* For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.fastifyIntegration()],
* })
* ```
*/
const fastifyIntegration = core.defineIntegration((options = {}) =>
_fastifyIntegration(options),
);
/**
* Default function to determine if an error should be sent to Sentry
*
* 3xx and 4xx errors are not sent by default.
*/
function defaultShouldHandleError(_error, _request, reply) {
const statusCode = reply.statusCode;
// 3xx and 4xx errors are not sent by default.
return statusCode >= 500 || statusCode <= 299;
}
/**
* Add an Fastify error handler to capture errors to Sentry.
*
* @param fastify The Fastify instance to which to add the error handler
* @param options Configuration options for the handler
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
* const Fastify = require("fastify");
*
* const app = Fastify();
*
* Sentry.setupFastifyErrorHandler(app);
*
* // Add your routes, etc.
*
* app.listen({ port: 3000 });
* ```
*/
function setupFastifyErrorHandler(fastify, options) {
if (options?.shouldHandleError) {
getFastifyIntegration()?.setShouldHandleError(options.shouldHandleError);
}
const plugin = Object.assign(
function (fastify, _options, done) {
fastify.addHook('onError', async (request, reply, error) => {
handleFastifyError.call(handleFastifyError, error, request, reply, 'onError-hook');
});
done();
},
{
[Symbol.for('skip-override')]: true,
[Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler',
},
);
fastify.register(plugin);
}
function addFastifySpanAttributes(span) {
const spanJSON = core.spanToJSON(span);
const spanName = spanJSON.description;
const attributes = spanJSON.data;
const type = attributes['fastify.type'];
const isHook = type === 'hook';
const isHandler = type === spanName?.startsWith('handler -');
// In @fastify/otel `request-handler` is separated by dash, not underscore
const isRequestHandler = spanName === 'request' || type === 'request-handler';
// If this is already set, or we have no fastify span, no need to process again...
if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || (!isHandler && !isRequestHandler && !isHook)) {
return;
}
const opPrefix = isHook ? 'hook' : isHandler ? 'middleware' : isRequestHandler ? 'request_handler' : '<unknown>';
span.setAttributes({
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${opPrefix}.fastify`,
});
const attrName = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];
if (typeof attrName === 'string') {
// Try removing `fastify -> ` and `@fastify/otel -> ` prefixes
// This is a bit of a hack, and not always working for all spans
// But it's the best we can do without a proper API
const updatedName = attrName.replace(/^fastify -> /, '').replace(/^@fastify\/otel -> /, '');
span.updateName(updatedName);
}
}
function instrumentClient() {
const client = core.getClient();
if (client) {
client.on('spanStart', (span) => {
addFastifySpanAttributes(span);
});
}
}
function instrumentOnRequest(fastify) {
fastify.addHook('onRequest', async (request, _reply) => {
if (request.opentelemetry) {
const { span } = request.opentelemetry();
if (span) {
addFastifySpanAttributes(span);
}
}
const routeName = request.routeOptions?.url;
const method = request.method || 'GET';
core.getIsolationScope().setTransactionName(`${method} ${routeName}`);
});
}
exports.fastifyIntegration = fastifyIntegration;
exports.instrumentFastify = instrumentFastify;
exports.instrumentFastifyV3 = instrumentFastifyV3;
exports.setupFastifyErrorHandler = setupFastifyErrorHandler;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"setActiveSpan.js","sources":["../../../../../src/tracing/setActiveSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core';\nimport { _INTERNAL_setSpanForScope, getActiveSpan, getCurrentScope } from '@sentry/core';\n\n/**\n * Sets an inactive span active on the current scope.\n *\n * This is useful in browser applications, if you want to create a span that cannot be finished\n * within its callback. Any spans started while the given span is active, will be children of the span.\n *\n * If there already was an active span on the scope prior to calling this function, it is replaced\n * with the given span and restored after the span ended. Otherwise, the span will simply be\n * removed, resulting in no active span on the scope.\n *\n * IMPORTANT: This function can ONLY be used in the browser! Calling this function in a server\n * environment (for example in a server-side rendered component) will result in undefined behaviour\n * and is not supported.\n * You MUST call `span.end()` manually, otherwise the span will never be finished.\n *\n * @example\n * ```js\n * let checkoutSpan;\n *\n * on('checkoutStarted', () => {\n * checkoutSpan = Sentry.startInactiveSpan({ name: 'checkout-flow' });\n * Sentry.setActiveSpanInBrowser(checkoutSpan);\n * })\n *\n * // during this time, any spans started will be children of `checkoutSpan`:\n * Sentry.startSpan({ name: 'checkout-step-1' }, () => {\n * // ... `\n * })\n *\n * on('checkoutCompleted', () => {\n * checkoutSpan?.end();\n * })\n * ```\n *\n * @param span - the span to set active\n */\nexport function setActiveSpanInBrowser(span: Span): void {\n const maybePreviousActiveSpan = getActiveSpan();\n\n // If the span is already active, there's no need to double-patch or set it again.\n // This also guards against users (for whatever reason) calling setActiveSpanInBrowser on SDK-started\n // idle spans like pageload or navigation spans. These will already be handled correctly by the SDK.\n // For nested situations, we have to double-patch to ensure we restore the correct previous span (see tests)\n if (maybePreviousActiveSpan === span) {\n return;\n }\n\n const scope = getCurrentScope();\n\n // Putting a small patch onto the span.end method to ensure we\n // remove the span from the scope when it ends.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n span.end = new Proxy(span.end, {\n apply(target, thisArg, args: Parameters<Span['end']>) {\n _INTERNAL_setSpanForScope(scope, maybePreviousActiveSpan);\n return Reflect.apply(target, thisArg, args);\n },\n });\n\n _INTERNAL_setSpanForScope(scope, span);\n}\n"],"names":["getActiveSpan","getCurrentScope","_INTERNAL_setSpanForScope"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,IAAI,EAAc;AACzD,EAAE,MAAM,uBAAA,GAA0BA,kBAAa,EAAE;;AAEjD;AACA;AACA;AACA;AACA,EAAE,IAAI,uBAAA,KAA4B,IAAI,EAAE;AACxC,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,KAAA,GAAQC,oBAAe,EAAE;;AAEjC;AACA;AACA;AACA,EAAE,IAAI,CAAC,GAAA,GAAM,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;AACjC,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAA2B;AAC1D,MAAMC,8BAAyB,CAAC,KAAK,EAAE,uBAAuB,CAAC;AAC/D,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AACjD,IAAI,CAAC;AACL,GAAG,CAAC;;AAEJ,EAAEA,8BAAyB,CAAC,KAAK,EAAE,IAAI,CAAC;AACxC;;;;"}

View File

@@ -0,0 +1,152 @@
/*
Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
"use strict";
/* eslint-disable no-undefined */
const Syntax = require("estraverse").Syntax;
const esrecurse = require("esrecurse");
/**
* Get last array element
* @param {array} xs - array
* @returns {any} Last elment
*/
function getLast(xs) {
return xs[xs.length - 1] || null;
}
class PatternVisitor extends esrecurse.Visitor {
static isPattern(node) {
const nodeType = node.type;
return (
nodeType === Syntax.Identifier ||
nodeType === Syntax.ObjectPattern ||
nodeType === Syntax.ArrayPattern ||
nodeType === Syntax.SpreadElement ||
nodeType === Syntax.RestElement ||
nodeType === Syntax.AssignmentPattern
);
}
constructor(options, rootPattern, callback) {
super(null, options);
this.rootPattern = rootPattern;
this.callback = callback;
this.assignments = [];
this.rightHandNodes = [];
this.restElements = [];
}
Identifier(pattern) {
const lastRestElement = getLast(this.restElements);
this.callback(pattern, {
topLevel: pattern === this.rootPattern,
rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern,
assignments: this.assignments
});
}
Property(property) {
// Computed property's key is a right hand node.
if (property.computed) {
this.rightHandNodes.push(property.key);
}
// If it's shorthand, its key is same as its value.
// If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
// If it's not shorthand, the name of new variable is its value's.
this.visit(property.value);
}
ArrayPattern(pattern) {
for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
const element = pattern.elements[i];
this.visit(element);
}
}
AssignmentPattern(pattern) {
this.assignments.push(pattern);
this.visit(pattern.left);
this.rightHandNodes.push(pattern.right);
this.assignments.pop();
}
RestElement(pattern) {
this.restElements.push(pattern);
this.visit(pattern.argument);
this.restElements.pop();
}
MemberExpression(node) {
// Computed property's key is a right hand node.
if (node.computed) {
this.rightHandNodes.push(node.property);
}
// the object is only read, write to its property.
this.rightHandNodes.push(node.object);
}
//
// ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
// By spec, LeftHandSideExpression is Pattern or MemberExpression.
// (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
// But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
//
SpreadElement(node) {
this.visit(node.argument);
}
ArrayExpression(node) {
node.elements.forEach(this.visit, this);
}
AssignmentExpression(node) {
this.assignments.push(node);
this.visit(node.left);
this.rightHandNodes.push(node.right);
this.assignments.pop();
}
CallExpression(node) {
// arguments are right hand nodes.
node.arguments.forEach(a => {
this.rightHandNodes.push(a);
});
this.visit(node.callee);
}
}
module.exports = PatternVisitor;
/* vim: set sw=4 ts=4 et tw=80 : */

View File

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

View File

@@ -0,0 +1,5 @@
/**
* @hidden
*/
export declare function logAndExitProcess(error: unknown): void;
//# sourceMappingURL=errorhandling.d.ts.map

View File

@@ -0,0 +1,5 @@
/**
* Feedback Icon
*/
export declare function FeedbackIcon(): SVGElement;
//# sourceMappingURL=FeedbackIcon.d.ts.map

View File

@@ -0,0 +1,517 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { formatAdminURL, isImage } from 'payload/shared';
import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react';
import { toast } from 'sonner';
import { FieldError } from '../../fields/FieldError/index.js';
import { fieldBaseClass } from '../../fields/shared/index.js';
import { useForm, useFormProcessing } from '../../forms/Form/index.js';
import { useField } from '../../forms/useField/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { EditDepthProvider } from '../../providers/EditDepth/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { UploadControlsProvider, useUploadControls } from '../../providers/UploadControls/index.js';
import { useUploadEdits } from '../../providers/UploadEdits/index.js';
import { Button } from '../Button/index.js';
import { Drawer } from '../Drawer/index.js';
import { Dropzone } from '../Dropzone/index.js';
import { EditUpload } from '../EditUpload/index.js';
import './index.scss';
import { FileDetails } from '../FileDetails/index.js';
import { PreviewSizes } from '../PreviewSizes/index.js';
import { Thumbnail } from '../Thumbnail/index.js';
const baseClass = 'file-field';
export const editDrawerSlug = 'edit-upload';
export const sizePreviewSlug = 'preview-sizes';
const validate = value => {
if (!value && value !== undefined) {
return 'A file is required.';
}
if (value && (!value.name || value.name === '')) {
return 'A file name is required.';
}
return true;
};
export const UploadActions = t0 => {
const $ = _c(8);
const {
customActions,
enableAdjustments,
enablePreviewSizes,
mimeType
} = t0;
const {
t
} = useTranslation();
const {
openModal
} = useModal();
let t1;
let t2;
if ($[0] !== customActions || $[1] !== enableAdjustments || $[2] !== enablePreviewSizes || $[3] !== mimeType || $[4] !== openModal || $[5] !== t) {
t2 = Symbol.for("react.early_return_sentinel");
bb0: {
const fileTypeIsAdjustable = isImage(mimeType) && mimeType !== "image/svg+xml" && mimeType !== "image/jxl";
if (!fileTypeIsAdjustable && (!customActions || customActions.length === 0)) {
t2 = null;
break bb0;
}
t1 = _jsxs("div", {
className: `${baseClass}__upload-actions`,
children: [fileTypeIsAdjustable && _jsxs(React.Fragment, {
children: [enablePreviewSizes && _jsx(Button, {
buttonStyle: "pill",
className: `${baseClass}__previewSizes`,
margin: false,
onClick: () => {
openModal(sizePreviewSlug);
},
size: "small",
children: t("upload:previewSizes")
}), enableAdjustments && _jsx(Button, {
buttonStyle: "pill",
className: `${baseClass}__edit`,
margin: false,
onClick: () => {
openModal(editDrawerSlug);
},
size: "small",
children: t("upload:editImage")
})]
}), customActions && customActions.map(_temp)]
});
}
$[0] = customActions;
$[1] = enableAdjustments;
$[2] = enablePreviewSizes;
$[3] = mimeType;
$[4] = openModal;
$[5] = t;
$[6] = t1;
$[7] = t2;
} else {
t1 = $[6];
t2 = $[7];
}
if (t2 !== Symbol.for("react.early_return_sentinel")) {
return t2;
}
return t1;
};
export const Upload = props => {
const $ = _c(5);
const {
resetUploadEdits,
updateUploadEdits,
uploadEdits
} = useUploadEdits();
let t0;
if ($[0] !== props || $[1] !== resetUploadEdits || $[2] !== updateUploadEdits || $[3] !== uploadEdits) {
t0 = _jsx(UploadControlsProvider, {
children: _jsx(Upload_v4, {
...props,
resetUploadEdits,
updateUploadEdits,
uploadEdits
})
});
$[0] = props;
$[1] = resetUploadEdits;
$[2] = updateUploadEdits;
$[3] = uploadEdits;
$[4] = t0;
} else {
t0 = $[4];
}
return t0;
};
export const Upload_v4 = props => {
const {
collectionSlug,
customActions,
initialState,
onChange,
resetUploadEdits,
updateUploadEdits,
uploadConfig,
UploadControls,
uploadEdits
} = props;
const {
setUploadControlFile,
setUploadControlFileName,
setUploadControlFileUrl,
uploadControlFile,
uploadControlFileName,
uploadControlFileUrl
} = useUploadControls();
const {
config: {
routes: {
api
}
}
} = useConfig();
const {
t
} = useTranslation();
const {
setModified
} = useForm();
const {
id,
data,
docPermissions,
setUploadStatus
} = useDocumentInfo();
const isFormSubmitting = useFormProcessing();
const {
errorMessage,
setValue,
showError,
value
} = useField({
path: 'file',
validate
});
const [fileSrc, setFileSrc] = useState(null);
const [removedFile, setRemovedFile] = useState(false);
const [filename, setFilename] = useState(value?.name || '');
const [showUrlInput, setShowUrlInput] = useState(false);
const [fileUrl, setFileUrl] = useState('');
const urlInputRef = useRef(null);
const inputRef = useRef(null);
const useServerSideFetch = typeof uploadConfig?.pasteURL === 'object' && uploadConfig.pasteURL.allowList?.length > 0;
const handleFileChange = useCallback(({
file,
isNewFile = true
}) => {
if (isNewFile && file instanceof File) {
setFileSrc(URL.createObjectURL(file));
}
setValue(file);
setShowUrlInput(false);
setUploadControlFileUrl('');
setUploadControlFileName(null);
setUploadControlFile(null);
if (typeof onChange === 'function') {
onChange(file);
}
}, [onChange, setValue, setUploadControlFile, setUploadControlFileName, setUploadControlFileUrl]);
const renameFile = (fileToChange, newName) => {
// Creating a new File object with updated properties
const newFile = new File([fileToChange], newName, {
type: fileToChange.type,
lastModified: fileToChange.lastModified
});
return newFile;
};
const handleFileNameChange = React.useCallback(e => {
const updatedFileName = e.target.value;
if (value) {
handleFileChange({
file: renameFile(value, updatedFileName),
isNewFile: false
});
setFilename(updatedFileName);
}
}, [handleFileChange, value]);
const handleFileSelection = useCallback(files => {
const fileToUpload = files?.[0];
handleFileChange({
file: fileToUpload
});
}, [handleFileChange]);
const handleFileRemoval = useCallback(() => {
setRemovedFile(true);
handleFileChange({
file: null
});
setFileSrc('');
setFileUrl('');
resetUploadEdits();
setShowUrlInput(false);
setUploadControlFileUrl('');
setUploadControlFileName(null);
setUploadControlFile(null);
}, [handleFileChange, resetUploadEdits, setUploadControlFile, setUploadControlFileName, setUploadControlFileUrl]);
const onEditsSave = useCallback(args => {
setModified(true);
updateUploadEdits(args);
}, [setModified, updateUploadEdits]);
const handleUrlSubmit = useCallback(async () => {
if (!fileUrl || uploadConfig?.pasteURL === false) {
return;
}
setUploadStatus('uploading');
try {
// Attempt client-side fetch
const clientResponse = await fetch(fileUrl);
if (!clientResponse.ok) {
throw new Error(`Fetch failed with status: ${clientResponse.status}`);
}
const blob = await clientResponse.blob();
const fileName = uploadControlFileName || decodeURIComponent(fileUrl.split('/').pop() || '');
const file_0 = new File([blob], fileName, {
type: blob.type
});
handleFileChange({
file: file_0
});
setUploadStatus('idle');
return; // Exit if client-side fetch succeeds
} catch (_clientError) {
if (!useServerSideFetch) {
// If server-side fetch is not enabled, show client-side error
toast.error('Failed to fetch the file.');
setUploadStatus('failed');
return;
}
}
// Attempt server-side fetch if client-side fetch fails and useServerSideFetch is true
try {
const pasteURL = `/${collectionSlug}/paste-url${id ? `/${id}?` : '?'}src=${encodeURIComponent(fileUrl)}`;
const serverResponse = await fetch(formatAdminURL({
apiRoute: api,
path: pasteURL
}));
if (!serverResponse.ok) {
throw new Error(`Fetch failed with status: ${serverResponse.status}`);
}
const blob_0 = await serverResponse.blob();
const fileName_0 = decodeURIComponent(fileUrl.split('/').pop() || '');
const file_1 = new File([blob_0], fileName_0, {
type: blob_0.type
});
handleFileChange({
file: file_1
});
setUploadStatus('idle');
} catch (_serverError) {
toast.error('The provided URL is not allowed.');
setUploadStatus('failed');
}
}, [api, collectionSlug, fileUrl, handleFileChange, id, setUploadStatus, uploadConfig, uploadControlFileName, useServerSideFetch]);
useEffect(() => {
if (initialState?.file?.value instanceof File) {
setFileSrc(URL.createObjectURL(initialState.file.value));
setRemovedFile(false);
}
}, [initialState]);
useEffect(() => {
if (showUrlInput && urlInputRef.current) {
// urlInputRef.current.focus() // Focus on the remote-url input field when showUrlInput is true
}
}, [showUrlInput]);
useEffect(() => {
if (isFormSubmitting) {
setRemovedFile(false);
}
}, [isFormSubmitting]);
const canRemoveUpload = docPermissions?.update;
const hasImageSizes = uploadConfig?.imageSizes?.length > 0;
const hasResizeOptions = Boolean(uploadConfig?.resizeOptions);
// Explicity check if set to true, default is undefined
const focalPointEnabled = uploadConfig?.focalPoint === true;
const {
crop: showCrop = true,
focalPoint = true
} = uploadConfig;
const showFocalPoint = focalPoint && (hasImageSizes || hasResizeOptions || focalPointEnabled);
const acceptMimeTypes = uploadConfig.mimeTypes?.join(', ');
const imageCacheTag = uploadConfig?.cacheTags && data?.updatedAt;
useEffect(() => {
const handleControlFileUrl = async () => {
if (uploadControlFileUrl) {
setFileUrl(uploadControlFileUrl);
await handleUrlSubmit();
}
};
void handleControlFileUrl();
}, [uploadControlFileUrl, handleUrlSubmit]);
useEffect(() => {
const handleControlFile = () => {
if (uploadControlFile) {
handleFileChange({
file: uploadControlFile
});
}
};
void handleControlFile();
}, [uploadControlFile, handleFileChange]);
return /*#__PURE__*/_jsxs("div", {
className: [fieldBaseClass, baseClass].filter(Boolean).join(' '),
children: [/*#__PURE__*/_jsx(FieldError, {
message: errorMessage,
showError: showError
}), data && data.filename && !removedFile && /*#__PURE__*/_jsx(FileDetails, {
collectionSlug: collectionSlug,
customUploadActions: customActions,
doc: data,
enableAdjustments: showCrop || showFocalPoint,
handleRemove: canRemoveUpload ? handleFileRemoval : undefined,
hasImageSizes: hasImageSizes,
hideRemoveFile: uploadConfig.hideRemoveFile,
imageCacheTag: imageCacheTag,
uploadConfig: uploadConfig
}), (!uploadConfig.hideFileInputOnCreate && !data?.filename || removedFile) && /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__upload`,
children: [!value && !showUrlInput && /*#__PURE__*/_jsx(Dropzone, {
onChange: handleFileSelection,
children: /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__dropzoneContent`,
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__dropzoneButtons`,
children: [/*#__PURE__*/_jsx(Button, {
buttonStyle: "pill",
onClick: () => {
if (inputRef.current) {
inputRef.current.click();
}
},
size: "small",
children: t('upload:selectFile')
}), /*#__PURE__*/_jsx("input", {
accept: acceptMimeTypes,
"aria-hidden": "true",
className: `${baseClass}__hidden-input`,
hidden: true,
onChange: e_0 => {
if (e_0.target.files && e_0.target.files.length > 0) {
handleFileSelection(e_0.target.files);
}
},
ref: inputRef,
type: "file"
}), uploadConfig?.pasteURL !== false && /*#__PURE__*/_jsxs(Fragment, {
children: [/*#__PURE__*/_jsx("span", {
className: `${baseClass}__orText`,
children: t('general:or')
}), /*#__PURE__*/_jsx(Button, {
buttonStyle: "pill",
onClick: () => {
setShowUrlInput(true);
setUploadControlFileUrl('');
setUploadControlFile(null);
setUploadControlFileName(null);
},
size: "small",
children: t('upload:pasteURL')
})]
}), UploadControls ? UploadControls : null]
}), /*#__PURE__*/_jsxs("p", {
className: `${baseClass}__dragAndDropText`,
children: [t('general:or'), " ", t('upload:dragAndDrop')]
})]
})
}), showUrlInput && /*#__PURE__*/_jsxs(React.Fragment, {
children: [/*#__PURE__*/_jsxs("div", {
className: `${baseClass}__remote-file-wrap`,
children: [/*#__PURE__*/_jsx("input", {
className: `${baseClass}__remote-file`,
onChange: e_1 => {
setFileUrl(e_1.target.value);
},
ref: urlInputRef,
title: fileUrl,
type: "text",
value: fileUrl
}), /*#__PURE__*/_jsx("div", {
className: `${baseClass}__add-file-wrap`,
children: /*#__PURE__*/_jsx("button", {
className: `${baseClass}__add-file`,
onClick: () => {
void handleUrlSubmit();
},
type: "button",
children: t('upload:addFile')
})
})]
}), /*#__PURE__*/_jsx(Button, {
buttonStyle: "icon-label",
className: `${baseClass}__remove`,
icon: "x",
iconStyle: "with-border",
onClick: () => {
setShowUrlInput(false);
setUploadControlFileUrl('');
setUploadControlFile(null);
setUploadControlFileName(null);
},
round: true,
tooltip: t('general:cancel')
})]
}), value && fileSrc && /*#__PURE__*/_jsxs(React.Fragment, {
children: [/*#__PURE__*/_jsx("div", {
className: `${baseClass}__thumbnail-wrap`,
children: /*#__PURE__*/_jsx(Thumbnail, {
collectionSlug: collectionSlug,
fileSrc: isImage(value.type) ? fileSrc : null
})
}), /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__file-adjustments`,
children: [/*#__PURE__*/_jsx("input", {
className: `${baseClass}__filename`,
onChange: handleFileNameChange,
title: filename || value.name,
type: "text",
value: filename || value.name
}), /*#__PURE__*/_jsx(UploadActions, {
customActions: customActions,
enableAdjustments: showCrop || showFocalPoint,
enablePreviewSizes: hasImageSizes && data?.filename && !removedFile,
mimeType: value.type
})]
}), /*#__PURE__*/_jsx(Button, {
buttonStyle: "icon-label",
className: `${baseClass}__remove`,
icon: "x",
iconStyle: "with-border",
onClick: handleFileRemoval,
round: true,
tooltip: t('general:cancel')
})]
})]
}), (value || data?.filename) && /*#__PURE__*/_jsx(EditDepthProvider, {
children: /*#__PURE__*/_jsx(Drawer, {
Header: null,
slug: editDrawerSlug,
children: /*#__PURE__*/_jsx(EditUpload, {
fileName: value?.name || data?.filename,
fileSrc: data?.url || fileSrc,
imageCacheTag: imageCacheTag,
initialCrop: uploadEdits?.crop ?? undefined,
initialFocalPoint: {
x: uploadEdits?.focalPoint?.x || data?.focalX || 50,
y: uploadEdits?.focalPoint?.y || data?.focalY || 50
},
onSave: onEditsSave,
showCrop: showCrop,
showFocalPoint: showFocalPoint
})
})
}), data && hasImageSizes && /*#__PURE__*/_jsx(Drawer, {
className: `${baseClass}__previewDrawer`,
hoverTitle: true,
slug: sizePreviewSlug,
title: t('upload:sizesFor', {
label: data.filename
}),
children: /*#__PURE__*/_jsx(PreviewSizes, {
doc: data,
imageCacheTag: imageCacheTag,
uploadConfig: uploadConfig
})
})]
});
};
function _temp(CustomAction, i) {
return _jsx(React.Fragment, {
children: CustomAction
}, i);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,398 @@
// This file is generated automatically by `scripts/build/indices.ts`. Please, don't change it.
export * from "./fp/add.js";
export * from "./fp/addBusinessDays.js";
export * from "./fp/addBusinessDaysWithOptions.js";
export * from "./fp/addDays.js";
export * from "./fp/addDaysWithOptions.js";
export * from "./fp/addHours.js";
export * from "./fp/addHoursWithOptions.js";
export * from "./fp/addISOWeekYears.js";
export * from "./fp/addISOWeekYearsWithOptions.js";
export * from "./fp/addMilliseconds.js";
export * from "./fp/addMillisecondsWithOptions.js";
export * from "./fp/addMinutes.js";
export * from "./fp/addMinutesWithOptions.js";
export * from "./fp/addMonths.js";
export * from "./fp/addMonthsWithOptions.js";
export * from "./fp/addQuarters.js";
export * from "./fp/addQuartersWithOptions.js";
export * from "./fp/addSeconds.js";
export * from "./fp/addSecondsWithOptions.js";
export * from "./fp/addWeeks.js";
export * from "./fp/addWeeksWithOptions.js";
export * from "./fp/addWithOptions.js";
export * from "./fp/addYears.js";
export * from "./fp/addYearsWithOptions.js";
export * from "./fp/areIntervalsOverlapping.js";
export * from "./fp/areIntervalsOverlappingWithOptions.js";
export * from "./fp/clamp.js";
export * from "./fp/clampWithOptions.js";
export * from "./fp/closestIndexTo.js";
export * from "./fp/closestTo.js";
export * from "./fp/closestToWithOptions.js";
export * from "./fp/compareAsc.js";
export * from "./fp/compareDesc.js";
export * from "./fp/constructFrom.js";
export * from "./fp/daysToWeeks.js";
export * from "./fp/differenceInBusinessDays.js";
export * from "./fp/differenceInBusinessDaysWithOptions.js";
export * from "./fp/differenceInCalendarDays.js";
export * from "./fp/differenceInCalendarDaysWithOptions.js";
export * from "./fp/differenceInCalendarISOWeekYears.js";
export * from "./fp/differenceInCalendarISOWeekYearsWithOptions.js";
export * from "./fp/differenceInCalendarISOWeeks.js";
export * from "./fp/differenceInCalendarISOWeeksWithOptions.js";
export * from "./fp/differenceInCalendarMonths.js";
export * from "./fp/differenceInCalendarMonthsWithOptions.js";
export * from "./fp/differenceInCalendarQuarters.js";
export * from "./fp/differenceInCalendarQuartersWithOptions.js";
export * from "./fp/differenceInCalendarWeeks.js";
export * from "./fp/differenceInCalendarWeeksWithOptions.js";
export * from "./fp/differenceInCalendarYears.js";
export * from "./fp/differenceInCalendarYearsWithOptions.js";
export * from "./fp/differenceInDays.js";
export * from "./fp/differenceInDaysWithOptions.js";
export * from "./fp/differenceInHours.js";
export * from "./fp/differenceInHoursWithOptions.js";
export * from "./fp/differenceInISOWeekYears.js";
export * from "./fp/differenceInISOWeekYearsWithOptions.js";
export * from "./fp/differenceInMilliseconds.js";
export * from "./fp/differenceInMinutes.js";
export * from "./fp/differenceInMinutesWithOptions.js";
export * from "./fp/differenceInMonths.js";
export * from "./fp/differenceInMonthsWithOptions.js";
export * from "./fp/differenceInQuarters.js";
export * from "./fp/differenceInQuartersWithOptions.js";
export * from "./fp/differenceInSeconds.js";
export * from "./fp/differenceInSecondsWithOptions.js";
export * from "./fp/differenceInWeeks.js";
export * from "./fp/differenceInWeeksWithOptions.js";
export * from "./fp/differenceInYears.js";
export * from "./fp/differenceInYearsWithOptions.js";
export * from "./fp/eachDayOfInterval.js";
export * from "./fp/eachDayOfIntervalWithOptions.js";
export * from "./fp/eachHourOfInterval.js";
export * from "./fp/eachHourOfIntervalWithOptions.js";
export * from "./fp/eachMinuteOfInterval.js";
export * from "./fp/eachMinuteOfIntervalWithOptions.js";
export * from "./fp/eachMonthOfInterval.js";
export * from "./fp/eachMonthOfIntervalWithOptions.js";
export * from "./fp/eachQuarterOfInterval.js";
export * from "./fp/eachQuarterOfIntervalWithOptions.js";
export * from "./fp/eachWeekOfInterval.js";
export * from "./fp/eachWeekOfIntervalWithOptions.js";
export * from "./fp/eachWeekendOfInterval.js";
export * from "./fp/eachWeekendOfIntervalWithOptions.js";
export * from "./fp/eachWeekendOfMonth.js";
export * from "./fp/eachWeekendOfMonthWithOptions.js";
export * from "./fp/eachWeekendOfYear.js";
export * from "./fp/eachWeekendOfYearWithOptions.js";
export * from "./fp/eachYearOfInterval.js";
export * from "./fp/eachYearOfIntervalWithOptions.js";
export * from "./fp/endOfDay.js";
export * from "./fp/endOfDayWithOptions.js";
export * from "./fp/endOfDecade.js";
export * from "./fp/endOfDecadeWithOptions.js";
export * from "./fp/endOfHour.js";
export * from "./fp/endOfHourWithOptions.js";
export * from "./fp/endOfISOWeek.js";
export * from "./fp/endOfISOWeekWithOptions.js";
export * from "./fp/endOfISOWeekYear.js";
export * from "./fp/endOfISOWeekYearWithOptions.js";
export * from "./fp/endOfMinute.js";
export * from "./fp/endOfMinuteWithOptions.js";
export * from "./fp/endOfMonth.js";
export * from "./fp/endOfMonthWithOptions.js";
export * from "./fp/endOfQuarter.js";
export * from "./fp/endOfQuarterWithOptions.js";
export * from "./fp/endOfSecond.js";
export * from "./fp/endOfSecondWithOptions.js";
export * from "./fp/endOfWeek.js";
export * from "./fp/endOfWeekWithOptions.js";
export * from "./fp/endOfYear.js";
export * from "./fp/endOfYearWithOptions.js";
export * from "./fp/format.js";
export * from "./fp/formatDistance.js";
export * from "./fp/formatDistanceStrict.js";
export * from "./fp/formatDistanceStrictWithOptions.js";
export * from "./fp/formatDistanceWithOptions.js";
export * from "./fp/formatDuration.js";
export * from "./fp/formatDurationWithOptions.js";
export * from "./fp/formatISO.js";
export * from "./fp/formatISO9075.js";
export * from "./fp/formatISO9075WithOptions.js";
export * from "./fp/formatISODuration.js";
export * from "./fp/formatISOWithOptions.js";
export * from "./fp/formatRFC3339.js";
export * from "./fp/formatRFC3339WithOptions.js";
export * from "./fp/formatRFC7231.js";
export * from "./fp/formatRelative.js";
export * from "./fp/formatRelativeWithOptions.js";
export * from "./fp/formatWithOptions.js";
export * from "./fp/fromUnixTime.js";
export * from "./fp/fromUnixTimeWithOptions.js";
export * from "./fp/getDate.js";
export * from "./fp/getDateWithOptions.js";
export * from "./fp/getDay.js";
export * from "./fp/getDayOfYear.js";
export * from "./fp/getDayOfYearWithOptions.js";
export * from "./fp/getDayWithOptions.js";
export * from "./fp/getDaysInMonth.js";
export * from "./fp/getDaysInMonthWithOptions.js";
export * from "./fp/getDaysInYear.js";
export * from "./fp/getDaysInYearWithOptions.js";
export * from "./fp/getDecade.js";
export * from "./fp/getDecadeWithOptions.js";
export * from "./fp/getHours.js";
export * from "./fp/getHoursWithOptions.js";
export * from "./fp/getISODay.js";
export * from "./fp/getISODayWithOptions.js";
export * from "./fp/getISOWeek.js";
export * from "./fp/getISOWeekWithOptions.js";
export * from "./fp/getISOWeekYear.js";
export * from "./fp/getISOWeekYearWithOptions.js";
export * from "./fp/getISOWeeksInYear.js";
export * from "./fp/getISOWeeksInYearWithOptions.js";
export * from "./fp/getMilliseconds.js";
export * from "./fp/getMinutes.js";
export * from "./fp/getMinutesWithOptions.js";
export * from "./fp/getMonth.js";
export * from "./fp/getMonthWithOptions.js";
export * from "./fp/getOverlappingDaysInIntervals.js";
export * from "./fp/getQuarter.js";
export * from "./fp/getQuarterWithOptions.js";
export * from "./fp/getSeconds.js";
export * from "./fp/getTime.js";
export * from "./fp/getUnixTime.js";
export * from "./fp/getWeek.js";
export * from "./fp/getWeekOfMonth.js";
export * from "./fp/getWeekOfMonthWithOptions.js";
export * from "./fp/getWeekWithOptions.js";
export * from "./fp/getWeekYear.js";
export * from "./fp/getWeekYearWithOptions.js";
export * from "./fp/getWeeksInMonth.js";
export * from "./fp/getWeeksInMonthWithOptions.js";
export * from "./fp/getYear.js";
export * from "./fp/getYearWithOptions.js";
export * from "./fp/hoursToMilliseconds.js";
export * from "./fp/hoursToMinutes.js";
export * from "./fp/hoursToSeconds.js";
export * from "./fp/interval.js";
export * from "./fp/intervalToDuration.js";
export * from "./fp/intervalToDurationWithOptions.js";
export * from "./fp/intervalWithOptions.js";
export * from "./fp/intlFormat.js";
export * from "./fp/intlFormatDistance.js";
export * from "./fp/intlFormatDistanceWithOptions.js";
export * from "./fp/isAfter.js";
export * from "./fp/isBefore.js";
export * from "./fp/isDate.js";
export * from "./fp/isEqual.js";
export * from "./fp/isExists.js";
export * from "./fp/isFirstDayOfMonth.js";
export * from "./fp/isFirstDayOfMonthWithOptions.js";
export * from "./fp/isFriday.js";
export * from "./fp/isFridayWithOptions.js";
export * from "./fp/isLastDayOfMonth.js";
export * from "./fp/isLastDayOfMonthWithOptions.js";
export * from "./fp/isLeapYear.js";
export * from "./fp/isLeapYearWithOptions.js";
export * from "./fp/isMatch.js";
export * from "./fp/isMatchWithOptions.js";
export * from "./fp/isMonday.js";
export * from "./fp/isMondayWithOptions.js";
export * from "./fp/isSameDay.js";
export * from "./fp/isSameDayWithOptions.js";
export * from "./fp/isSameHour.js";
export * from "./fp/isSameHourWithOptions.js";
export * from "./fp/isSameISOWeek.js";
export * from "./fp/isSameISOWeekWithOptions.js";
export * from "./fp/isSameISOWeekYear.js";
export * from "./fp/isSameISOWeekYearWithOptions.js";
export * from "./fp/isSameMinute.js";
export * from "./fp/isSameMonth.js";
export * from "./fp/isSameMonthWithOptions.js";
export * from "./fp/isSameQuarter.js";
export * from "./fp/isSameQuarterWithOptions.js";
export * from "./fp/isSameSecond.js";
export * from "./fp/isSameWeek.js";
export * from "./fp/isSameWeekWithOptions.js";
export * from "./fp/isSameYear.js";
export * from "./fp/isSameYearWithOptions.js";
export * from "./fp/isSaturday.js";
export * from "./fp/isSaturdayWithOptions.js";
export * from "./fp/isSunday.js";
export * from "./fp/isSundayWithOptions.js";
export * from "./fp/isThursday.js";
export * from "./fp/isThursdayWithOptions.js";
export * from "./fp/isTuesday.js";
export * from "./fp/isTuesdayWithOptions.js";
export * from "./fp/isValid.js";
export * from "./fp/isWednesday.js";
export * from "./fp/isWednesdayWithOptions.js";
export * from "./fp/isWeekend.js";
export * from "./fp/isWeekendWithOptions.js";
export * from "./fp/isWithinInterval.js";
export * from "./fp/isWithinIntervalWithOptions.js";
export * from "./fp/lastDayOfDecade.js";
export * from "./fp/lastDayOfDecadeWithOptions.js";
export * from "./fp/lastDayOfISOWeek.js";
export * from "./fp/lastDayOfISOWeekWithOptions.js";
export * from "./fp/lastDayOfISOWeekYear.js";
export * from "./fp/lastDayOfISOWeekYearWithOptions.js";
export * from "./fp/lastDayOfMonth.js";
export * from "./fp/lastDayOfMonthWithOptions.js";
export * from "./fp/lastDayOfQuarter.js";
export * from "./fp/lastDayOfQuarterWithOptions.js";
export * from "./fp/lastDayOfWeek.js";
export * from "./fp/lastDayOfWeekWithOptions.js";
export * from "./fp/lastDayOfYear.js";
export * from "./fp/lastDayOfYearWithOptions.js";
export * from "./fp/lightFormat.js";
export * from "./fp/max.js";
export * from "./fp/maxWithOptions.js";
export * from "./fp/milliseconds.js";
export * from "./fp/millisecondsToHours.js";
export * from "./fp/millisecondsToMinutes.js";
export * from "./fp/millisecondsToSeconds.js";
export * from "./fp/min.js";
export * from "./fp/minWithOptions.js";
export * from "./fp/minutesToHours.js";
export * from "./fp/minutesToMilliseconds.js";
export * from "./fp/minutesToSeconds.js";
export * from "./fp/monthsToQuarters.js";
export * from "./fp/monthsToYears.js";
export * from "./fp/nextDay.js";
export * from "./fp/nextDayWithOptions.js";
export * from "./fp/nextFriday.js";
export * from "./fp/nextFridayWithOptions.js";
export * from "./fp/nextMonday.js";
export * from "./fp/nextMondayWithOptions.js";
export * from "./fp/nextSaturday.js";
export * from "./fp/nextSaturdayWithOptions.js";
export * from "./fp/nextSunday.js";
export * from "./fp/nextSundayWithOptions.js";
export * from "./fp/nextThursday.js";
export * from "./fp/nextThursdayWithOptions.js";
export * from "./fp/nextTuesday.js";
export * from "./fp/nextTuesdayWithOptions.js";
export * from "./fp/nextWednesday.js";
export * from "./fp/nextWednesdayWithOptions.js";
export * from "./fp/parse.js";
export * from "./fp/parseISO.js";
export * from "./fp/parseISOWithOptions.js";
export * from "./fp/parseJSON.js";
export * from "./fp/parseJSONWithOptions.js";
export * from "./fp/parseWithOptions.js";
export * from "./fp/previousDay.js";
export * from "./fp/previousDayWithOptions.js";
export * from "./fp/previousFriday.js";
export * from "./fp/previousFridayWithOptions.js";
export * from "./fp/previousMonday.js";
export * from "./fp/previousMondayWithOptions.js";
export * from "./fp/previousSaturday.js";
export * from "./fp/previousSaturdayWithOptions.js";
export * from "./fp/previousSunday.js";
export * from "./fp/previousSundayWithOptions.js";
export * from "./fp/previousThursday.js";
export * from "./fp/previousThursdayWithOptions.js";
export * from "./fp/previousTuesday.js";
export * from "./fp/previousTuesdayWithOptions.js";
export * from "./fp/previousWednesday.js";
export * from "./fp/previousWednesdayWithOptions.js";
export * from "./fp/quartersToMonths.js";
export * from "./fp/quartersToYears.js";
export * from "./fp/roundToNearestHours.js";
export * from "./fp/roundToNearestHoursWithOptions.js";
export * from "./fp/roundToNearestMinutes.js";
export * from "./fp/roundToNearestMinutesWithOptions.js";
export * from "./fp/secondsToHours.js";
export * from "./fp/secondsToMilliseconds.js";
export * from "./fp/secondsToMinutes.js";
export * from "./fp/set.js";
export * from "./fp/setDate.js";
export * from "./fp/setDateWithOptions.js";
export * from "./fp/setDay.js";
export * from "./fp/setDayOfYear.js";
export * from "./fp/setDayOfYearWithOptions.js";
export * from "./fp/setDayWithOptions.js";
export * from "./fp/setHours.js";
export * from "./fp/setHoursWithOptions.js";
export * from "./fp/setISODay.js";
export * from "./fp/setISODayWithOptions.js";
export * from "./fp/setISOWeek.js";
export * from "./fp/setISOWeekWithOptions.js";
export * from "./fp/setISOWeekYear.js";
export * from "./fp/setISOWeekYearWithOptions.js";
export * from "./fp/setMilliseconds.js";
export * from "./fp/setMillisecondsWithOptions.js";
export * from "./fp/setMinutes.js";
export * from "./fp/setMinutesWithOptions.js";
export * from "./fp/setMonth.js";
export * from "./fp/setMonthWithOptions.js";
export * from "./fp/setQuarter.js";
export * from "./fp/setQuarterWithOptions.js";
export * from "./fp/setSeconds.js";
export * from "./fp/setSecondsWithOptions.js";
export * from "./fp/setWeek.js";
export * from "./fp/setWeekWithOptions.js";
export * from "./fp/setWeekYear.js";
export * from "./fp/setWeekYearWithOptions.js";
export * from "./fp/setWithOptions.js";
export * from "./fp/setYear.js";
export * from "./fp/setYearWithOptions.js";
export * from "./fp/startOfDay.js";
export * from "./fp/startOfDayWithOptions.js";
export * from "./fp/startOfDecade.js";
export * from "./fp/startOfDecadeWithOptions.js";
export * from "./fp/startOfHour.js";
export * from "./fp/startOfHourWithOptions.js";
export * from "./fp/startOfISOWeek.js";
export * from "./fp/startOfISOWeekWithOptions.js";
export * from "./fp/startOfISOWeekYear.js";
export * from "./fp/startOfISOWeekYearWithOptions.js";
export * from "./fp/startOfMinute.js";
export * from "./fp/startOfMinuteWithOptions.js";
export * from "./fp/startOfMonth.js";
export * from "./fp/startOfMonthWithOptions.js";
export * from "./fp/startOfQuarter.js";
export * from "./fp/startOfQuarterWithOptions.js";
export * from "./fp/startOfSecond.js";
export * from "./fp/startOfSecondWithOptions.js";
export * from "./fp/startOfWeek.js";
export * from "./fp/startOfWeekWithOptions.js";
export * from "./fp/startOfWeekYear.js";
export * from "./fp/startOfWeekYearWithOptions.js";
export * from "./fp/startOfYear.js";
export * from "./fp/startOfYearWithOptions.js";
export * from "./fp/sub.js";
export * from "./fp/subBusinessDays.js";
export * from "./fp/subBusinessDaysWithOptions.js";
export * from "./fp/subDays.js";
export * from "./fp/subDaysWithOptions.js";
export * from "./fp/subHours.js";
export * from "./fp/subHoursWithOptions.js";
export * from "./fp/subISOWeekYears.js";
export * from "./fp/subISOWeekYearsWithOptions.js";
export * from "./fp/subMilliseconds.js";
export * from "./fp/subMillisecondsWithOptions.js";
export * from "./fp/subMinutes.js";
export * from "./fp/subMinutesWithOptions.js";
export * from "./fp/subMonths.js";
export * from "./fp/subMonthsWithOptions.js";
export * from "./fp/subQuarters.js";
export * from "./fp/subQuartersWithOptions.js";
export * from "./fp/subSeconds.js";
export * from "./fp/subSecondsWithOptions.js";
export * from "./fp/subWeeks.js";
export * from "./fp/subWeeksWithOptions.js";
export * from "./fp/subWithOptions.js";
export * from "./fp/subYears.js";
export * from "./fp/subYearsWithOptions.js";
export * from "./fp/toDate.js";
export * from "./fp/transpose.js";
export * from "./fp/weeksToDays.js";
export * from "./fp/yearsToDays.js";
export * from "./fp/yearsToMonths.js";
export * from "./fp/yearsToQuarters.js";

View File

@@ -0,0 +1,2 @@
// Needed for projects with `moduleResolution: 'node'`
export * from './dist/types/core.d.ts';

View File

@@ -0,0 +1,45 @@
"use strict";
exports.compareAsc = compareAsc;
var _index = require("./toDate.cjs");
/**
* @name compareAsc
* @category Common Helpers
* @summary Compare the two dates and return -1, 0 or 1.
*
* @description
* Compare the two dates and return 1 if the first date is after the second,
* -1 if the first date is before the second or 0 if dates are equal.
*
* @param dateLeft - The first date to compare
* @param dateRight - The second date to compare
*
* @returns The result of the comparison
*
* @example
* // Compare 11 February 1987 and 10 July 1989:
* const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
* //=> -1
*
* @example
* // Sort the array of dates:
* const result = [
* new Date(1995, 6, 2),
* new Date(1987, 1, 11),
* new Date(1989, 6, 10)
* ].sort(compareAsc)
* //=> [
* // Wed Feb 11 1987 00:00:00,
* // Mon Jul 10 1989 00:00:00,
* // Sun Jul 02 1995 00:00:00
* // ]
*/
function compareAsc(dateLeft, dateRight) {
const diff = +(0, _index.toDate)(dateLeft) - +(0, _index.toDate)(dateRight);
if (diff < 0) return -1;
else if (diff > 0) return 1;
// Return 0 if diff is 0; return NaN if diff is NaN
return diff;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/Selection/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,OAAO,KAAgF,MAAM,OAAO,CAAA;AAOpG,oBAAY,eAAe;IACzB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,EAAE,CAAC,gBAAgB,CAAC,EAAE,KAAK,KAAK,MAAM,CAAA;IACpD,cAAc,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IACzC,SAAS,EAAE,eAAe,CAAA;IAC1B,QAAQ,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,WAAW,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAChC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;IAC3C;;;OAGG;IACH,SAAS,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAcD,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IAElC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,CAAA;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,CAAA;AAcD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAoM7C,CAAA;AAED,eAAO,MAAM,YAAY,QAAO,gBAAgC,CAAA"}

View File

@@ -0,0 +1,40 @@
import { consoleSandbox, getClient, debug } from '@sentry/core';
import { DEBUG_BUILD } from '../debug-build.js';
const DEFAULT_SHUTDOWN_TIMEOUT = 2000;
/**
* @hidden
*/
function logAndExitProcess(error) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.error(error);
});
const client = getClient();
if (client === undefined) {
DEBUG_BUILD && debug.warn('No NodeClient was defined, we are exiting the process now.');
global.process.exit(1);
return;
}
const options = client.getOptions();
const timeout =
options?.shutdownTimeout && options.shutdownTimeout > 0 ? options.shutdownTimeout : DEFAULT_SHUTDOWN_TIMEOUT;
client.close(timeout).then(
(result) => {
if (!result) {
DEBUG_BUILD && debug.warn('We reached the timeout for emptying the request buffer, still exiting now!');
}
global.process.exit(1);
},
error => {
DEBUG_BUILD && debug.error(error);
},
);
}
export { logAndExitProcess };
//# sourceMappingURL=errorhandling.js.map

View File

@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const TableOfContents = createLucideIcon("TableOfContents", [
["path", { d: "M16 12H3", key: "1a2rj7" }],
["path", { d: "M16 18H3", key: "12xzn7" }],
["path", { d: "M16 6H3", key: "1wxfjs" }],
["path", { d: "M21 12h.01", key: "msek7k" }],
["path", { d: "M21 18h.01", key: "1e8rq1" }],
["path", { d: "M21 6h.01", key: "1koanj" }]
]);
export { TableOfContents as default };
//# sourceMappingURL=table-of-contents.js.map

View File

@@ -0,0 +1 @@
!function(t){var n=t.util.clone(t.languages.javascript),e="(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})";function a(t,n){return t=t.replace(/<S>/g,(function(){return"(?:\\s|//.*(?!.)|/\\*(?:[^*]|\\*(?!/))\\*/)"})).replace(/<BRACES>/g,(function(){return"(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})"})).replace(/<SPREAD>/g,(function(){return e})),RegExp(t,n)}e=a(e).source,t.languages.jsx=t.languages.extend("markup",n),t.languages.jsx.tag.pattern=a("</?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:\"(?:\\\\[^]|[^\\\\\"])*\"|'(?:\\\\[^]|[^\\\\'])*'|[^\\s{'\"/>=]+|<BRACES>))?|<SPREAD>))*<S>*/?)?>"),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=n.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:a("<SPREAD>"),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:a("=<BRACES>"),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var s=function(t){return t?"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(s).join(""):""},g=function(n){for(var e=[],a=0;a<n.length;a++){var o=n[a],i=!1;if("string"!=typeof o&&("tag"===o.type&&o.content[0]&&"tag"===o.content[0].type?"</"===o.content[0].content[0].content?e.length>0&&e[e.length-1].tagName===s(o.content[0].content[1])&&e.pop():"/>"===o.content[o.content.length-1].content||e.push({tagName:s(o.content[0].content[1]),openedBraces:0}):e.length>0&&"punctuation"===o.type&&"{"===o.content?e[e.length-1].openedBraces++:e.length>0&&e[e.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?e[e.length-1].openedBraces--:i=!0),(i||"string"==typeof o)&&e.length>0&&0===e[e.length-1].openedBraces){var r=s(o);a<n.length-1&&("string"==typeof n[a+1]||"plain-text"===n[a+1].type)&&(r+=s(n[a+1]),n.splice(a+1,1)),a>0&&("string"==typeof n[a-1]||"plain-text"===n[a-1].type)&&(r=s(n[a-1])+r,n.splice(a-1,1),a--),n[a]=new t.Token("plain-text",r,null,r)}o.content&&"string"!=typeof o.content&&g(o.content)}};t.hooks.add("after-tokenize",(function(t){"jsx"!==t.language&&"tsx"!==t.language||g(t.tokens)}))}(Prism);

View File

@@ -0,0 +1,9 @@
import React from 'react';
import './index.scss';
export declare const JSONField: React.FC<{
readonly path: string;
readonly validate?: import("payload").JSONFieldValidation;
} & {
readonly field: Omit<import("payload").JSONFieldClient, "type"> & Partial<Pick<import("payload").JSONFieldClient, "type">>;
} & Omit<import("payload").ClientComponentProps, "customComponents" | "field">>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,58 @@
'use strict'
const { test } = require('tap')
const config = require('./pkg.config.json')
const { promisify } = require('node:util')
const { unlink } = require('node:fs/promises')
const { join } = require('node:path')
const { platform } = require('node:process')
const execFile = promisify(require('node:child_process').execFile)
const skip = process.env.PNPM_CI || process.env.CITGM || process.arch === 'ppc64'
/**
* The following regex is for tesintg the deprecation warning that is thrown by the `punycode` module.
* Exact text that it's matching is:
* (node:1234) [DEP0040] DeprecationWarning: The `punycode` module is deprecated.
Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
*/
const deprecationWarningRegex = /^\(\w+:\d+\)\s\[[\w|\d]+\]\sDeprecationWarning: The `punycode` module is deprecated\.\s+Please use a userland alternative instead\.\s+\(Use `node --trace-deprecation \.\.\.` to show where the warning was created\)\s+$/
test('worker test when packaged into executable using pkg', { skip }, async (t) => {
const packageName = 'index'
// package the app into several node versions, check config for more info
const filePath = `${join(__dirname, packageName)}.js`
const configPath = join(__dirname, 'pkg.config.json')
const { stderr } = await execFile('npx', ['pkg', filePath, '--config', configPath], { shell: true })
// there should be no error when packaging
const expectedvalue = stderr === '' || deprecationWarningRegex.test(stderr)
t.ok(expectedvalue)
// pkg outputs files in the following format by default: {filename}-{node version}
for (const target of config.pkg.targets) {
// execute the packaged test
let executablePath = `${join(config.pkg.outputPath, packageName)}-${target}`
// when on windows, we need the .exe extension
if (platform === 'win32') {
executablePath = `${executablePath}.exe`
} else {
executablePath = `./${executablePath}`
}
const { stderr } = await execFile(executablePath)
// check if there were no errors
const expectedvalue = stderr === '' || deprecationWarningRegex.test(stderr)
t.ok(expectedvalue)
// clean up afterwards
await unlink(executablePath)
}
t.end()
})

View File

@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";import{throwIfCoreCollection as t}from"../../utils/throw-core-collection.js";const n=(n,r)=>()=>(e(String(n),`Collection cannot be empty`),t(n,`Cannot use readSingleton for core collections`),{path:`/items/${n}`,params:r??{},method:`GET`});export{n as readSingleton};
//# sourceMappingURL=singleton.js.map

View File

@@ -0,0 +1,145 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchPatternFn.js");
var _index2 = require("../../_lib/buildMatchFn.js");
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /[قب]/,
abbreviated: /[قب]\.م\./,
wide: /(قبل|بعد) الميلاد/,
};
const parseEraPatterns = {
any: [/قبل/, /بعد/],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /ر[1234]/,
wide: /الربع (الأول|الثاني|الثالث|الرابع)/,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[أيفمسند]/,
abbreviated:
/^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
wide: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
};
const parseMonthPatterns = {
narrow: [
/^ي/i,
/^ف/i,
/^م/i,
/^أ/i,
/^م/i,
/^ي/i,
/^ي/i,
/^أ/i,
/^س/i,
/^أ/i,
/^ن/i,
/^د/i,
],
any: [
/^يناير/i,
/^فبراير/i,
/^مارس/i,
/^أبريل/i,
/^مايو/i,
/^يونيو/i,
/^يوليو/i,
/^أغسطس/i,
/^سبتمبر/i,
/^أكتوبر/i,
/^نوفمبر/i,
/^ديسمبر/i,
],
};
const matchDayPatterns = {
narrow: /^[حنثرخجس]/i,
short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i,
};
const parseDayPatterns = {
narrow: [/^ح/i, /^ن/i, /^ث/i, /^ر/i, /^خ/i, /^ج/i, /^س/i],
wide: [
/^الأحد/i,
/^الاثنين/i,
/^الثلاثاء/i,
/^الأربعاء/i,
/^الخميس/i,
/^الجمعة/i,
/^السبت/i,
],
any: [/^أح/i, /^اث/i, /^ث/i, /^أر/i, /^خ/i, /^ج/i, /^س/i],
};
const matchDayPeriodPatterns = {
narrow: /^(ص|م|منتصف الليل|الظهر|بعد الظهر|في الصباح|في المساء|في الليل)/,
any: /^(ص|م|منتصف الليل|الظهر|بعد الظهر|في الصباح|في المساء|في الليل)/,
};
const parseDayPeriodPatterns = {
any: {
am: /^ص/,
pm: /^م/,
midnight: /منتصف الليل/,
noon: /الظهر/,
afternoon: /بعد الظهر/,
morning: /في الصباح/,
evening: /في المساء/,
night: /في الليل/,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index2.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index2.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index2.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index2.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index2.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1,11 @@
import type { Where } from '../types/index.js';
/**
* Validates that a "where" query is in a format in which the "where builder" can understand.
* Even though basic queries are valid, we need to hoist them into the "and" / "or" format.
* Use this function alongside `transformWhereQuery` to perform a transformation if the query is not valid.
* @example
* Inaccurate: [text][equals]=example%20post
* Accurate: [or][0][and][0][text][equals]=example%20post
*/
export declare const validateWhereQuery: (whereQuery: Where) => whereQuery is Where;
//# sourceMappingURL=validateWhereQuery.d.ts.map

View File

@@ -0,0 +1,6 @@
import type { DefaultDocumentIDType, Payload } from 'payload';
export declare const getPreferences: <T>(key: string, payload: Payload, userID: DefaultDocumentIDType, userSlug: string) => Promise<{
id: DefaultDocumentIDType;
value: T;
}>;
//# sourceMappingURL=getPreferences.d.ts.map

View File

@@ -0,0 +1,101 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "minna en 1 sekúnda",
other: "minna en {{count}} sekúndur",
},
xSeconds: {
one: "1 sekúnda",
other: "{{count}} sekúndur",
},
halfAMinute: "hálf mínúta",
lessThanXMinutes: {
one: "minna en 1 mínúta",
other: "minna en {{count}} mínútur",
},
xMinutes: {
one: "1 mínúta",
other: "{{count}} mínútur",
},
aboutXHours: {
one: "u.þ.b. 1 klukkustund",
other: "u.þ.b. {{count}} klukkustundir",
},
xHours: {
one: "1 klukkustund",
other: "{{count}} klukkustundir",
},
xDays: {
one: "1 dagur",
other: "{{count}} dagar",
},
aboutXWeeks: {
one: "um viku",
other: "um {{count}} vikur",
},
xWeeks: {
one: "1 viku",
other: "{{count}} vikur",
},
aboutXMonths: {
one: "u.þ.b. 1 mánuður",
other: "u.þ.b. {{count}} mánuðir",
},
xMonths: {
one: "1 mánuður",
other: "{{count}} mánuðir",
},
aboutXYears: {
one: "u.þ.b. 1 ár",
other: "u.þ.b. {{count}} ár",
},
xYears: {
one: "1 ár",
other: "{{count}} ár",
},
overXYears: {
one: "meira en 1 ár",
other: "meira en {{count}} ár",
},
almostXYears: {
one: "næstum 1 ár",
other: "næstum {{count}} ár",
},
};
export const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "í " + result;
} else {
return result + " síðan";
}
}
return result;
};

View File

@@ -0,0 +1,20 @@
var coreJsData = require('./_coreJsData');
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
module.exports = isMasked;

View File

@@ -0,0 +1,67 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var int_common_exports = {};
__export(int_common_exports, {
PgIntColumnBaseBuilder: () => PgIntColumnBaseBuilder
});
module.exports = __toCommonJS(int_common_exports);
var import_entity = require("../../entity.cjs");
var import_common = require("./common.cjs");
class PgIntColumnBaseBuilder extends import_common.PgColumnBuilder {
static [import_entity.entityKind] = "PgIntColumnBaseBuilder";
generatedAlwaysAsIdentity(sequence) {
if (sequence) {
const { name, ...options } = sequence;
this.config.generatedIdentity = {
type: "always",
sequenceName: name,
sequenceOptions: options
};
} else {
this.config.generatedIdentity = {
type: "always"
};
}
this.config.hasDefault = true;
this.config.notNull = true;
return this;
}
generatedByDefaultAsIdentity(sequence) {
if (sequence) {
const { name, ...options } = sequence;
this.config.generatedIdentity = {
type: "byDefault",
sequenceName: name,
sequenceOptions: options
};
} else {
this.config.generatedIdentity = {
type: "byDefault"
};
}
this.config.hasDefault = true;
this.config.notNull = true;
return this;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgIntColumnBaseBuilder
});
//# sourceMappingURL=int.common.cjs.map

View File

@@ -0,0 +1,130 @@
import { entityKind } from "../../entity.js";
import { QueryPromise } from "../../query-promise.js";
import { SelectionProxyHandler } from "../../selection-proxy.js";
import { Table } from "../../table.js";
import { mapUpdateSet } from "../../utils.js";
import { extractUsedTable } from "../utils.js";
class SingleStoreUpdateBuilder {
constructor(table, session, dialect, withList) {
this.table = table;
this.session = session;
this.dialect = dialect;
this.withList = withList;
}
static [entityKind] = "SingleStoreUpdateBuilder";
set(values) {
return new SingleStoreUpdateBase(
this.table,
mapUpdateSet(this.table, values),
this.session,
this.dialect,
this.withList
);
}
}
class SingleStoreUpdateBase extends QueryPromise {
constructor(table, set, session, dialect, withList) {
super();
this.session = session;
this.dialect = dialect;
this.config = { set, table, withList };
}
static [entityKind] = "SingleStoreUpdate";
config;
/**
* Adds a 'where' clause to the query.
*
* Calling this method will update only those rows that fulfill a specified condition.
*
* See docs: {@link https://orm.drizzle.team/docs/update}
*
* @param where the 'where' clause.
*
* @example
* You can use conditional operators and `sql function` to filter the rows to be updated.
*
* ```ts
* // Update all cars with green color
* db.update(cars).set({ color: 'red' })
* .where(eq(cars.color, 'green'));
* // or
* db.update(cars).set({ color: 'red' })
* .where(sql`${cars.color} = 'green'`)
* ```
*
* You can logically combine conditional operators with `and()` and `or()` operators:
*
* ```ts
* // Update all BMW cars with a green color
* db.update(cars).set({ color: 'red' })
* .where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));
*
* // Update all cars with the green or blue color
* db.update(cars).set({ color: 'red' })
* .where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));
* ```
*/
where(where) {
this.config.where = where;
return this;
}
orderBy(...columns) {
if (typeof columns[0] === "function") {
const orderBy = columns[0](
new Proxy(
this.config.table[Table.Symbol.Columns],
new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" })
)
);
const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy];
this.config.orderBy = orderByArray;
} else {
const orderByArray = columns;
this.config.orderBy = orderByArray;
}
return this;
}
limit(limit) {
this.config.limit = limit;
return this;
}
/** @internal */
getSQL() {
return this.dialect.buildUpdateQuery(this.config);
}
toSQL() {
const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
return rest;
}
prepare() {
return this.session.prepareQuery(
this.dialect.sqlToQuery(this.getSQL()),
this.config.returning,
void 0,
void 0,
void 0,
{
type: "delete",
tables: extractUsedTable(this.config.table)
}
);
}
execute = (placeholderValues) => {
return this.prepare().execute(placeholderValues);
};
createIterator = () => {
const self = this;
return async function* (placeholderValues) {
yield* self.prepare().iterator(placeholderValues);
};
};
iterator = this.createIterator();
$dynamic() {
return this;
}
}
export {
SingleStoreUpdateBase,
SingleStoreUpdateBuilder
};
//# sourceMappingURL=update.js.map

View File

@@ -0,0 +1,165 @@
'use strict'
const EventEmitter = require('events').EventEmitter
const util = require('util')
const utils = require('../utils')
const NativeQuery = (module.exports = function (config, values, callback) {
EventEmitter.call(this)
config = utils.normalizeQueryConfig(config, values, callback)
this.text = config.text
this.values = config.values
this.name = config.name
this.queryMode = config.queryMode
this.callback = config.callback
this.state = 'new'
this._arrayMode = config.rowMode === 'array'
// if the 'row' event is listened for
// then emit them as they come in
// without setting singleRowMode to true
// this has almost no meaning because libpq
// reads all rows into memory before returning any
this._emitRowEvents = false
this.on(
'newListener',
function (event) {
if (event === 'row') this._emitRowEvents = true
}.bind(this)
)
})
util.inherits(NativeQuery, EventEmitter)
const errorFieldMap = {
sqlState: 'code',
statementPosition: 'position',
messagePrimary: 'message',
context: 'where',
schemaName: 'schema',
tableName: 'table',
columnName: 'column',
dataTypeName: 'dataType',
constraintName: 'constraint',
sourceFile: 'file',
sourceLine: 'line',
sourceFunction: 'routine',
}
NativeQuery.prototype.handleError = function (err) {
// copy pq error fields into the error object
const fields = this.native.pq.resultErrorFields()
if (fields) {
for (const key in fields) {
const normalizedFieldName = errorFieldMap[key] || key
err[normalizedFieldName] = fields[key]
}
}
if (this.callback) {
this.callback(err)
} else {
this.emit('error', err)
}
this.state = 'error'
}
NativeQuery.prototype.then = function (onSuccess, onFailure) {
return this._getPromise().then(onSuccess, onFailure)
}
NativeQuery.prototype.catch = function (callback) {
return this._getPromise().catch(callback)
}
NativeQuery.prototype._getPromise = function () {
if (this._promise) return this._promise
this._promise = new Promise(
function (resolve, reject) {
this._once('end', resolve)
this._once('error', reject)
}.bind(this)
)
return this._promise
}
NativeQuery.prototype.submit = function (client) {
this.state = 'running'
const self = this
this.native = client.native
client.native.arrayMode = this._arrayMode
let after = function (err, rows, results) {
client.native.arrayMode = false
setImmediate(function () {
self.emit('_done')
})
// handle possible query error
if (err) {
return self.handleError(err)
}
// emit row events for each row in the result
if (self._emitRowEvents) {
if (results.length > 1) {
rows.forEach((rowOfRows, i) => {
rowOfRows.forEach((row) => {
self.emit('row', row, results[i])
})
})
} else {
rows.forEach(function (row) {
self.emit('row', row, results)
})
}
}
// handle successful result
self.state = 'end'
self.emit('end', results)
if (self.callback) {
self.callback(null, results)
}
}
if (process.domain) {
after = process.domain.bind(after)
}
// named query
if (this.name) {
if (this.name.length > 63) {
console.error('Warning! Postgres only supports 63 characters for query names.')
console.error('You supplied %s (%s)', this.name, this.name.length)
console.error('This can cause conflicts and silent errors executing queries')
}
const values = (this.values || []).map(utils.prepareValue)
// check if the client has already executed this named query
// if so...just execute it again - skip the planning phase
if (client.namedQueries[this.name]) {
if (this.text && client.namedQueries[this.name] !== this.text) {
const err = new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`)
return after(err)
}
return client.native.execute(this.name, values, after)
}
// plan the named query the first time, then execute it
return client.native.prepare(this.name, this.text, values.length, function (err) {
if (err) return after(err)
client.namedQueries[self.name] = self.text
return self.native.execute(self.name, values, after)
})
} else if (this.values) {
if (!Array.isArray(this.values)) {
const err = new Error('Query values must be an array')
return after(err)
}
const vals = this.values.map(utils.prepareValue)
client.native.query(this.text, vals, after)
} else if (this.queryMode === 'extended') {
client.native.query(this.text, [], after)
} else {
client.native.query(this.text, after)
}
}

View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/
import type {
BaseSelection,
LexicalEditor,
LexicalNode,
EditorState,
EditorThemeClasses,
} from 'lexical';
export type FindCachedParentDOMNode = (
node: Node,
searchFn: FindCachedParentDOMNodeSearchFn,
) => null | Node;
export type FindCachedParentDOMNodeSearchFn = (node: Node) => boolean;
declare export function $generateHtmlFromNodes(
editor: LexicalEditor,
selection?: BaseSelection | null,
): string;
declare export function $generateNodesFromDOM(
editor: LexicalEditor,
dom: Document,
): Array<LexicalNode>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/auth/endpoints/me.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAY3D,eAAO,MAAM,SAAS,EAAE,cAoDvB,CAAA"}

View File

@@ -0,0 +1,56 @@
import type {
CodeKeywordDefinition,
ErrorObject,
KeywordErrorDefinition,
AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, not, Name} from "../../compile/codegen"
import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util"
export type AdditionalItemsError = ErrorObject<"additionalItems", {limit: number}, AnySchema>
const error: KeywordErrorDefinition = {
message: ({params: {len}}) => str`must NOT have more than ${len} items`,
params: ({params: {len}}) => _`{limit: ${len}}`,
}
const def: CodeKeywordDefinition = {
keyword: "additionalItems" as const,
type: "array",
schemaType: ["boolean", "object"],
before: "uniqueItems",
error,
code(cxt: KeywordCxt) {
const {parentSchema, it} = cxt
const {items} = parentSchema
if (!Array.isArray(items)) {
checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas')
return
}
validateAdditionalItems(cxt, items)
},
}
export function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void {
const {gen, schema, data, keyword, it} = cxt
it.items = true
const len = gen.const("len", _`${data}.length`)
if (schema === false) {
cxt.setParams({len: items.length})
cxt.pass(_`${len} <= ${items.length}`)
} else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) {
const valid = gen.var("valid", _`${len} <= ${items.length}`) // TODO var
gen.if(not(valid), () => validateItems(valid))
cxt.ok(valid)
}
function validateItems(valid: Name): void {
gen.forRange("i", items.length, len, (i) => {
cxt.subschema({keyword, dataProp: i, dataPropType: Type.Num}, valid)
if (!it.allErrors) gen.if(not(valid), () => gen.break())
})
}
}
export default def

View File

@@ -0,0 +1,18 @@
import { Span } from '@sentry/core';
import { Location, RouteObject } from '../types';
/**
* Creates a proxy wrapper for an async handler function.
* Captures both the location and the active span at invocation time to ensure
* the correct span is updated when the handler resolves.
*/
export declare function createAsyncHandlerProxy(originalFunction: (...args: unknown[]) => unknown, route: RouteObject, handlerKey: string, processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location, capturedSpan?: Span) => void): (...args: unknown[]) => unknown;
/**
* Handles the result of an async handler function call.
* Passes the captured span through to ensure the correct span is updated.
*/
export declare function handleAsyncHandlerResult(result: unknown, route: RouteObject, handlerKey: string, processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location, capturedSpan?: Span) => void, currentLocation: Location | null, capturedSpan: Span | undefined): void;
/**
* Recursively checks a route for async handlers and sets up Proxies to add discovered child routes to allRoutes when called.
*/
export declare function checkRouteForAsyncHandler(route: RouteObject, processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location, capturedSpan?: Span) => void): void;
//# sourceMappingURL=lazy-routes.d.ts.map

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