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

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions
@@ -0,0 +1,29 @@
import { formatDistance } from "./en-US/_lib/formatDistance.js";
import { formatRelative } from "./en-US/_lib/formatRelative.js";
import { localize } from "./en-US/_lib/localize.js";
import { match } from "./en-US/_lib/match.js";
import { formatLong } from "./en-NZ/_lib/formatLong.js";
/**
* @category Locales
* @summary English locale (New Zealand).
* @language English
* @iso-639-2 eng
* @author Murray Lucas [@muntact](https://github.com/muntact)
*/
export const enNZ = {
code: "en-NZ",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default enNZ;
@@ -0,0 +1,34 @@
"use strict";
exports.endOfDecade = endOfDecade;
var _index = require("./toDate.js");
/**
* @name endOfDecade
* @category Decade Helpers
* @summary Return the end of a decade for the given date.
*
* @description
* Return the end 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 end of a decade
*
* @example
* // The end of a decade for 12 May 1984 00:00:00:
* const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00))
* //=> Dec 31 1989 23:59:59.999
*/
function endOfDecade(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 = 9 + Math.floor(year / 10) * 10;
_date.setFullYear(decade, 11, 31);
_date.setHours(23, 59, 59, 999);
return _date;
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('without', require('../without'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,35 @@
import { DefaultLogger } from "../logger.js";
import {
createTableRelationsHelpers,
extractTablesRelationalConfig
} from "../relations.js";
import { BaseSQLiteDatabase } from "../sqlite-core/db.js";
import { SQLiteSyncDialect } from "../sqlite-core/dialect.js";
import { SQLJsSession } from "./session.js";
function drizzle(client, config = {}) {
const dialect = new SQLiteSyncDialect({ casing: config.casing });
let logger;
if (config.logger === true) {
logger = new DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
let schema;
if (config.schema) {
const tablesConfig = extractTablesRelationalConfig(
config.schema,
createTableRelationsHelpers
);
schema = {
fullSchema: config.schema,
schema: tablesConfig.tables,
tableNamesMap: tablesConfig.tableNamesMap
};
}
const session = new SQLJsSession(client, dialect, schema, { logger });
return new BaseSQLiteDatabase("sync", dialect, session, schema);
}
export {
drizzle
};
//# sourceMappingURL=driver.js.map
@@ -0,0 +1 @@
{"version":3,"file":"cake-slice.js","sources":["../../../src/icons/cake-slice.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CakeSlice\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI5IiBjeT0iNyIgcj0iMiIgLz4KICA8cGF0aCBkPSJNNy4yIDcuOSAzIDExdjljMCAuNi40IDEgMSAxaDE2Yy42IDAgMS0uNCAxLTF2LTljMC0yLTMtNi03LThsLTMuNiAyLjYiIC8+CiAgPHBhdGggZD0iTTE2IDEzSDMiIC8+CiAgPHBhdGggZD0iTTE2IDE3SDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/cake-slice\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 CakeSlice = createLucideIcon('CakeSlice', [\n ['circle', { cx: '9', cy: '7', r: '2', key: '1305pl' }],\n [\n 'path',\n { d: 'M7.2 7.9 3 11v9c0 .6.4 1 1 1h16c.6 0 1-.4 1-1v-9c0-2-3-6-7-8l-3.6 2.6', key: 'xle13f' },\n ],\n ['path', { d: 'M16 13H3', key: '1wpj08' }],\n ['path', { d: 'M16 17H3', key: '3lvfcd' }],\n]);\n\nexport default CakeSlice;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACtD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC9F,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,373 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.evaluate = evaluate;
exports.evaluateTruthy = evaluateTruthy;
const VALID_OBJECT_CALLEES = ["Number", "String", "Math"];
const VALID_IDENTIFIER_CALLEES = ["isFinite", "isNaN", "parseFloat", "parseInt", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", null, null];
const INVALID_METHODS = ["random"];
function isValidObjectCallee(val) {
return VALID_OBJECT_CALLEES.includes(val);
}
function isValidIdentifierCallee(val) {
return VALID_IDENTIFIER_CALLEES.includes(val);
}
function isInvalidMethod(val) {
return INVALID_METHODS.includes(val);
}
function evaluateTruthy() {
const res = this.evaluate();
if (res.confident) return !!res.value;
}
function deopt(path, state) {
if (!state.confident) return;
state.deoptPath = path;
state.confident = false;
}
const Globals = new Map([["undefined", undefined], ["Infinity", Infinity], ["NaN", NaN]]);
function evaluateCached(path, state) {
const {
node
} = path;
const {
seen
} = state;
if (seen.has(node)) {
const existing = seen.get(node);
if (existing.resolved) {
return existing.value;
} else {
deopt(path, state);
return;
}
} else {
const item = {
resolved: false
};
seen.set(node, item);
const val = _evaluate(path, state);
if (state.confident) {
item.resolved = true;
item.value = val;
}
return val;
}
}
function _evaluate(path, state) {
if (!state.confident) return;
if (path.isSequenceExpression()) {
const exprs = path.get("expressions");
return evaluateCached(exprs[exprs.length - 1], state);
}
if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) {
return path.node.value;
}
if (path.isNullLiteral()) {
return null;
}
if (path.isTemplateLiteral()) {
return evaluateQuasis(path, path.node.quasis, state);
}
if (path.isTaggedTemplateExpression() && path.get("tag").isMemberExpression()) {
const object = path.get("tag.object");
const {
node: {
name
}
} = object;
const property = path.get("tag.property");
if (object.isIdentifier() && name === "String" && !path.scope.getBinding(name) && property.isIdentifier() && property.node.name === "raw") {
return evaluateQuasis(path, path.node.quasi.quasis, state, true);
}
}
if (path.isConditionalExpression()) {
const testResult = evaluateCached(path.get("test"), state);
if (!state.confident) return;
if (testResult) {
return evaluateCached(path.get("consequent"), state);
} else {
return evaluateCached(path.get("alternate"), state);
}
}
if (path.isExpressionWrapper()) {
return evaluateCached(path.get("expression"), state);
}
if (path.isMemberExpression() && !path.parentPath.isCallExpression({
callee: path.node
})) {
const property = path.get("property");
const object = path.get("object");
if (object.isLiteral()) {
const value = object.node.value;
const type = typeof value;
let key = null;
if (path.node.computed) {
key = evaluateCached(property, state);
if (!state.confident) return;
} else if (property.isIdentifier()) {
key = property.node.name;
}
if ((type === "number" || type === "string") && key != null && (typeof key === "number" || typeof key === "string")) {
return value[key];
}
}
}
if (path.isReferencedIdentifier()) {
const binding = path.scope.getBinding(path.node.name);
if (binding) {
if (binding.constantViolations.length > 0 || path.node.start < binding.path.node.end) {
deopt(binding.path, state);
return;
}
const bindingPathScope = binding.path.scope;
if (binding.kind === "var" && bindingPathScope !== binding.scope) {
let hasUnsafeBlock = !bindingPathScope.path.parentPath.isBlockStatement();
for (let scope = bindingPathScope.parent; scope; scope = scope.parent) {
var _scope$path$parentPat;
if (scope === path.scope) {
if (hasUnsafeBlock) {
deopt(binding.path, state);
return;
}
break;
}
if ((_scope$path$parentPat = scope.path.parentPath) != null && _scope$path$parentPat.isBlockStatement()) {
hasUnsafeBlock = true;
}
}
}
if (binding.hasValue) {
return binding.value;
}
}
const name = path.node.name;
if (Globals.has(name)) {
if (!binding) {
return Globals.get(name);
}
deopt(binding.path, state);
return;
}
if (!binding) {
deopt(path, state);
return;
}
const bindingPath = binding.path;
if (!bindingPath.isVariableDeclarator()) {
deopt(bindingPath, state);
return;
}
const initPath = bindingPath.get("init");
const value = evaluateCached(initPath, state);
if (typeof value === "object" && value !== null && binding.references > 1) {
deopt(initPath, state);
return;
}
return value;
}
if (path.isUnaryExpression({
prefix: true
})) {
if (path.node.operator === "void") {
return undefined;
}
const argument = path.get("argument");
if (path.node.operator === "typeof" && (argument.isFunction() || argument.isClass())) {
return "function";
}
const arg = evaluateCached(argument, state);
if (!state.confident) return;
switch (path.node.operator) {
case "!":
return !arg;
case "+":
return +arg;
case "-":
return -arg;
case "~":
return ~arg;
case "typeof":
return typeof arg;
}
}
if (path.isArrayExpression()) {
const arr = [];
const elems = path.get("elements");
for (const elem of elems) {
const elemValue = elem.evaluate();
if (elemValue.confident) {
arr.push(elemValue.value);
} else {
deopt(elemValue.deopt, state);
return;
}
}
return arr;
}
if (path.isObjectExpression()) {
const obj = {};
const props = path.get("properties");
for (const prop of props) {
if (prop.isObjectMethod() || prop.isSpreadElement()) {
deopt(prop, state);
return;
}
const keyPath = prop.get("key");
let key;
if (prop.node.computed) {
key = keyPath.evaluate();
if (!key.confident) {
deopt(key.deopt, state);
return;
}
key = key.value;
} else if (keyPath.isIdentifier()) {
key = keyPath.node.name;
} else {
key = keyPath.node.value;
}
const valuePath = prop.get("value");
let value = valuePath.evaluate();
if (!value.confident) {
deopt(value.deopt, state);
return;
}
value = value.value;
obj[key] = value;
}
return obj;
}
if (path.isLogicalExpression()) {
const wasConfident = state.confident;
const left = evaluateCached(path.get("left"), state);
const leftConfident = state.confident;
state.confident = wasConfident;
const right = evaluateCached(path.get("right"), state);
const rightConfident = state.confident;
switch (path.node.operator) {
case "||":
state.confident = leftConfident && (!!left || rightConfident);
if (!state.confident) return;
return left || right;
case "&&":
state.confident = leftConfident && (!left || rightConfident);
if (!state.confident) return;
return left && right;
case "??":
state.confident = leftConfident && (left != null || rightConfident);
if (!state.confident) return;
return left != null ? left : right;
}
}
if (path.isBinaryExpression()) {
const left = evaluateCached(path.get("left"), state);
if (!state.confident) return;
const right = evaluateCached(path.get("right"), state);
if (!state.confident) return;
switch (path.node.operator) {
case "-":
return left - right;
case "+":
return left + right;
case "/":
return left / right;
case "*":
return left * right;
case "%":
return left % right;
case "**":
return Math.pow(left, right);
case "<":
return left < right;
case ">":
return left > right;
case "<=":
return left <= right;
case ">=":
return left >= right;
case "==":
return left == right;
case "!=":
return left != right;
case "===":
return left === right;
case "!==":
return left !== right;
case "|":
return left | right;
case "&":
return left & right;
case "^":
return left ^ right;
case "<<":
return left << right;
case ">>":
return left >> right;
case ">>>":
return left >>> right;
}
}
if (path.isCallExpression()) {
const callee = path.get("callee");
let context;
let func;
if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name) && (isValidObjectCallee(callee.node.name) || isValidIdentifierCallee(callee.node.name))) {
func = global[callee.node.name];
}
if (callee.isMemberExpression()) {
const object = callee.get("object");
const property = callee.get("property");
if (object.isIdentifier() && property.isIdentifier() && isValidObjectCallee(object.node.name) && !isInvalidMethod(property.node.name)) {
context = global[object.node.name];
const key = property.node.name;
if (hasOwnProperty.call(context, key)) {
func = context[key];
}
}
if (object.isLiteral() && property.isIdentifier()) {
const type = typeof object.node.value;
if (type === "string" || type === "number") {
context = object.node.value;
func = context[property.node.name];
}
}
}
if (func) {
const args = path.get("arguments").map(arg => evaluateCached(arg, state));
if (!state.confident) return;
return func.apply(context, args);
}
}
deopt(path, state);
}
function evaluateQuasis(path, quasis, state, raw = false) {
let str = "";
let i = 0;
const exprs = path.isTemplateLiteral() ? path.get("expressions") : path.get("quasi.expressions");
for (const elem of quasis) {
if (!state.confident) break;
str += raw ? elem.value.raw : elem.value.cooked;
const expr = exprs[i++];
if (expr) str += String(evaluateCached(expr, state));
}
if (!state.confident) return;
return str;
}
function evaluate() {
const state = {
confident: true,
deoptPath: null,
seen: new Map()
};
let value = evaluateCached(this, state);
if (!state.confident) value = undefined;
return {
confident: state.confident,
deopt: state.deoptPath,
value: value
};
}
//# sourceMappingURL=evaluation.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.bundle.tracing.logs.metrics.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.logs.metrics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAIpG,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EACL,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACL,uBAAuB,IAAI,wBAAwB,EACnD,uBAAuB,IAAI,mBAAmB,EAC9C,qBAAqB,IAAI,iBAAiB,GAC3C,CAAC"}
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
{"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH;;;;;;;;;GASG;AACU,QAAA,YAAY,GAAG,SAAkB,CAAC;AAE/C;;;;;;;;GAQG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;;;;GASG;AACU,QAAA,YAAY,GAAG,SAAkB,CAAC;AAE/C;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,qBAAqB,GAAG,OAAgB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Deprecated, use `db.namespace` instead.\n *\n * @example customers\n * @example main\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.namespace`.\n */\nexport const ATTR_DB_NAME = 'db.name' as const;\n\n/**\n * Deprecated, use `db.collection.name` instead.\n *\n * @example \"mytable\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.collection.name`, but only if not extracting the value from `db.query.text`.\n */\nexport const ATTR_DB_SQL_TABLE = 'db.sql.table' as const;\n\n/**\n * The database statement being executed.\n *\n * @example SELECT * FROM wuser_table\n * @example SET mykey \"WuValue\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * Deprecated, no replacement at this time.\n *\n * @example readonly_user\n * @example reporting_user\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Removed, no replacement at this time.\n */\nexport const ATTR_DB_USER = 'db.user' as const;\n\n/**\n * Deprecated, use `server.address` on client spans and `client.address` on server spans.\n *\n * @example example.com\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.\n */\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\n\n/**\n * Deprecated, use `server.port` on client spans and `client.port` on server spans.\n *\n * @example 8080\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.\n */\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\n\n/**\n * Enum value \"mssql\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * Microsoft SQL Server\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_VALUE_MSSQL = 'mssql' as const;\n"]}
@@ -0,0 +1 @@
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/versions/migrations/localizeStatus/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAS,MAAM,KAAG,MAMzC,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,OAAO,GAAG,WAAW,CAAA;IAC9B,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IAC1B,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IACzB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC,CAAC,CAAA;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,aAAa,EAAE,EACzB,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,OAAO,GACf,sBAAsB,CAoExB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE,CActF"}
@@ -0,0 +1 @@
module.exports={C:{"5":0.01134,"46":0.00567,"56":0.00425,"72":0.00142,"103":0.00142,"111":0.00425,"115":0.01985,"118":0.00425,"128":0.00142,"139":0.00851,"140":0.00142,"142":0.00709,"143":0.00284,"144":0.00425,"145":1.95826,"146":0.20986,"147":0.00284,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 104 105 106 107 108 109 110 112 113 114 116 117 119 120 121 122 123 124 125 126 127 129 130 131 132 133 134 135 136 137 138 141 148 149 3.5 3.6"},D:{"11":0.00142,"32":0.00142,"39":0.00142,"47":0.00567,"57":0.00284,"58":0.00284,"67":0.00142,"68":0.00142,"69":0.00993,"70":0.00709,"71":0.00142,"73":0.00425,"75":0.00284,"79":0.00567,"83":0.00142,"84":0.00142,"86":0.00284,"88":0.00142,"89":0.00284,"94":0.02978,"97":0.00851,"99":0.00142,"100":0.00142,"103":0.00567,"104":0.01134,"105":0.00425,"106":0.00284,"107":0.00851,"108":0.00425,"109":0.60832,"110":0.00567,"111":0.01276,"112":0.00709,"114":0.06948,"116":0.04254,"117":0.00567,"118":0.00142,"119":0.00851,"120":0.01843,"121":0.00425,"122":0.0156,"124":0.00851,"125":0.0156,"126":0.09359,"127":0.02269,"128":0.00284,"129":0.00567,"130":0.00567,"131":0.02411,"132":0.00851,"133":0.0156,"134":0.01134,"135":0.00284,"136":0.00425,"137":0.02836,"138":0.10919,"139":0.0312,"140":0.03403,"141":0.10777,"142":1.34568,"143":1.57114,"144":0.00142,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 34 35 36 37 38 40 41 42 43 44 45 46 48 49 50 51 52 53 54 55 56 59 60 61 62 63 64 65 66 72 74 76 77 78 80 81 85 87 90 91 92 93 95 96 98 101 102 113 115 123 145 146"},F:{"63":0.00142,"92":0.00142,"93":0.08083,"95":0.00709,"120":0.00284,"123":0.00142,"124":0.21128,"125":0.09075,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00709,"13":0.00709,"15":0.00709,"16":0.00425,"17":0.00425,"18":0.01985,"84":0.00425,"89":0.00425,"90":0.00851,"92":0.02552,"100":0.00567,"109":0.00142,"112":0.00142,"113":0.00142,"120":0.06239,"122":0.00284,"124":0.00142,"125":0.00567,"129":0.00425,"131":0.00851,"132":0.00567,"133":0.00142,"134":0.01134,"135":0.00142,"137":0.00425,"138":0.06806,"139":0.00567,"140":0.01985,"141":0.00142,"142":0.67497,"143":1.73989,_:"14 79 80 81 83 85 86 87 88 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 114 115 116 117 118 119 121 123 126 127 128 130 136"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 12.1 15.1 15.5 16.0 16.2 16.3 16.5 17.0 17.2 17.3 17.4 17.5 26.3","5.1":0.00993,"11.1":0.00142,"13.1":0.00567,"14.1":0.00284,"15.2-15.3":0.00142,"15.4":0.00425,"15.6":0.02411,"16.1":0.00567,"16.4":0.00284,"16.6":0.01134,"17.1":0.00284,"17.6":0.01276,"18.0":0.00425,"18.1":0.00993,"18.2":0.00142,"18.3":0.00284,"18.4":0.00142,"18.5-18.6":0.00851,"26.0":0.01418,"26.1":0.01276,"26.2":0.01134},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00056,"5.0-5.1":0,"6.0-6.1":0.00113,"7.0-7.1":0.00085,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00226,"10.0-10.2":0.00028,"10.3":0.00395,"11.0-11.2":0.04857,"11.3-11.4":0.00141,"12.0-12.1":0.00113,"12.2-12.5":0.01271,"13.0-13.1":0.00028,"13.2":0.00198,"13.3":0.00056,"13.4-13.7":0.00198,"14.0-14.4":0.00395,"14.5-14.8":0.00424,"15.0-15.1":0.00452,"15.2-15.3":0.00339,"15.4":0.00367,"15.5":0.00395,"15.6-15.8":0.06128,"16.0":0.00706,"16.1":0.01355,"16.2":0.00706,"16.3":0.01271,"16.4":0.00311,"16.5":0.00537,"16.6-16.7":0.07963,"17.0":0.00452,"17.1":0.00734,"17.2":0.00537,"17.3":0.00819,"17.4":0.01384,"17.5":0.02711,"17.6-17.7":0.06269,"18.0":0.01412,"18.1":0.02937,"18.2":0.01553,"18.3":0.05055,"18.4":0.02598,"18.5-18.7":1.86541,"26.0":0.03643,"26.1":0.30299,"26.2":0.05761,"26.3":0.00254},P:{"4":0.13123,"25":0.01009,"27":0.01009,"28":0.02019,"29":1.39304,_:"20 21 22 23 24 26 5.0-5.4 8.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","6.2-6.4":0.01009,"7.2-7.4":0.01009,"9.2":0.02019},I:{"0":0.03428,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00003},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0.7453,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{"2.5":0.02575,_:"3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.02575},H:{"0":0.01},L:{"0":84.24116},R:{_:"0"},M:{"0":0.04292}};
@@ -0,0 +1,65 @@
import { canAccessAdmin } from 'payload';
export const schedulePublishHandler = async ({
type,
date,
deleteID,
doc,
global,
localeToPublish,
req,
timezone
}) => {
const {
i18n,
payload,
user
} = req;
await canAccessAdmin({
req
});
try {
if (deleteID) {
await payload.delete({
collection: 'payload-jobs',
req,
where: {
id: {
equals: deleteID
}
}
});
}
await payload.jobs.queue({
input: {
type,
doc,
global,
locale: localeToPublish,
timezone,
user: user.id
},
task: 'schedulePublish',
waitUntil: date
});
} catch (err) {
let error;
if (deleteID) {
error = `Error deleting scheduled publish event with ID ${deleteID}`;
} else {
error = `Error scheduling ${type} for `;
if (doc) {
error += `document with ID ${doc.value} in collection ${doc.relationTo}`;
}
}
payload.logger.error({
err
}, error);
return {
error
};
}
return {
message: i18n.t('general:success')
};
};
//# sourceMappingURL=schedulePublishHandler.js.map
@@ -0,0 +1,14 @@
import type {CodeKeywordDefinition} from "../../types"
import {dynamicAnchor} from "./dynamicAnchor"
import {checkStrictMode} from "../../compile/util"
const def: CodeKeywordDefinition = {
keyword: "$recursiveAnchor",
schemaType: "boolean",
code(cxt) {
if (cxt.schema) dynamicAnchor(cxt, "")
else checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored")
},
}
export default def
@@ -0,0 +1 @@
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/globals/endpoints/update.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAS3D,eAAO,MAAM,aAAa,EAAE,cA+C3B,CAAA"}
@@ -0,0 +1,23 @@
"use strict";
// file for microbenchmarking
Object.defineProperty(exports, "__esModule", { value: true });
const buffer_reader_1 = require("./buffer-reader");
const LOOPS = 1000;
let count = 0;
const start = performance.now();
const reader = new buffer_reader_1.BufferReader();
const buffer = Buffer.from([33, 33, 33, 33, 33, 33, 33, 0]);
const run = () => {
if (count > LOOPS) {
console.log(performance.now() - start);
return;
}
count++;
for (let i = 0; i < LOOPS; i++) {
reader.setBuffer(0, buffer);
reader.cstring();
}
setImmediate(run);
};
run();
//# sourceMappingURL=b.js.map
@@ -0,0 +1,52 @@
import type { RoundingOptions } from "./types.js";
/**
* The {@link differenceInWeeks} function options.
*/
export interface DifferenceInWeeksOptions extends RoundingOptions {}
/**
* @name differenceInWeeks
* @category Week Helpers
* @summary Get the number of full weeks between the given dates.
*
* @description
* Get the number of full weeks between two dates. Fractional weeks are
* truncated towards zero by default.
*
* One "full week" is the distance between a local time in one day to the same
* local time 7 days earlier or later. A full week can sometimes be less than
* or more than 7*24 hours if a daylight savings change happens between two dates.
*
* To ignore DST and only measure exact 7*24-hour periods, use this instead:
* `Math.trunc(differenceInHours(dateLeft, dateRight)/(7*24))|0`.
*
* @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 dateLeft - The later date
* @param dateRight - The earlier date
* @param options - An object with options
*
* @returns The number of full weeks
*
* @example
* // How many full weeks are between 5 July 2014 and 20 July 2014?
* const result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5))
* //=> 2
*
* @example
* // How many full weeks are between
* // 1 March 2020 0:00 and 6 June 2020 0:00 ?
* // Note: because local time is used, the
* // result will always be 8 weeks (54 days),
* // even if DST starts and the period has
* // only 54*24-1 hours.
* const result = differenceInWeeks(
* new Date(2020, 5, 1),
* new Date(2020, 2, 6)
* )
* //=> 8
*/
export declare function differenceInWeeks<DateType extends Date>(
dateLeft: DateType | number | string,
dateRight: DateType | number | string,
options?: DifferenceInWeeksOptions,
): number;
@@ -0,0 +1 @@
{"version":3,"file":"migrationTemplate.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/migrationTemplate.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,6SAa7B,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"x-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"appendPrefixToKeys.d.ts","sourceRoot":"","sources":["../../src/utilities/appendPrefixToKeys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,GAAI,CAAC,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,MAAM,KAAG,CAI9E,CAAA"}
@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { getISOWeekYear as fn } from "../getISOWeekYear.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const getISOWeekYear = convertToFP(fn, 1);
// Fallback for modularized imports:
export default getISOWeekYear;
@@ -0,0 +1,12 @@
import type { Access, AccessResult } from '../config/types.js';
import type { PayloadRequest } from '../types/index.js';
type OperationArgs = {
data?: any;
disableErrors?: boolean;
id?: number | string;
isReadingStaticFile?: boolean;
req: PayloadRequest;
};
export declare const executeAccess: ({ id, data, disableErrors, isReadingStaticFile, req }: OperationArgs, access: Access) => Promise<AccessResult>;
export {};
//# sourceMappingURL=executeAccess.d.ts.map
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('fromPairs', require('../fromPairs'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,131 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["o.Kr.", "m.Kr."],
abbreviated: ["o.Kr.", "m.Kr."],
wide: ["ovdal Kristusa", "maŋŋel Kristusa"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. kvartála", "2. kvartála", "3. kvartála", "4. kvartála"],
};
const monthValues = {
narrow: ["O", "G", "N", "C", "M", "G", "S", "B", "Č", "G", "S", "J"],
abbreviated: [
"ođđa",
"guov",
"njuk",
"cuo",
"mies",
"geas",
"suoi",
"borg",
"čakč",
"golg",
"skáb",
"juov",
],
wide: [
"ođđajagemánnu",
"guovvamánnu",
"njukčamánnu",
"cuoŋománnu",
"miessemánnu",
"geassemánnu",
"suoidnemánnu",
"borgemánnu",
"čakčamánnu",
"golggotmánnu",
"skábmamánnu",
"juovlamánnu",
],
};
const dayValues = {
narrow: ["S", "V", "M", "G", "D", "B", "L"],
short: ["sotn", "vuos", "maŋ", "gask", "duor", "bear", "láv"],
abbreviated: ["sotn", "vuos", "maŋ", "gask", "duor", "bear", "láv"],
wide: [
"sotnabeaivi",
"vuossárga",
"maŋŋebárga",
"gaskavahkku",
"duorastat",
"bearjadat",
"lávvardat",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "gaskaidja",
noon: "gaskabeaivi",
morning: "iđđes",
afternoon: "maŋŋel gaska.",
evening: "eahkes",
night: "ihkku",
},
abbreviated: {
am: "a.m.",
pm: "p.m.",
midnight: "gaskaidja",
noon: "gaskabeaivvi",
morning: "iđđes",
afternoon: "maŋŋel gaskabea.",
evening: "eahkes",
night: "ihkku",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "gaskaidja",
noon: "gaskabeavvi",
morning: "iđđes",
afternoon: "maŋŋel gaskabeaivvi",
evening: "eahkes",
night: "ihkku",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
}),
});
@@ -0,0 +1,5 @@
import { APIError } from './APIError.js';
export declare class DuplicateFieldName extends APIError {
constructor(fieldName: string);
}
//# sourceMappingURL=DuplicateFieldName.d.ts.map
@@ -0,0 +1 @@
Prism.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^\\'\r\n])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^\\'\r\n])+'/,alias:"atom"},boolean:/\b(?:false|true)\b/,keyword:/\b(?:after|begin|case|catch|end|fun|if|of|receive|try|when)\b/,number:[/\$\\?./,/\b\d+#[a-z0-9]+/i,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i],function:/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/};
@@ -0,0 +1,586 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const browserUtils = require('@sentry-internal/browser-utils');
const debugBuild = require('../debug-build.js');
const helpers = require('../helpers.js');
const backgroundtab = require('./backgroundtab.js');
const linkedTraces = require('./linkedTraces.js');
const request = require('./request.js');
const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';
const DEFAULT_BROWSER_TRACING_OPTIONS = {
...core.TRACING_DEFAULTS,
instrumentNavigation: true,
instrumentPageLoad: true,
markBackgroundSpan: true,
enableLongTask: true,
enableLongAnimationFrame: true,
enableInp: true,
enableElementTiming: true,
ignoreResourceSpans: [],
ignorePerformanceApiSpans: [],
detectRedirects: true,
linkPreviousTrace: 'in-memory',
consistentTraceSampling: false,
enableReportPageLoaded: false,
_experiments: {},
...request.defaultRequestInstrumentationOptions,
};
/**
* The Browser Tracing integration automatically instruments browser pageload/navigation
* actions as transactions, and captures requests, metrics and errors as spans.
*
* The integration can be configured with a variety of options, and can be extended to use
* any routing library.
*
* We explicitly export the proper type here, as this has to be extended in some cases.
*/
const browserTracingIntegration = ((options = {}) => {
const latestRoute = {
name: undefined,
source: undefined,
};
/**
* This is just a small wrapper that makes `document` optional.
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
*/
const optionalWindowDocument = helpers.WINDOW.document ;
const {
enableInp,
enableElementTiming,
enableLongTask,
enableLongAnimationFrame,
_experiments: { enableInteractions, enableStandaloneClsSpans, enableStandaloneLcpSpans },
beforeStartSpan,
idleTimeout,
finalTimeout,
childSpanTimeout,
markBackgroundSpan,
traceFetch,
traceXHR,
trackFetchStreamPerformance,
shouldCreateSpanForRequest,
enableHTTPTimings,
ignoreResourceSpans,
ignorePerformanceApiSpans,
instrumentPageLoad,
instrumentNavigation,
detectRedirects,
linkPreviousTrace,
consistentTraceSampling,
enableReportPageLoaded,
onRequestSpanStart,
onRequestSpanEnd,
} = {
...DEFAULT_BROWSER_TRACING_OPTIONS,
...options,
};
let _collectWebVitals;
let lastInteractionTimestamp;
let _pageloadSpan;
/** Create routing idle transaction. */
function _createRouteSpan(client, startSpanOptions, makeActive = true) {
const isPageloadSpan = startSpanOptions.op === 'pageload';
const initialSpanName = startSpanOptions.name;
const finalStartSpanOptions = beforeStartSpan
? beforeStartSpan(startSpanOptions)
: startSpanOptions;
const attributes = finalStartSpanOptions.attributes || {};
// If `finalStartSpanOptions.name` is different than `startSpanOptions.name`
// it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'.
if (initialSpanName !== finalStartSpanOptions.name) {
attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'custom';
finalStartSpanOptions.attributes = attributes;
}
if (!makeActive) {
// We want to ensure this has 0s duration
const now = core.dateTimestampInSeconds();
core.startInactiveSpan({
...finalStartSpanOptions,
startTime: now,
}).end(now);
return;
}
latestRoute.name = finalStartSpanOptions.name;
latestRoute.source = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
const idleSpan = core.startIdleSpan(finalStartSpanOptions, {
idleTimeout,
finalTimeout,
childSpanTimeout,
// should wait for finish signal if it's a pageload transaction
disableAutoFinish: isPageloadSpan,
beforeSpanEnd: span => {
// This will generally always be defined here, because it is set in `setup()` of the integration
// but technically, it is optional, so we guard here to be extra safe
_collectWebVitals?.();
browserUtils.addPerformanceEntries(span, {
recordClsOnPageloadSpan: !enableStandaloneClsSpans,
recordLcpOnPageloadSpan: !enableStandaloneLcpSpans,
ignoreResourceSpans,
ignorePerformanceApiSpans,
});
setActiveIdleSpan(client, undefined);
// A trace should stay consistent over the entire timespan of one route - even after the pageload/navigation ended.
// Only when another navigation happens, we want to create a new trace.
// This way, e.g. errors that occur after the pageload span ended are still associated to the pageload trace.
const scope = core.getCurrentScope();
const oldPropagationContext = scope.getPropagationContext();
scope.setPropagationContext({
...oldPropagationContext,
traceId: idleSpan.spanContext().traceId,
sampled: core.spanIsSampled(idleSpan),
dsc: core.getDynamicSamplingContextFromSpan(span),
});
if (isPageloadSpan) {
// clean up the stored pageload span on the intergration.
_pageloadSpan = undefined;
}
},
trimIdleSpanEndTimestamp: !enableReportPageLoaded,
});
if (isPageloadSpan && enableReportPageLoaded) {
_pageloadSpan = idleSpan;
}
setActiveIdleSpan(client, idleSpan);
function emitFinish() {
if (optionalWindowDocument && ['interactive', 'complete'].includes(optionalWindowDocument.readyState)) {
client.emit('idleSpanEnableAutoFinish', idleSpan);
}
}
// Enable auto finish of the pageload span if users are not explicitly ending it
if (isPageloadSpan && !enableReportPageLoaded && optionalWindowDocument) {
optionalWindowDocument.addEventListener('readystatechange', () => {
emitFinish();
});
emitFinish();
}
}
return {
name: BROWSER_TRACING_INTEGRATION_ID,
setup(client) {
core.registerSpanErrorInstrumentation();
_collectWebVitals = browserUtils.startTrackingWebVitals({
recordClsStandaloneSpans: enableStandaloneClsSpans || false,
recordLcpStandaloneSpans: enableStandaloneLcpSpans || false,
client,
});
if (enableInp) {
browserUtils.startTrackingINP();
}
if (enableElementTiming) {
browserUtils.startTrackingElementTiming();
}
if (
enableLongAnimationFrame &&
core.GLOBAL_OBJ.PerformanceObserver &&
PerformanceObserver.supportedEntryTypes &&
PerformanceObserver.supportedEntryTypes.includes('long-animation-frame')
) {
browserUtils.startTrackingLongAnimationFrames();
} else if (enableLongTask) {
browserUtils.startTrackingLongTasks();
}
if (enableInteractions) {
browserUtils.startTrackingInteractions();
}
if (detectRedirects && optionalWindowDocument) {
const interactionHandler = () => {
lastInteractionTimestamp = core.timestampInSeconds();
};
addEventListener('click', interactionHandler, { capture: true });
addEventListener('keydown', interactionHandler, { capture: true, passive: true });
}
function maybeEndActiveSpan() {
const activeSpan = getActiveIdleSpan(client);
if (activeSpan && !core.spanToJSON(activeSpan).timestamp) {
debugBuild.DEBUG_BUILD && core.debug.log(`[Tracing] Finishing current active span with op: ${core.spanToJSON(activeSpan).op}`);
// If there's an open active span, we need to finish it before creating an new one.
activeSpan.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'cancelled');
activeSpan.end();
}
}
client.on('startNavigationSpan', (startSpanOptions, navigationOptions) => {
if (core.getClient() !== client) {
return;
}
if (navigationOptions?.isRedirect) {
debugBuild.DEBUG_BUILD &&
core.debug.warn('[Tracing] Detected redirect, navigation span will not be the root span, but a child span.');
_createRouteSpan(
client,
{
op: 'navigation.redirect',
...startSpanOptions,
},
false,
);
return;
}
// Reset the last interaction timestamp since we now start a new navigation.
// Any subsequent navigation span starts could again be a redirect, so we
// should reset our heuristic detectors.
lastInteractionTimestamp = undefined;
maybeEndActiveSpan();
core.getIsolationScope().setPropagationContext({
traceId: core.generateTraceId(),
sampleRand: Math.random(),
propagationSpanId: core.hasSpansEnabled() ? undefined : core.generateSpanId(),
});
const scope = core.getCurrentScope();
scope.setPropagationContext({
traceId: core.generateTraceId(),
sampleRand: Math.random(),
propagationSpanId: core.hasSpansEnabled() ? undefined : core.generateSpanId(),
});
// We reset this to ensure we do not have lingering incorrect data here
// places that call this hook may set this where appropriate - else, the URL at span sending time is used
scope.setSDKProcessingMetadata({
normalizedRequest: undefined,
});
_createRouteSpan(client, {
op: 'navigation',
...startSpanOptions,
// Navigation starts a new trace and is NOT parented under any active interaction (e.g. ui.action.click)
parentSpan: null,
forceTransaction: true,
});
});
client.on('startPageLoadSpan', (startSpanOptions, traceOptions = {}) => {
if (core.getClient() !== client) {
return;
}
maybeEndActiveSpan();
const sentryTrace =
traceOptions.sentryTrace || getMetaContent('sentry-trace') || getServerTiming('sentry-trace');
const baggage = traceOptions.baggage || getMetaContent('baggage') || getServerTiming('baggage');
const propagationContext = core.propagationContextFromHeaders(sentryTrace, baggage);
const scope = core.getCurrentScope();
scope.setPropagationContext(propagationContext);
if (!core.hasSpansEnabled()) {
// for browser, we wanna keep the spanIds consistent during the entire lifetime of the trace
// this works by setting the propagationSpanId to a random spanId so that we have a consistent
// span id to propagate in TwP mode (!hasSpansEnabled())
scope.getPropagationContext().propagationSpanId = core.generateSpanId();
}
// We store the normalized request data on the scope, so we get the request data at time of span creation
// otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL
scope.setSDKProcessingMetadata({
normalizedRequest: helpers.getHttpRequestData(),
});
_createRouteSpan(client, {
op: 'pageload',
...startSpanOptions,
});
});
client.on('endPageloadSpan', () => {
if (enableReportPageLoaded && _pageloadSpan) {
_pageloadSpan.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'reportPageLoaded');
_pageloadSpan.end();
}
});
},
afterAllSetup(client) {
let startingUrl = core.getLocationHref();
if (linkPreviousTrace !== 'off') {
linkedTraces.linkTraces(client, { linkPreviousTrace, consistentTraceSampling });
}
if (helpers.WINDOW.location) {
if (instrumentPageLoad) {
const origin = core.browserPerformanceTimeOrigin();
startBrowserTracingPageLoadSpan(client, {
name: helpers.WINDOW.location.pathname,
// pageload should always start at timeOrigin (and needs to be in s, not ms)
startTime: origin ? origin / 1000 : undefined,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
},
});
}
if (instrumentNavigation) {
browserUtils.addHistoryInstrumentationHandler(({ to, from }) => {
/**
* This early return is there to account for some cases where a navigation transaction starts right after
* long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't
* create an uneccessary navigation transaction.
*
* This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also
* only be caused in certain development environments where the usage of a hot module reloader is causing
* errors.
*/
if (from === undefined && startingUrl?.indexOf(to) !== -1) {
startingUrl = undefined;
return;
}
startingUrl = undefined;
const parsed = core.parseStringToURLObject(to);
const activeSpan = getActiveIdleSpan(client);
const navigationIsRedirect =
activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);
startBrowserTracingNavigationSpan(
client,
{
name: parsed?.pathname || helpers.WINDOW.location.pathname,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
},
},
{ url: to, isRedirect: navigationIsRedirect },
);
});
}
}
if (markBackgroundSpan) {
backgroundtab.registerBackgroundTabDetection();
}
if (enableInteractions) {
registerInteractionListener(client, idleTimeout, finalTimeout, childSpanTimeout, latestRoute);
}
if (enableInp) {
browserUtils.registerInpInteractionListener();
}
request.instrumentOutgoingRequests(client, {
traceFetch,
traceXHR,
trackFetchStreamPerformance,
tracePropagationTargets: client.getOptions().tracePropagationTargets,
shouldCreateSpanForRequest,
enableHTTPTimings,
onRequestSpanStart,
onRequestSpanEnd,
});
},
};
}) ;
/**
* Manually start a page load span.
* This will only do something if a browser tracing integration integration has been setup.
*
* If you provide a custom `traceOptions` object, it will be used to continue the trace
* instead of the default behavior, which is to look it up on the <meta> tags.
*/
function startBrowserTracingPageLoadSpan(
client,
spanOptions,
traceOptions,
) {
client.emit('startPageLoadSpan', spanOptions, traceOptions);
core.getCurrentScope().setTransactionName(spanOptions.name);
const pageloadSpan = getActiveIdleSpan(client);
if (pageloadSpan) {
client.emit('afterStartPageLoadSpan', pageloadSpan);
}
return pageloadSpan;
}
/**
* Manually start a navigation span.
* This will only do something if a browser tracing integration has been setup.
*/
function startBrowserTracingNavigationSpan(
client,
spanOptions,
options,
) {
const { url, isRedirect } = options || {};
client.emit('beforeStartNavigationSpan', spanOptions, { isRedirect });
client.emit('startNavigationSpan', spanOptions, { isRedirect });
const scope = core.getCurrentScope();
scope.setTransactionName(spanOptions.name);
// We store the normalized request data on the scope, so we get the request data at time of span creation
// otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL
if (url && !isRedirect) {
scope.setSDKProcessingMetadata({
normalizedRequest: {
...helpers.getHttpRequestData(),
url,
},
});
}
return getActiveIdleSpan(client);
}
/** Returns the value of a meta tag */
function getMetaContent(metaName) {
/**
* This is just a small wrapper that makes `document` optional.
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
*/
const optionalWindowDocument = helpers.WINDOW.document ;
const metaTag = optionalWindowDocument?.querySelector(`meta[name=${metaName}]`);
return metaTag?.getAttribute('content') || undefined;
}
/** Returns the description of a server timing entry */
function getServerTiming(name) {
const navigation = helpers.WINDOW.performance?.getEntriesByType?.('navigation')[0] ;
const entry = navigation?.serverTiming?.find(entry => entry.name === name);
return entry?.description;
}
/** Start listener for interaction transactions */
function registerInteractionListener(
client,
idleTimeout,
finalTimeout,
childSpanTimeout,
latestRoute,
) {
/**
* This is just a small wrapper that makes `document` optional.
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
*/
const optionalWindowDocument = helpers.WINDOW.document ;
let inflightInteractionSpan;
const registerInteractionTransaction = () => {
const op = 'ui.action.click';
const activeIdleSpan = getActiveIdleSpan(client);
if (activeIdleSpan) {
const currentRootSpanOp = core.spanToJSON(activeIdleSpan).op;
if (['navigation', 'pageload'].includes(currentRootSpanOp )) {
debugBuild.DEBUG_BUILD &&
core.debug.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`);
return undefined;
}
}
if (inflightInteractionSpan) {
inflightInteractionSpan.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'interactionInterrupted');
inflightInteractionSpan.end();
inflightInteractionSpan = undefined;
}
if (!latestRoute.name) {
debugBuild.DEBUG_BUILD && core.debug.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);
return undefined;
}
inflightInteractionSpan = core.startIdleSpan(
{
name: latestRoute.name,
op,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || 'url',
},
},
{
idleTimeout,
finalTimeout,
childSpanTimeout,
},
);
};
if (optionalWindowDocument) {
addEventListener('click', registerInteractionTransaction, { capture: true });
}
}
// We store the active idle span on the client object, so we can access it from exported functions
const ACTIVE_IDLE_SPAN_PROPERTY = '_sentry_idleSpan';
function getActiveIdleSpan(client) {
return (client )[ACTIVE_IDLE_SPAN_PROPERTY];
}
function setActiveIdleSpan(client, span) {
core.addNonEnumerableProperty(client, ACTIVE_IDLE_SPAN_PROPERTY, span);
}
// The max. time in seconds between two pageload/navigation spans that makes us consider the second one a redirect
const REDIRECT_THRESHOLD = 1.5;
function isRedirect(activeSpan, lastInteractionTimestamp) {
const spanData = core.spanToJSON(activeSpan);
const now = core.dateTimestampInSeconds();
// More than REDIRECT_THRESHOLD seconds since last navigation/pageload span?
// --> never consider this a redirect
const startTimestamp = spanData.start_timestamp;
if (now - startTimestamp > REDIRECT_THRESHOLD) {
return false;
}
// A click happened in the last REDIRECT_THRESHOLD seconds?
// --> never consider this a redirect
if (lastInteractionTimestamp && now - lastInteractionTimestamp <= REDIRECT_THRESHOLD) {
return false;
}
return true;
}
exports.BROWSER_TRACING_INTEGRATION_ID = BROWSER_TRACING_INTEGRATION_ID;
exports.browserTracingIntegration = browserTracingIntegration;
exports.getMetaContent = getMetaContent;
exports.getServerTiming = getServerTiming;
exports.startBrowserTracingNavigationSpan = startBrowserTracingNavigationSpan;
exports.startBrowserTracingPageLoadSpan = startBrowserTracingPageLoadSpan;
//# sourceMappingURL=browserTracingIntegration.js.map
@@ -0,0 +1,232 @@
export { default as loader } from '@monaco-editor/loader';
import * as react from 'react';
import { ReactNode } from 'react';
import * as monaco_editor from 'monaco-editor';
import { editor } from 'monaco-editor';
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
type MonacoDiffEditor = editor.IStandaloneDiffEditor;
type DiffOnMount = (editor: MonacoDiffEditor, monaco: Monaco) => void;
type DiffBeforeMount = (monaco: Monaco) => void;
type DiffEditorProps = {
/**
* The original source (left one) value
*/
original?: string;
/**
* The modified source (right one) value
*/
modified?: string;
/**
* Language for the both models - original and modified
*/
language?: string;
/**
* This prop gives you the opportunity to specify the language of the
* original source separately, otherwise, it will get the value of the language property
*/
originalLanguage?: string;
/**
* This prop gives you the opportunity to specify the language of the
* modified source separately, otherwise, it will get the value of language property
*/
modifiedLanguage?: string;
/**
* Path for the "original" model
* Will be passed as a third argument to `.createModel` method
* `monaco.editor.createModel(..., ..., monaco.Uri.parse(originalModelPath))`
*/
originalModelPath?: string;
/**
* Path for the "modified" model
* Will be passed as a third argument to `.createModel` method
* `monaco.editor.createModel(..., ..., monaco.Uri.parse(modifiedModelPath))`
*/
modifiedModelPath?: string;
/**
* Indicator whether to dispose the current original model when the DiffEditor is unmounted or not
* @default false
*/
keepCurrentOriginalModel?: boolean;
/**
* Indicator whether to dispose the current modified model when the DiffEditor is unmounted or not
* @default false
*/
keepCurrentModifiedModel?: boolean;
/**
* The theme for the monaco
* Available options "vs-dark" | "light"
* Define new themes by `monaco.editor.defineTheme`
* @default "light"
*/
theme?: Theme | string;
/**
* The loading screen before the editor will be mounted
* @default "loading..."
*/
loading?: ReactNode;
/**
* IDiffEditorConstructionOptions
*/
options?: editor.IDiffEditorConstructionOptions;
/**
* Width of the editor wrapper
* @default "100%"
*/
width?: number | string;
/**
* Height of the editor wrapper
* @default "100%"
*/
height?: number | string;
/**
* Class name for the editor container
*/
className?: string;
/**
* Props applied to the wrapper element
*/
wrapperProps?: object;
/**
* Signature: function(monaco: Monaco) => void
* An event is emitted before the editor is mounted
* It gets the monaco instance as a first argument
* Defaults to "noop"
*/
beforeMount?: DiffBeforeMount;
/**
* Signature: function(editor: monaco.editor.IStandaloneCodeEditor, monaco: Monaco) => void
* An event is emitted when the editor is mounted
* It gets the editor instance as a first argument and the monaco instance as a second
* Defaults to "noop"
*/
onMount?: DiffOnMount;
};
declare function DiffEditor({ original, modified, language, originalLanguage, modifiedLanguage, originalModelPath, modifiedModelPath, keepCurrentOriginalModel, keepCurrentModifiedModel, theme, loading, options, height, width, className, wrapperProps, beforeMount, onMount, }: DiffEditorProps): JSX.Element;
declare const _default$1: react.MemoExoticComponent<typeof DiffEditor>;
declare function useMonaco(): typeof monaco_editor | null;
type OnMount = (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void;
type BeforeMount = (monaco: Monaco) => void;
type OnChange = (value: string | undefined, ev: editor.IModelContentChangedEvent) => void;
type OnValidate = (markers: editor.IMarker[]) => void;
type EditorProps = {
/**
* Default value of the current model
*/
defaultValue?: string;
/**
* Default language of the current model
*/
defaultLanguage?: string;
/**
* Default path of the current model
* Will be passed as the third argument to `.createModel` method
* `monaco.editor.createModel(..., ..., monaco.Uri.parse(defaultPath))`
*/
defaultPath?: string;
/**
* Value of the current model
*/
value?: string;
/**
* Language of the current model
*/
language?: string;
/**
* Path of the current model
* Will be passed as the third argument to `.createModel` method
* `monaco.editor.createModel(..., ..., monaco.Uri.parse(defaultPath))`
*/
path?: string;
/**
* The theme for the monaco
* Available options "vs-dark" | "light"
* Define new themes by `monaco.editor.defineTheme`
* @default "light"
*/
theme?: Theme | string;
/**
* The line to jump on it
*/
line?: number;
/**
* The loading screen before the editor will be mounted
* @default "Loading..."
*/
loading?: ReactNode;
/**
* IStandaloneEditorConstructionOptions
*/
options?: editor.IStandaloneEditorConstructionOptions;
/**
* IEditorOverrideServices
*/
overrideServices?: editor.IEditorOverrideServices;
/**
* Indicator whether to save the models' view states between model changes or not
* Defaults to true
*/
saveViewState?: boolean;
/**
* Indicator whether to dispose the current model when the Editor is unmounted or not
* @default false
*/
keepCurrentModel?: boolean;
/**
* Width of the editor wrapper
* @default "100%"
*/
width?: number | string;
/**
* Height of the editor wrapper
* @default "100%"
*/
height?: number | string;
/**
* Class name for the editor container
*/
className?: string;
/**
* Props applied to the wrapper element
*/
wrapperProps?: object;
/**
* Signature: function(monaco: Monaco) => void
* An event is emitted before the editor is mounted
* It gets the monaco instance as a first argument
* Defaults to "noop"
*/
beforeMount?: BeforeMount;
/**
* Signature: function(editor: monaco.editor.IStandaloneCodeEditor, monaco: Monaco) => void
* An event is emitted when the editor is mounted
* It gets the editor instance as a first argument and the monaco instance as a second
* Defaults to "noop"
*/
onMount?: OnMount;
/**
* Signature: function(value: string | undefined, ev: monaco.editor.IModelContentChangedEvent) => void
* An event is emitted when the content of the current model is changed
*/
onChange?: OnChange;
/**
* Signature: function(markers: monaco.editor.IMarker[]) => void
* An event is emitted when the content of the current model is changed
* and the current model markers are ready
* Defaults to "noop"
*/
onValidate?: OnValidate;
};
declare function Editor({ defaultValue, defaultLanguage, defaultPath, value, language, path, theme, line, loading, options, overrideServices, saveViewState, keepCurrentModel, width, height, className, wrapperProps, beforeMount, onMount, onChange, onValidate, }: EditorProps): JSX.Element;
declare const _default: react.MemoExoticComponent<typeof Editor>;
type Monaco = typeof monaco;
type Theme = 'vs-dark' | 'light';
export { BeforeMount, DiffBeforeMount, _default$1 as DiffEditor, DiffEditorProps, DiffOnMount, _default as Editor, EditorProps, Monaco, MonacoDiffEditor, OnChange, OnMount, OnValidate, Theme, _default as default, useMonaco };
@@ -0,0 +1,4 @@
/**
* TypeScript type definitions for @sentry/cli
*/
export {};
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["default","payloadFavicon","payloadFaviconDark","payloadFaviconLight","staticOGImage"],"sources":["../../src/assets/index.ts"],"sourcesContent":["export { default as payloadFavicon } from './payload-favicon.svg'\nexport { default as payloadFaviconDark } from './payload-favicon-dark.png'\nexport { default as payloadFaviconLight } from './payload-favicon-light.png'\nexport { default as staticOGImage } from './static-og-image.png'\n"],"mappings":"AAAA,SAASA,OAAA,IAAWC,cAAc,QAAQ;AAC1C,SAASD,OAAA,IAAWE,kBAAkB,QAAQ;AAC9C,SAASF,OAAA,IAAWG,mBAAmB,QAAQ;AAC/C,SAASH,OAAA,IAAWI,aAAa,QAAQ","ignoreList":[]}
@@ -0,0 +1,12 @@
/**
* Very simple, but fast deepMerge implementation. Only deepMerges objects, not arrays and clones everything.
* Do not use this if your object contains any complex objects like React Components, or if you would like to combine Arrays.
* If you only have simple objects and need a fast deepMerge, this is the function for you.
*
* obj2 takes precedence over obj1 - thus if obj2 has a key that obj1 also has, obj2's value will be used.
*
* @param obj1 base object
* @param obj2 object to merge "into" obj1
*/
export declare function deepMergeSimple<T = object>(obj1: object, obj2: object): T;
//# sourceMappingURL=deepMergeSimple.d.ts.map
@@ -0,0 +1,46 @@
import type { ContextOptions, DateArg, ISOFormatOptions } from "./types.js";
/**
* The {@link formatISO} function options.
*/
export interface FormatISOOptions
extends ISOFormatOptions,
ContextOptions<Date> {}
/**
* @name formatISO
* @category Common Helpers
* @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).
*
* @description
* Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.
*
* @param date - The original date
* @param options - An object with options.
*
* @returns The formatted date string (in local time zone)
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):
* const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))
* //=> '2019-09-18T19:00:52Z'
*
* @example
* // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):
* const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })
* //=> '20190918T190052'
*
* @example
* // Represent 18 September 2019 in ISO 8601 format, date only:
* const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })
* //=> '2019-09-18'
*
* @example
* // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):
* const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })
* //=> '19:00:52Z'
*/
export declare function formatISO(
date: DateArg<Date> & {},
options?: FormatISOOptions,
): string;
@@ -0,0 +1,14 @@
import type { ClientComponentProps, ClientField, SanitizedFieldPermissions } from 'payload';
export type RenderFieldsProps = {
readonly className?: string;
readonly fields: ClientField[];
readonly margins?: 'small' | false;
readonly parentIndexPath: string;
readonly parentPath: string;
readonly parentSchemaPath: string;
readonly permissions: {
[fieldName: string]: SanitizedFieldPermissions;
} | SanitizedFieldPermissions;
readonly readOnly?: boolean;
} & Pick<ClientComponentProps, 'forceRender'>;
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,52 @@
{
"name": "pg-connection-string",
"version": "2.11.0",
"description": "Functions for dealing with a PostgresSQL connection string",
"main": "./index.js",
"types": "./index.d.ts",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./esm/index.mjs",
"require": "./index.js",
"default": "./index.js"
}
},
"scripts": {
"test": "nyc --reporter=lcov mocha && npm run check-coverage",
"check-coverage": "nyc check-coverage --statements 100 --branches 100 --lines 100 --functions 100"
},
"repository": {
"type": "git",
"url": "git://github.com/brianc/node-postgres.git",
"directory": "packages/pg-connection-string"
},
"keywords": [
"pg",
"connection",
"string",
"parse"
],
"author": "Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/brianc/node-postgres/issues"
},
"homepage": "https://github.com/brianc/node-postgres/tree/master/packages/pg-connection-string",
"devDependencies": {
"@types/pg": "^8.12.0",
"chai": "^4.1.1",
"coveralls": "^3.0.4",
"istanbul": "^0.4.5",
"mocha": "^10.5.2",
"nyc": "^15",
"tsx": "^4.19.4",
"typescript": "^4.0.3"
},
"files": [
"index.js",
"index.d.ts",
"esm"
],
"gitHead": "fc4de3c62ad350d0e1b392a0d132aff906d1cec6"
}
@@ -0,0 +1,48 @@
import { entityKind } from "../entity.cjs";
import type { AnyGelColumn, GelColumn } from "./columns/index.cjs";
import type { GelTable } from "./table.cjs";
export type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default';
export type Reference = () => {
readonly name?: string;
readonly columns: GelColumn[];
readonly foreignTable: GelTable;
readonly foreignColumns: GelColumn[];
};
export declare class ForeignKeyBuilder {
static readonly [entityKind]: string;
constructor(config: () => {
name?: string;
columns: GelColumn[];
foreignColumns: GelColumn[];
}, actions?: {
onUpdate?: UpdateDeleteAction;
onDelete?: UpdateDeleteAction;
} | undefined);
onUpdate(action: UpdateDeleteAction): this;
onDelete(action: UpdateDeleteAction): this;
}
export type AnyForeignKeyBuilder = ForeignKeyBuilder;
export declare class ForeignKey {
readonly table: GelTable;
static readonly [entityKind]: string;
readonly reference: Reference;
readonly onUpdate: UpdateDeleteAction | undefined;
readonly onDelete: UpdateDeleteAction | undefined;
constructor(table: GelTable, builder: ForeignKeyBuilder);
getName(): string;
}
type ColumnsWithTable<TTableName extends string, TColumns extends GelColumn[]> = {
[Key in keyof TColumns]: AnyGelColumn<{
tableName: TTableName;
}>;
};
export declare function foreignKey<TTableName extends string, TForeignTableName extends string, TColumns extends [AnyGelColumn<{
tableName: TTableName;
}>, ...AnyGelColumn<{
tableName: TTableName;
}>[]]>(config: {
name?: string;
columns: TColumns;
foreignColumns: ColumnsWithTable<TForeignTableName, TColumns>;
}): ForeignKeyBuilder;
export {};
@@ -0,0 +1,34 @@
import { parseBaggageHeader, objectToBaggageHeader } from '@sentry/core';
/**
* Merge two baggage headers into one, where the existing one takes precedence.
* The order of the existing baggage will be preserved, and new entries will be added to the end.
*/
function mergeBaggageHeaders(
existing,
baggage,
) {
if (!existing) {
return baggage;
}
const existingBaggageEntries = parseBaggageHeader(existing);
const newBaggageEntries = parseBaggageHeader(baggage);
if (!newBaggageEntries) {
return existing;
}
// Existing entries take precedence, ensuring order remains stable for minimal changes
const mergedBaggageEntries = { ...existingBaggageEntries };
Object.entries(newBaggageEntries).forEach(([key, value]) => {
if (!mergedBaggageEntries[key]) {
mergedBaggageEntries[key] = value;
}
});
return objectToBaggageHeader(mergedBaggageEntries);
}
export { mergeBaggageHeaders };
//# sourceMappingURL=baggage.js.map
@@ -0,0 +1,77 @@
"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 refresh_materialized_view_exports = {};
__export(refresh_materialized_view_exports, {
GelRefreshMaterializedView: () => GelRefreshMaterializedView
});
module.exports = __toCommonJS(refresh_materialized_view_exports);
var import_entity = require("../../entity.cjs");
var import_query_promise = require("../../query-promise.cjs");
var import_tracing = require("../../tracing.cjs");
class GelRefreshMaterializedView extends import_query_promise.QueryPromise {
constructor(view, session, dialect) {
super();
this.session = session;
this.dialect = dialect;
this.config = { view };
}
static [import_entity.entityKind] = "GelRefreshMaterializedView";
config;
concurrently() {
if (this.config.withNoData !== void 0) {
throw new Error("Cannot use concurrently and withNoData together");
}
this.config.concurrently = true;
return this;
}
withNoData() {
if (this.config.concurrently !== void 0) {
throw new Error("Cannot use concurrently and withNoData together");
}
this.config.withNoData = true;
return this;
}
/** @internal */
getSQL() {
return this.dialect.buildRefreshMaterializedViewQuery(this.config);
}
toSQL() {
const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
return rest;
}
/** @internal */
_prepare(name) {
return import_tracing.tracer.startActiveSpan("drizzle.prepareQuery", () => {
return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), void 0, name, true);
});
}
prepare(name) {
return this._prepare(name);
}
execute = (placeholderValues) => {
return import_tracing.tracer.startActiveSpan("drizzle.operation", () => {
return this._prepare().execute(placeholderValues);
});
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
GelRefreshMaterializedView
});
//# sourceMappingURL=refresh-materialized-view.cjs.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/postgres/defaultSnapshot.ts"],"sourcesContent":["import type { DrizzleSnapshotJSON } from 'drizzle-kit/api'\n\nexport const defaultDrizzleSnapshot: DrizzleSnapshotJSON = {\n id: '00000000-0000-0000-0000-000000000000',\n _meta: {\n columns: {},\n schemas: {},\n tables: {},\n },\n dialect: 'postgresql',\n enums: {},\n policies: {},\n prevId: '00000000-0000-0000-0000-00000000000',\n roles: {},\n schemas: {},\n sequences: {},\n tables: {},\n version: '7',\n views: {},\n}\n"],"names":["defaultDrizzleSnapshot","id","_meta","columns","schemas","tables","dialect","enums","policies","prevId","roles","sequences","version","views"],"mappings":"AAEA,OAAO,MAAMA,yBAA8C;IACzDC,IAAI;IACJC,OAAO;QACLC,SAAS,CAAC;QACVC,SAAS,CAAC;QACVC,QAAQ,CAAC;IACX;IACAC,SAAS;IACTC,OAAO,CAAC;IACRC,UAAU,CAAC;IACXC,QAAQ;IACRC,OAAO,CAAC;IACRN,SAAS,CAAC;IACVO,WAAW,CAAC;IACZN,QAAQ,CAAC;IACTO,SAAS;IACTC,OAAO,CAAC;AACV,EAAC"}
@@ -0,0 +1,6 @@
export declare const addQuartersWithOptions: import("./types.js").FPFn3<
Date,
import("../addQuarters.js").AddQuartersOptions<Date> | undefined,
number,
import("../fp.js").DateArg<Date>
>;
@@ -0,0 +1,5 @@
/**
* Creates <style> element for widget dialog
*/
export declare function createDialogStyles(styleNonce?: string): HTMLStyleElement;
//# sourceMappingURL=Dialog.css.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"russian-ruble.js","sources":["../../../src/icons/russian-ruble.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name RussianRuble\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAxMWg4YTQgNCAwIDAgMCAwLThIOXYxOCIgLz4KICA8cGF0aCBkPSJNNiAxNWg4IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/russian-ruble\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 RussianRuble = createLucideIcon('RussianRuble', [\n ['path', { d: 'M6 11h8a4 4 0 0 0 0-8H9v18', key: '18ai8t' }],\n ['path', { d: 'M6 15h8', key: '1y8f6l' }],\n]);\n\nexport default RussianRuble;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,9 @@
var get = require("./get.js");
var getPrototypeOf = require("./getPrototypeOf.js");
function _superPropGet(t, o, e, r) {
var p = get(getPrototypeOf(1 & r ? t.prototype : t), o, e);
return 2 & r && "function" == typeof p ? function (t) {
return p.apply(e, t);
} : p;
}
module.exports = _superPropGet, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,qCAAmD;AAA1C,iHAAA,sBAAsB,OAAA;AAC/B,iCAAuD;AAA9C,uGAAA,cAAc,OAAA;AAAE,qGAAA,YAAY,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { AmqplibInstrumentation } from './amqplib';\nexport { DEFAULT_CONFIG, EndOperation } from './types';\nexport type {\n AmqplibConsumeCustomAttributeFunction,\n AmqplibConsumeEndCustomAttributeFunction,\n AmqplibInstrumentationConfig,\n AmqplibPublishConfirmCustomAttributeFunction,\n AmqplibPublishCustomAttributeFunction,\n AmqplibPublishOptions,\n CommonMessageFields,\n ConsumeEndInfo,\n ConsumeInfo,\n ConsumeMessage,\n ConsumeMessageFields,\n Message,\n MessageFields,\n MessageProperties,\n PublishConfirmedInfo,\n PublishInfo,\n} from './types';\n"]}
@@ -0,0 +1 @@
{"version":3,"file":"isClipboardDataValid.d.ts","sourceRoot":"","sources":["../../../src/elements/ClipboardAction/isClipboardDataValid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAA;AAElE;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,gCAAgC,WAgB7F"}
@@ -0,0 +1,24 @@
/**
* @name addQuarters
* @category Quarter Helpers
* @summary Add the specified number of year quarters to the given date.
*
* @description
* Add the specified number of year quarters to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to be changed
* @param amount - The amount of quarters to be added.
*
* @returns The new date with the quarters added
*
* @example
* // Add 1 quarter to 1 September 2014:
* const result = addQuarters(new Date(2014, 8, 1), 1)
* //=> Mon Dec 01 2014 00:00:00
*/
export declare function addQuarters<DateType extends Date>(
date: DateType | number | string,
amount: number,
): DateType;
@@ -0,0 +1,5 @@
export declare const addMonths: import("./types.js").FPFn2<
Date,
number,
string | number | Date
>;
@@ -0,0 +1,61 @@
'use strict'
const { test } = require('tap')
const { join } = require('path')
const { readFile } = require('fs')
const { file } = require('./helper')
const ThreadStream = require('..')
test('destroy support', function (t) {
t.plan(7)
const dest = file()
const stream = new ThreadStream({
filename: join(__dirname, 'to-file-on-destroy.js'),
workerData: { dest },
sync: true
})
stream.on('close', () => {
t.notOk(stream.writable)
t.pass('close emitted')
})
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
t.ok(stream.writable)
stream.end()
readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'hello world\nsomething else\n')
})
})
test('synchronous _final support', function (t) {
t.plan(7)
const dest = file()
const stream = new ThreadStream({
filename: join(__dirname, 'to-file-on-final.js'),
workerData: { dest },
sync: true
})
stream.on('close', () => {
t.notOk(stream.writable)
t.pass('close emitted')
})
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
t.ok(stream.writable)
stream.end()
readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'hello world\nsomething else\n')
})
})
@@ -0,0 +1,175 @@
import { expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
import type * as core from "zod/v4/core";
test("first party switch", () => {
const myType = z.string() as core.$ZodTypes;
const def = myType._zod.def;
switch (def.type) {
case "string":
break;
case "number":
break;
case "bigint":
break;
case "boolean":
break;
case "date":
break;
case "symbol":
break;
case "undefined":
break;
case "null":
break;
case "any":
break;
case "unknown":
break;
case "never":
break;
case "void":
break;
case "array":
break;
case "object":
break;
case "union":
break;
case "intersection":
break;
case "tuple":
break;
case "record":
break;
case "map":
break;
case "set":
break;
case "literal":
break;
case "enum":
break;
case "promise":
break;
case "optional":
break;
case "nonoptional":
break;
case "nullable":
break;
case "default":
break;
case "prefault":
break;
case "template_literal":
break;
case "custom":
break;
case "transform":
break;
case "readonly":
break;
case "nan":
break;
case "pipe":
break;
case "success":
break;
case "catch":
break;
case "file":
break;
case "lazy":
break;
default:
expectTypeOf(def).toEqualTypeOf<never>();
}
});
test("$ZodSchemaTypes", () => {
const type = "string" as core.$ZodTypeDef["type"];
switch (type) {
case "string":
break;
case "number":
break;
case "int":
break;
case "bigint":
break;
case "boolean":
break;
case "date":
break;
case "symbol":
break;
case "undefined":
break;
case "null":
break;
case "any":
break;
case "unknown":
break;
case "never":
break;
case "void":
break;
case "array":
break;
case "object":
break;
case "union":
break;
case "intersection":
break;
case "tuple":
break;
case "record":
break;
case "map":
break;
case "set":
break;
case "literal":
break;
case "enum":
break;
case "promise":
break;
case "optional":
break;
case "nonoptional":
break;
case "nullable":
break;
case "default":
break;
case "prefault":
break;
case "template_literal":
break;
case "custom":
break;
case "transform":
break;
case "readonly":
break;
case "nan":
break;
case "pipe":
break;
case "success":
break;
case "catch":
break;
case "file":
break;
case "lazy":
break;
default:
expectTypeOf(type).toEqualTypeOf<never>();
}
});
@@ -0,0 +1 @@
!function($){var e=["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin","$and","$not","$nor","$or","$exists","$type","$expr","$jsonSchema","$mod","$regex","$text","$where","$geoIntersects","$geoWithin","$near","$nearSphere","$all","$elemMatch","$size","$bitsAllClear","$bitsAllSet","$bitsAnyClear","$bitsAnySet","$comment","$elemMatch","$meta","$slice","$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$each","$position","$slice","$sort","$bit","$addFields","$bucket","$bucketAuto","$collStats","$count","$currentOp","$facet","$geoNear","$graphLookup","$group","$indexStats","$limit","$listLocalSessions","$listSessions","$lookup","$match","$merge","$out","$planCacheStats","$project","$redact","$replaceRoot","$replaceWith","$sample","$set","$skip","$sort","$sortByCount","$unionWith","$unset","$unwind","$setWindowFields","$abs","$accumulator","$acos","$acosh","$add","$addToSet","$allElementsTrue","$and","$anyElementTrue","$arrayElemAt","$arrayToObject","$asin","$asinh","$atan","$atan2","$atanh","$avg","$binarySize","$bsonSize","$ceil","$cmp","$concat","$concatArrays","$cond","$convert","$cos","$dateFromParts","$dateToParts","$dateFromString","$dateToString","$dayOfMonth","$dayOfWeek","$dayOfYear","$degreesToRadians","$divide","$eq","$exp","$filter","$first","$floor","$function","$gt","$gte","$hour","$ifNull","$in","$indexOfArray","$indexOfBytes","$indexOfCP","$isArray","$isNumber","$isoDayOfWeek","$isoWeek","$isoWeekYear","$last","$last","$let","$literal","$ln","$log","$log10","$lt","$lte","$ltrim","$map","$max","$mergeObjects","$meta","$min","$millisecond","$minute","$mod","$month","$multiply","$ne","$not","$objectToArray","$or","$pow","$push","$radiansToDegrees","$range","$reduce","$regexFind","$regexFindAll","$regexMatch","$replaceOne","$replaceAll","$reverseArray","$round","$rtrim","$second","$setDifference","$setEquals","$setIntersection","$setIsSubset","$setUnion","$size","$sin","$slice","$split","$sqrt","$stdDevPop","$stdDevSamp","$strcasecmp","$strLenBytes","$strLenCP","$substr","$substrBytes","$substrCP","$subtract","$sum","$switch","$tan","$toBool","$toDate","$toDecimal","$toDouble","$toInt","$toLong","$toObjectId","$toString","$toLower","$toUpper","$trim","$trunc","$type","$week","$year","$zip","$count","$dateAdd","$dateDiff","$dateSubtract","$dateTrunc","$getField","$rand","$sampleRate","$setField","$unsetField","$comment","$explain","$hint","$max","$maxTimeMS","$min","$orderby","$query","$returnKey","$showDiskLoc","$natural"],t="(?:"+(e=e.map((function($){return $.replace("$","\\$")}))).join("|")+")\\b";$.languages.mongodb=$.languages.extend("javascript",{}),$.languages.insertBefore("mongodb","string",{property:{pattern:/(?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)(?=\s*:)/,greedy:!0,inside:{keyword:RegExp("^(['\"])?"+t+"(?:\\1)?$")}}}),$.languages.mongodb.string.inside={url:{pattern:/https?:\/\/[-\w@:%.+~#=]{1,256}\.[a-z0-9()]{1,6}\b[-\w()@:%+.~#?&/=]*/i,greedy:!0},entity:{pattern:/\b(?:(?:[01]?\d\d?|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d\d?|2[0-4]\d|25[0-5])\b/,greedy:!0}},$.languages.insertBefore("mongodb","constant",{builtin:{pattern:RegExp("\\b(?:"+["ObjectId","Code","BinData","DBRef","Timestamp","NumberLong","NumberDecimal","MaxKey","MinKey","RegExp","ISODate","UUID"].join("|")+")\\b"),alias:"keyword"}})}(Prism);
@@ -0,0 +1,12 @@
const formatRelativeLocale = {
lastWeek: "せんしゅうのeeeeのp",
yesterday: "きのうのp",
today: "きょうのp",
tomorrow: "あしたのp",
nextWeek: "よくしゅうのeeeeのp",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) => {
return formatRelativeLocale[token];
};
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/postgres/schema/geometryColumn.ts"],"sourcesContent":["// Uses custom one instead of geometry() from drizzle-orm/pg-core because it's broken on pushDevSchema\n// Why?\n// It tries to give us a prompt \"you're about to change.. from geometry(Point) to geometry(point)\"\nimport { customType } from 'drizzle-orm/pg-core'\nimport { parseEWKB } from 'drizzle-orm/pg-core/columns/postgis_extension/utils'\n\ntype Point = [number, number]\n\nexport const geometryColumn = (name: string) =>\n customType<{ data: Point; driverData: string }>({\n dataType() {\n return `geometry(Point)`\n },\n fromDriver(value: string) {\n return parseEWKB(value)\n },\n toDriver(value: Point) {\n return `SRID=4326;point(${value[0]} ${value[1]})`\n },\n })(name)\n"],"names":["customType","parseEWKB","geometryColumn","name","dataType","fromDriver","value","toDriver"],"mappings":"AAAA,sGAAsG;AACtG,OAAO;AACP,kGAAkG;AAClG,SAASA,UAAU,QAAQ,sBAAqB;AAChD,SAASC,SAAS,QAAQ,sDAAqD;AAI/E,OAAO,MAAMC,iBAAiB,CAACC,OAC7BH,WAAgD;QAC9CI;YACE,OAAO,CAAC,eAAe,CAAC;QAC1B;QACAC,YAAWC,KAAa;YACtB,OAAOL,UAAUK;QACnB;QACAC,UAASD,KAAY;YACnB,OAAO,CAAC,gBAAgB,EAAEA,KAAK,CAAC,EAAE,CAAC,CAAC,EAAEA,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QACnD;IACF,GAAGH,MAAK"}
@@ -0,0 +1,10 @@
"use strict";
exports.isWeekend = void 0;
var _index = require("../isWeekend.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isWeekend = (exports.isWeekend = (0, _index2.convertToFP)(
_index.isWeekend,
1,
));
@@ -0,0 +1 @@
{"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../../src/common/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
@@ -0,0 +1,30 @@
/**
* Read-only token
* See https://github.com/Borewit/strtok3 for more information
*/
export interface IGetToken<Value, Array extends Uint8Array = Uint8Array> {
/**
* Length of encoded token in bytes
*/
len: number;
/**
* Decode value from buffer at offset
* @param array - Uint8Array to read the decoded value from
* @param offset - Decode offset
* @return decoded value
*/
get(array: Array, offset: number): Value;
}
export interface IToken<Value, Array extends Uint8Array = Uint8Array> extends IGetToken<Value, Array> {
/**
* Encode value to buffer
* @param array - Uint8Array to write the encoded value to
* @param offset - Buffer write offset
* @param value - Value to decode of type T
* @return offset plus number of bytes written
*/
put(array: Array, offset: number, value: Value): number
}
@@ -0,0 +1,44 @@
var baseFindKey = require('./_baseFindKey'),
baseForOwnRight = require('./_baseForOwnRight'),
baseIteratee = require('./_baseIteratee');
/**
* This method is like `_.findKey` except that it iterates over elements of
* a collection in the opposite order.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Object
* @param {Object} object The object to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {string|undefined} Returns the key of the matched element,
* else `undefined`.
* @example
*
* var users = {
* 'barney': { 'age': 36, 'active': true },
* 'fred': { 'age': 40, 'active': false },
* 'pebbles': { 'age': 1, 'active': true }
* };
*
* _.findLastKey(users, function(o) { return o.age < 40; });
* // => returns 'pebbles' assuming `_.findKey` returns 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.findLastKey(users, { 'age': 36, 'active': true });
* // => 'barney'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findLastKey(users, ['active', false]);
* // => 'fred'
*
* // The `_.property` iteratee shorthand.
* _.findLastKey(users, 'active');
* // => 'pebbles'
*/
function findLastKey(object, predicate) {
return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight);
}
module.exports = findLastKey;
@@ -0,0 +1 @@
{"version":3,"file":"baseFields.d.ts","sourceRoot":"","sources":["../../src/versions/baseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAE7E,eAAO,MAAM,QAAQ,EAAE,MAAM,EAS5B,CAAA;AAED,eAAO,MAAM,iBAAiB,kBAAmB;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,KAAG,KAAK,EAgB9E,CAAA;AAOD,eAAO,MAAM,oBAAoB,EAAE,aAQlC,CAAA"}
@@ -0,0 +1,10 @@
"use strict";
exports.setSeconds = void 0;
var _index = require("../setSeconds.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const setSeconds = (exports.setSeconds = (0, _index2.convertToFP)(
_index.setSeconds,
2,
));
@@ -0,0 +1 @@
{"version":3,"file":"filterFieldsWithPermissions.js","names":["fieldAffectsData","fieldIsHiddenOrDisabled","fieldIsID","shouldSkipField","field","type","admin","disableListColumn","filterFieldsWithPermissions","fieldPermissions","fields","reduce","acc","formattedField","tabs","map","tab","name","push","Array","isArray","fieldPermission","read"],"sources":["../../../../src/providers/TableColumns/buildColumnState/filterFieldsWithPermissions.tsx"],"sourcesContent":["import type {\n ClientField,\n Field,\n SanitizedFieldPermissions,\n SanitizedFieldsPermissions,\n} from 'payload'\n\nimport { fieldAffectsData, fieldIsHiddenOrDisabled, fieldIsID } from 'payload/shared'\n\nconst shouldSkipField = (field: ClientField | Field): boolean =>\n (field.type !== 'ui' && fieldIsHiddenOrDisabled(field) && !fieldIsID(field)) ||\n field?.admin?.disableListColumn === true\n\nexport const filterFieldsWithPermissions = <T extends ClientField | Field = ClientField>({\n fieldPermissions,\n fields,\n}: {\n fieldPermissions?: SanitizedFieldPermissions | SanitizedFieldsPermissions\n fields: (ClientField | Field)[]\n}): T[] => {\n return (fields ?? []).reduce((acc, field) => {\n if (shouldSkipField(field)) {\n return acc\n }\n\n // handle tabs\n if (field.type === 'tabs' && 'tabs' in field) {\n const formattedField = {\n ...field,\n tabs: field.tabs.map((tab) => ({\n ...tab,\n fields: filterFieldsWithPermissions<T>({\n fieldPermissions:\n typeof fieldPermissions === 'boolean'\n ? fieldPermissions\n : 'name' in tab && tab.name\n ? fieldPermissions[tab.name]?.fields || fieldPermissions[tab.name]\n : fieldPermissions,\n fields: tab.fields,\n }),\n })),\n } as ClientField | Field\n acc.push(formattedField)\n return acc\n }\n\n // handle fields with subfields (row, group, collapsible, etc.)\n if ('fields' in field && Array.isArray(field.fields)) {\n const formattedField = {\n ...field,\n fields: filterFieldsWithPermissions<T>({\n fieldPermissions:\n typeof fieldPermissions === 'boolean'\n ? fieldPermissions\n : 'name' in field && field.name\n ? fieldPermissions?.[field.name]?.fields || fieldPermissions?.[field.name]\n : fieldPermissions,\n fields: field.fields,\n }),\n } as ClientField | Field\n acc.push(formattedField)\n return acc\n }\n\n if (fieldPermissions === true) {\n acc.push(field)\n return acc\n }\n\n if (fieldAffectsData(field)) {\n const fieldPermission = fieldPermissions?.[field.name]\n // Always allow ID fields, or if explicitly granted (true or { read: true })\n // undefined means field is not in permissions object = denied\n if (fieldIsID(field) || fieldPermission === true || fieldPermission?.read === true) {\n acc.push(field)\n }\n return acc\n }\n\n // leaf\n acc.push(field)\n return acc\n }, [])\n}\n"],"mappings":"AAOA,SAASA,gBAAgB,EAAEC,uBAAuB,EAAEC,SAAS,QAAQ;AAErE,MAAMC,eAAA,GAAmBC,KAAA,IACvBA,KAAC,CAAMC,IAAI,KAAK,QAAQJ,uBAAA,CAAwBG,KAAA,KAAU,CAACF,SAAA,CAAUE,KAAA,KACrEA,KAAA,EAAOE,KAAA,EAAOC,iBAAA,KAAsB;AAEtC,OAAO,MAAMC,2BAAA,GAA8BA,CAA8C;EACvFC,gBAAgB;EAChBC;AAAM,CAIP;EACC,OAAO,CAACA,MAAA,IAAU,EAAE,EAAEC,MAAM,CAAC,CAACC,GAAA,EAAKR,KAAA;IACjC,IAAID,eAAA,CAAgBC,KAAA,GAAQ;MAC1B,OAAOQ,GAAA;IACT;IAEA;IACA,IAAIR,KAAA,CAAMC,IAAI,KAAK,UAAU,UAAUD,KAAA,EAAO;MAC5C,MAAMS,cAAA,GAAiB;QACrB,GAAGT,KAAK;QACRU,IAAA,EAAMV,KAAA,CAAMU,IAAI,CAACC,GAAG,CAAEC,GAAA,KAAS;UAC7B,GAAGA,GAAG;UACNN,MAAA,EAAQF,2BAAA,CAA+B;YACrCC,gBAAA,EACE,OAAOA,gBAAA,KAAqB,YACxBA,gBAAA,GACA,UAAUO,GAAA,IAAOA,GAAA,CAAIC,IAAI,GACvBR,gBAAgB,CAACO,GAAA,CAAIC,IAAI,CAAC,EAAEP,MAAA,IAAUD,gBAAgB,CAACO,GAAA,CAAIC,IAAI,CAAC,GAChER,gBAAA;YACRC,MAAA,EAAQM,GAAA,CAAIN;UACd;QACF;MACF;MACAE,GAAA,CAAIM,IAAI,CAACL,cAAA;MACT,OAAOD,GAAA;IACT;IAEA;IACA,IAAI,YAAYR,KAAA,IAASe,KAAA,CAAMC,OAAO,CAAChB,KAAA,CAAMM,MAAM,GAAG;MACpD,MAAMG,cAAA,GAAiB;QACrB,GAAGT,KAAK;QACRM,MAAA,EAAQF,2BAAA,CAA+B;UACrCC,gBAAA,EACE,OAAOA,gBAAA,KAAqB,YACxBA,gBAAA,GACA,UAAUL,KAAA,IAASA,KAAA,CAAMa,IAAI,GAC3BR,gBAAA,GAAmBL,KAAA,CAAMa,IAAI,CAAC,EAAEP,MAAA,IAAUD,gBAAA,GAAmBL,KAAA,CAAMa,IAAI,CAAC,GACxER,gBAAA;UACRC,MAAA,EAAQN,KAAA,CAAMM;QAChB;MACF;MACAE,GAAA,CAAIM,IAAI,CAACL,cAAA;MACT,OAAOD,GAAA;IACT;IAEA,IAAIH,gBAAA,KAAqB,MAAM;MAC7BG,GAAA,CAAIM,IAAI,CAACd,KAAA;MACT,OAAOQ,GAAA;IACT;IAEA,IAAIZ,gBAAA,CAAiBI,KAAA,GAAQ;MAC3B,MAAMiB,eAAA,GAAkBZ,gBAAA,GAAmBL,KAAA,CAAMa,IAAI,CAAC;MACtD;MACA;MACA,IAAIf,SAAA,CAAUE,KAAA,KAAUiB,eAAA,KAAoB,QAAQA,eAAA,EAAiBC,IAAA,KAAS,MAAM;QAClFV,GAAA,CAAIM,IAAI,CAACd,KAAA;MACX;MACA,OAAOQ,GAAA;IACT;IAEA;IACAA,GAAA,CAAIM,IAAI,CAACd,KAAA;IACT,OAAOQ,GAAA;EACT,GAAG,EAAE;AACP","ignoreList":[]}
@@ -0,0 +1,16 @@
/**
* 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 {EditorState, LexicalEditor} from 'lexical';
declare export function OnChangePlugin({
ignoreHistoryMergeTagChange?: boolean,
ignoreSelectionChange?: boolean,
onChange: (editorState: EditorState, editor: LexicalEditor, tags: Set<string>) => void,
}): null;
@@ -0,0 +1,31 @@
import { formatUtcOffset } from './formatUtcOffset.js';
const numbers = [
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9'
];
export const formatName = (string)=>{
let sanitizedString = String(string);
// Check if this is a UTC offset (e.g., +05:30, -08:00)
// These need special handling to avoid collisions
const utcOffsetName = formatUtcOffset(sanitizedString);
if (utcOffsetName) {
return utcOffsetName;
}
const firstLetter = sanitizedString.substring(0, 1);
if (numbers.indexOf(firstLetter) > -1) {
sanitizedString = `_${sanitizedString}`;
}
const formatted = sanitizedString// Convert accented characters
.normalize('NFKD').replace(/[\u0300-\u036f]/g, '').replace(/\./g, '_').replace(/-|\//g, '_').replace(/\+/g, '_').replace(/,/g, '_').replace(/\(/g, '_').replace(/\)/g, '_').replace(/'/g, '_').replace(/ /g, '').replace(/\[|\]/g, '_');
return formatted || '_';
};
//# sourceMappingURL=formatName.js.map
@@ -0,0 +1,170 @@
import { executeAccess } from '../../auth/executeAccess.js';
import { NotFound } from '../../errors/index.js';
import { afterChange } from '../../fields/hooks/afterChange/index.js';
import { afterRead } from '../../fields/hooks/afterRead/index.js';
import { commitTransaction } from '../../utilities/commitTransaction.js';
import { initTransaction } from '../../utilities/initTransaction.js';
import { killTransaction } from '../../utilities/killTransaction.js';
export const restoreVersionOperation = async (args)=>{
const { id, depth, draft, globalConfig, overrideAccess, populate, showHiddenFields } = args;
const req = args.req;
const { fallbackLocale, locale, payload } = req;
try {
const shouldCommit = await initTransaction(req);
// /////////////////////////////////////
// beforeOperation - Global
// /////////////////////////////////////
if (globalConfig.hooks?.beforeOperation?.length) {
for (const hook of globalConfig.hooks.beforeOperation){
args = await hook({
args,
context: req.context,
global: globalConfig,
operation: 'restoreVersion',
overrideAccess,
req
}) || args;
}
}
// /////////////////////////////////////
// Access
// /////////////////////////////////////
if (!overrideAccess) {
await executeAccess({
req
}, globalConfig.access.update);
}
// /////////////////////////////////////
// Retrieve original raw version
// /////////////////////////////////////
const { docs: versionDocs } = await payload.db.findGlobalVersions({
global: globalConfig.slug,
limit: 1,
req,
where: {
id: {
equals: id
}
}
});
if (!versionDocs || versionDocs.length === 0) {
throw new NotFound(req.t);
}
const rawVersion = versionDocs[0];
// Patch globalType onto version doc
rawVersion.version.globalType = globalConfig.slug;
// Overwrite draft status if draft is true
if (draft) {
rawVersion.version._status = 'draft';
}
// /////////////////////////////////////
// fetch previousDoc
// /////////////////////////////////////
const previousDoc = await payload.findGlobal({
slug: globalConfig.slug,
depth,
req
});
// /////////////////////////////////////
// Update global
// /////////////////////////////////////
const global = await payload.db.findGlobal({
slug: globalConfig.slug,
req
});
let result = rawVersion.version;
if (global) {
// Ensure updatedAt date is always updated
result.updatedAt = new Date().toISOString();
result = await payload.db.updateGlobal({
slug: globalConfig.slug,
data: result,
req
});
const now = new Date().toISOString();
result = await payload.db.createGlobalVersion({
autosave: false,
createdAt: result.createdAt ? new Date(result.createdAt).toISOString() : now,
globalSlug: globalConfig.slug,
req,
updatedAt: draft ? now : new Date(result.updatedAt).toISOString(),
versionData: result
});
} else {
result = await payload.db.createGlobal({
slug: globalConfig.slug,
data: result,
req
});
}
// /////////////////////////////////////
// afterRead - Fields
// /////////////////////////////////////
result = await afterRead({
collection: null,
context: req.context,
depth: depth,
doc: result,
draft: undefined,
fallbackLocale: fallbackLocale,
global: globalConfig,
locale: locale,
overrideAccess: overrideAccess,
populate,
req,
showHiddenFields: showHiddenFields
});
// /////////////////////////////////////
// afterRead - Global
// /////////////////////////////////////
if (globalConfig.hooks?.afterRead?.length) {
for (const hook of globalConfig.hooks.afterRead){
result = await hook({
context: req.context,
doc: result,
global: globalConfig,
overrideAccess,
req
}) || result;
}
}
// /////////////////////////////////////
// afterChange - Fields
// /////////////////////////////////////
result = await afterChange({
collection: null,
context: req.context,
data: result,
doc: result,
global: globalConfig,
operation: 'update',
previousDoc,
req
});
// /////////////////////////////////////
// afterChange - Global
// /////////////////////////////////////
if (globalConfig.hooks?.afterChange?.length) {
for (const hook of globalConfig.hooks.afterChange){
result = await hook({
context: req.context,
data: result,
doc: result,
global: globalConfig,
overrideAccess,
previousDoc,
req
}) || result;
}
}
if (shouldCommit) {
await commitTransaction(req);
}
return result;
} catch (error) {
await killTransaction(req);
throw error;
}
};
//# sourceMappingURL=restoreVersion.js.map
@@ -0,0 +1,11 @@
import { unflatten } from 'payload/shared';
export const transformColumnsToSelect = columns => {
const columnsSelect = columns.reduce((acc, column) => {
if (column.active) {
acc[column.accessor] = true;
}
return acc;
}, {});
return unflatten(columnsSelect);
};
//# sourceMappingURL=transformColumnsToSelect.js.map
@@ -0,0 +1,72 @@
(function (Prism) {
Prism.languages.velocity = Prism.languages.extend('markup', {});
var velocity = {
'variable': {
pattern: /(^|[^\\](?:\\\\)*)\$!?(?:[a-z][\w-]*(?:\([^)]*\))?(?:\.[a-z][\w-]*(?:\([^)]*\))?|\[[^\]]+\])*|\{[^}]+\})/i,
lookbehind: true,
inside: {} // See below
},
'string': {
pattern: /"[^"]*"|'[^']*'/,
greedy: true
},
'number': /\b\d+\b/,
'boolean': /\b(?:false|true)\b/,
'operator': /[=!<>]=?|[+*/%-]|&&|\|\||\.\.|\b(?:eq|g[et]|l[et]|n(?:e|ot))\b/,
'punctuation': /[(){}[\]:,.]/
};
velocity.variable.inside = {
'string': velocity['string'],
'function': {
pattern: /([^\w-])[a-z][\w-]*(?=\()/,
lookbehind: true
},
'number': velocity['number'],
'boolean': velocity['boolean'],
'punctuation': velocity['punctuation']
};
Prism.languages.insertBefore('velocity', 'comment', {
'unparsed': {
pattern: /(^|[^\\])#\[\[[\s\S]*?\]\]#/,
lookbehind: true,
greedy: true,
inside: {
'punctuation': /^#\[\[|\]\]#$/
}
},
'velocity-comment': [
{
pattern: /(^|[^\\])#\*[\s\S]*?\*#/,
lookbehind: true,
greedy: true,
alias: 'comment'
},
{
pattern: /(^|[^\\])##.*/,
lookbehind: true,
greedy: true,
alias: 'comment'
}
],
'directive': {
pattern: /(^|[^\\](?:\\\\)*)#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})(?:\s*\((?:[^()]|\([^()]*\))*\))?/i,
lookbehind: true,
inside: {
'keyword': {
pattern: /^#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})|\bin\b/,
inside: {
'punctuation': /[{}]/
}
},
rest: velocity
}
},
'variable': velocity['variable']
});
Prism.languages.velocity['tag'].inside['attr-value'].inside.rest = Prism.languages.velocity;
}(Prism));
@@ -0,0 +1,15 @@
import { baseIDField } from './baseIDField.js';
export const baseBlockFields = [
baseIDField,
{
name: 'blockName',
type: 'text',
admin: {
disabled: true
},
label: 'Block Name',
required: false
}
];
//# sourceMappingURL=baseBlockFields.js.map
@@ -0,0 +1,10 @@
"use strict";
exports.isLastDayOfMonth = void 0;
var _index = require("../isLastDayOfMonth.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isLastDayOfMonth = (exports.isLastDayOfMonth = (0, _index2.convertToFP)(
_index.isLastDayOfMonth,
1,
));
@@ -0,0 +1,28 @@
"use strict";
exports.is = void 0;
var _index = require("./is/_lib/formatDistance.cjs");
var _index2 = require("./is/_lib/formatLong.cjs");
var _index3 = require("./is/_lib/formatRelative.cjs");
var _index4 = require("./is/_lib/localize.cjs");
var _index5 = require("./is/_lib/match.cjs");
/**
* @category Locales
* @summary Icelandic locale.
* @language Icelandic
* @iso-639-2 isl
* @author Derek Blank [@derekblank](https://github.com/derekblank)
* @author Arnór Ýmir [@lamayg](https://github.com/lamayg)
*/
const is = (exports.is = {
code: "is",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});
@@ -0,0 +1 @@
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/utils/configuration.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAAwD;AAExD,MAAM,WAAW,GAAoC;IACnD,GAAG,EAAE,kBAAY,CAAC,GAAG;IACrB,OAAO,EAAE,kBAAY,CAAC,OAAO;IAC7B,KAAK,EAAE,kBAAY,CAAC,KAAK;IACzB,IAAI,EAAE,kBAAY,CAAC,IAAI;IACvB,IAAI,EAAE,kBAAY,CAAC,IAAI;IACvB,KAAK,EAAE,kBAAY,CAAC,KAAK;IACzB,IAAI,EAAE,kBAAY,CAAC,IAAI;CACxB,CAAC;AAEF;;;GAGG;AACH,SAAgB,sBAAsB,CACpC,KAAyB;IAEzB,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,yIAAyI;QACzI,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAE1D,IAAI,gBAAgB,IAAI,IAAI,EAAE;QAC5B,UAAI,CAAC,IAAI,CACP,sBAAsB,KAAK,sBAAsB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAC3F,CAAC;QACF,OAAO,kBAAY,CAAC,IAAI,CAAC;KAC1B;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAlBD,wDAkBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { diag, DiagLogLevel } from '@opentelemetry/api';\n\nconst logLevelMap: { [key: string]: DiagLogLevel } = {\n ALL: DiagLogLevel.ALL,\n VERBOSE: DiagLogLevel.VERBOSE,\n DEBUG: DiagLogLevel.DEBUG,\n INFO: DiagLogLevel.INFO,\n WARN: DiagLogLevel.WARN,\n ERROR: DiagLogLevel.ERROR,\n NONE: DiagLogLevel.NONE,\n};\n\n/**\n * Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined.\n * @param value\n */\nexport function diagLogLevelFromString(\n value: string | undefined\n): DiagLogLevel | undefined {\n if (value == null) {\n // don't fall back to default - no value set has different semantics for ús than an incorrect value (do not set vs. fall back to default)\n return undefined;\n }\n\n const resolvedLogLevel = logLevelMap[value.toUpperCase()];\n\n if (resolvedLogLevel == null) {\n diag.warn(\n `Unknown log level \"${value}\", expected one of ${Object.keys(logLevelMap)}, using default`\n );\n return DiagLogLevel.INFO;\n }\n\n return resolvedLogLevel;\n}\n"]}
@@ -0,0 +1,20 @@
import { isArrayOfRows } from '../../utilities/isArrayOfRows.js';
export const transformSelects = ({ id, data, locale })=>{
const newRows = [];
if (isArrayOfRows(data)) {
data.forEach((value, i)=>{
const newRow = {
order: i + 1,
parent: id,
value
};
if (locale) {
newRow.locale = locale;
}
newRows.push(newRow);
});
}
return newRows;
};
//# sourceMappingURL=selects.js.map
@@ -0,0 +1,37 @@
{
"name": "events",
"version": "3.3.0",
"description": "Node's event emitter for all engines.",
"keywords": [
"events",
"eventEmitter",
"eventDispatcher",
"listeners"
],
"author": "Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"repository": {
"type": "git",
"url": "git://github.com/Gozala/events.git",
"web": "https://github.com/Gozala/events"
},
"bugs": {
"url": "http://github.com/Gozala/events/issues/"
},
"main": "./events.js",
"engines": {
"node": ">=0.8.x"
},
"devDependencies": {
"airtap": "^1.0.0",
"functions-have-names": "^1.2.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"isarray": "^2.0.5",
"tape": "^5.0.0"
},
"scripts": {
"test": "node tests/index.js",
"test:browsers": "airtap -- tests/index.js"
},
"license": "MIT"
}
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/supabase/index.ts"],"sourcesContent":["export * from './rls.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,qBAAd;","names":[]}
@@ -0,0 +1,207 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const debugBuild = require('../debug-build.js');
const childProcess = require('../integrations/childProcess.js');
const context = require('../integrations/context.js');
const contextlines = require('../integrations/contextlines.js');
const index = require('../integrations/local-variables/index.js');
const modules = require('../integrations/modules.js');
const onuncaughtexception = require('../integrations/onuncaughtexception.js');
const onunhandledrejection = require('../integrations/onunhandledrejection.js');
const processSession = require('../integrations/processSession.js');
const spotlight = require('../integrations/spotlight.js');
const systemError = require('../integrations/systemError.js');
const api = require('../sdk/api.js');
const http = require('../transports/http.js');
const detection = require('../utils/detection.js');
const spotlight$1 = require('../utils/spotlight.js');
const asyncLocalStorageStrategy = require('./asyncLocalStorageStrategy.js');
const client = require('./client.js');
const httpIntegration = require('./integrations/httpIntegration.js');
const nativeNodeFetchIntegration = require('./integrations/nativeNodeFetchIntegration.js');
/**
* Get default integrations for the Light Node-Core SDK.
*/
function getDefaultIntegrations() {
return [
// Common
core.eventFiltersIntegration(),
core.functionToStringIntegration(),
core.linkedErrorsIntegration(),
core.requestDataIntegration(),
systemError.systemErrorIntegration(),
// Native Wrappers
core.consoleIntegration(),
httpIntegration.httpIntegration(),
nativeNodeFetchIntegration.nativeNodeFetchIntegration(),
// Global Handlers
onuncaughtexception.onUncaughtExceptionIntegration(),
onunhandledrejection.onUnhandledRejectionIntegration(),
// Event Info
contextlines.contextLinesIntegration(),
index.localVariablesIntegration(),
context.nodeContextIntegration(),
childProcess.childProcessIntegration(),
processSession.processSessionIntegration(),
modules.modulesIntegration(),
];
}
/**
* Initialize Sentry for Node in light mode (without OpenTelemetry).
*/
function init(options = {}) {
return _init(options, getDefaultIntegrations);
}
/**
* Initialize Sentry for Node in light mode, without any integrations added by default.
*/
function initWithoutDefaultIntegrations(options = {}) {
return _init(options, () => []);
}
/**
* Initialize Sentry for Node in light mode.
*/
function _init(
_options = {},
getDefaultIntegrationsImpl,
) {
const options = getClientOptions(_options, getDefaultIntegrationsImpl);
if (options.debug === true) {
if (debugBuild.DEBUG_BUILD) {
core.debug.enable();
} else {
// use `console.warn` rather than `debug.warn` since by non-debug bundles have all `debug.x` statements stripped
core.consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
});
}
}
// Use AsyncLocalStorage-based context strategy instead of OpenTelemetry
asyncLocalStorageStrategy.setAsyncLocalStorageAsyncContextStrategy();
const scope = core.getCurrentScope();
scope.update(options.initialScope);
if (options.spotlight && !options.integrations.some(({ name }) => name === spotlight.INTEGRATION_NAME)) {
options.integrations.push(
spotlight.spotlightIntegration({
sidecarUrl: typeof options.spotlight === 'string' ? options.spotlight : undefined,
}),
);
}
core.applySdkMetadata(options, 'node-light', ['node-core']);
const client$1 = new client.LightNodeClient(options);
// The client is on the current scope, from where it generally is inherited
core.getCurrentScope().setClient(client$1);
client$1.init();
core.GLOBAL_OBJ._sentryInjectLoaderHookRegister?.();
core.debug.log(`SDK initialized from ${detection.isCjs() ? 'CommonJS' : 'ESM'} (light mode)`);
client$1.startClientReportTracking();
updateScopeFromEnvVariables();
// Ensure we flush events when vercel functions are ended
// See: https://vercel.com/docs/functions/functions-api-reference#sigterm-signal
if (process.env.VERCEL) {
process.on('SIGTERM', async () => {
// We have 500ms for processing here, so we try to make sure to have enough time to send the events
await client$1.flush(200);
});
}
return client$1;
}
function getClientOptions(
options,
getDefaultIntegrationsImpl,
) {
const release = getRelease(options.release);
const spotlight = spotlight$1.getSpotlightConfig(options.spotlight);
const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate);
const mergedOptions = {
...options,
dsn: options.dsn ?? process.env.SENTRY_DSN,
environment: options.environment ?? process.env.SENTRY_ENVIRONMENT,
sendClientReports: options.sendClientReports ?? true,
transport: options.transport ?? http.makeNodeTransport,
stackParser: core.stackParserFromStackParserOptions(options.stackParser || api.defaultStackParser),
release,
tracesSampleRate,
spotlight,
debug: core.envToBool(options.debug ?? process.env.SENTRY_DEBUG),
};
const integrations = options.integrations;
const defaultIntegrations = options.defaultIntegrations ?? getDefaultIntegrationsImpl(mergedOptions);
return {
...mergedOptions,
integrations: core.getIntegrationsToSetup({
defaultIntegrations,
integrations,
}),
};
}
function getRelease(release) {
if (release !== undefined) {
return release;
}
const detectedRelease = api.getSentryRelease();
if (detectedRelease !== undefined) {
return detectedRelease;
}
return undefined;
}
function getTracesSampleRate(tracesSampleRate) {
if (tracesSampleRate !== undefined) {
return tracesSampleRate;
}
const sampleRateFromEnv = process.env.SENTRY_TRACES_SAMPLE_RATE;
if (!sampleRateFromEnv) {
return undefined;
}
const parsed = parseFloat(sampleRateFromEnv);
return isFinite(parsed) ? parsed : undefined;
}
/**
* Update scope and propagation context based on environmental variables.
*
* See https://github.com/getsentry/rfcs/blob/main/text/0071-continue-trace-over-process-boundaries.md
* for more details.
*/
function updateScopeFromEnvVariables() {
if (core.envToBool(process.env.SENTRY_USE_ENVIRONMENT) !== false) {
const sentryTraceEnv = process.env.SENTRY_TRACE;
const baggageEnv = process.env.SENTRY_BAGGAGE;
const propagationContext = core.propagationContextFromHeaders(sentryTraceEnv, baggageEnv);
core.getCurrentScope().setPropagationContext(propagationContext);
}
}
exports.getDefaultIntegrations = getDefaultIntegrations;
exports.init = init;
exports.initWithoutDefaultIntegrations = initWithoutDefaultIntegrations;
//# sourceMappingURL=sdk.js.map
@@ -0,0 +1,65 @@
@import '../../scss/styles.scss';
@layer payload-default {
// Positioned field-type__wrap is needed for correct positioning of field tooltips.
// This is set outside of .render-fields, so that manually rendered fields (e.g. in Auth/index.tsx)
// outside RenderFields also receive this styling.
.field-type__wrap {
position: relative;
}
.render-fields {
--spacing-field: var(--base);
&--margins-small {
--spacing-field: var(--base);
}
&--margins-none {
--spacing-field: 0;
}
& > .field-type {
margin-bottom: var(--spacing-field);
position: relative;
&[type='hidden'] {
margin-bottom: 0;
}
&:first-child {
margin-top: 0;
}
&:last-of-type {
margin-bottom: 0;
}
}
// at the top-level, add extra margins for the following field types
&:not(.render-fields--margins-small) {
& > .field-type {
&.group-field,
&.blocks-field,
&.array-field,
&.collapsible-field,
&.rich-text {
margin-top: calc(var(--spacing-field) * 2);
margin-bottom: calc(var(--spacing-field) * 2);
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
}
}
}
@include small-break {
--spacing-field: calc(var(--base) / 2);
}
}
}
@@ -0,0 +1,4 @@
export { useFormatter, useTranslations } from './react-client/index.js';
export { default as NextIntlClientProvider } from './shared/NextIntlClientProvider.js';
export { IntlProvider, _useExtracted as useExtracted, useLocale, useMessages, useNow, useTimeZone } from 'use-intl/react';
export * from 'use-intl/core';
@@ -0,0 +1,12 @@
import { ResourceDetectionConfig } from '../../../config';
import { DetectedResource, ResourceDetector } from '../../../types';
/**
* ProcessDetector will be used to detect the resources related current process running
* and being instrumented from the NodeJS Process module.
*/
declare class ProcessDetector implements ResourceDetector {
detect(_config?: ResourceDetectionConfig): DetectedResource;
}
export declare const processDetector: ProcessDetector;
export {};
//# sourceMappingURL=ProcessDetector.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"collections.js","names":[],"sources":["../../../../src/rest/commands/read/collections.ts"],"sourcesContent":["import type { DirectusCollection } from '../../../schema/collection.js';\nimport type { ApplyQueryFields } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadCollectionOutput<Schema, Item extends object = DirectusCollection<Schema>> = ApplyQueryFields<\n\tSchema,\n\tItem,\n\t'*'\n>;\n\n/**\n * List the available collections.\n * @returns An array of collection objects.\n */\nexport const readCollections =\n\t<Schema>(): RestCommand<ReadCollectionOutput<Schema>[], Schema> =>\n\t() => ({\n\t\tpath: `/collections`,\n\t\tmethod: 'GET',\n\t});\n\n/**\n * Retrieve a single collection by table name.\n * @param collection The collection name\n * @returns A collection object.\n * @throws Will throw if collection is empty\n */\nexport const readCollection =\n\t<Schema>(collection: DirectusCollection<Schema>['collection']): RestCommand<ReadCollectionOutput<Schema>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/collections/${collection}`,\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"6DAeA,MAAa,WAEL,CACN,KAAM,eACN,OAAQ,MACR,EAQW,EACH,QAER,EAAa,EAAY,6BAA6B,CAE/C,CACN,KAAM,gBAAgB,IACtB,OAAQ,MACR"}
@@ -0,0 +1,213 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const identifierUtils = require("./util/identifier");
/** @typedef {import("../declarations/WebpackOptions").StatsOptions} StatsOptions */
/** @typedef {import("./Compilation").CreateStatsOptionsContext} CreateStatsOptionsContext */
/** @typedef {import("./Compilation").NormalizedStatsOptions} NormalizedStatsOptions */
/** @typedef {import("./Stats")} Stats */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").KnownStatsCompilation} KnownStatsCompilation */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsCompilation} StatsCompilation */
/** @typedef {import("./stats/DefaultStatsFactoryPlugin").StatsError} StatsError */
/**
* @param {string} str string
* @param {string} prefix pref
* @returns {string} indent
*/
const indent = (str, prefix) => {
const rem = str.replace(/\n([^\n])/g, `\n${prefix}$1`);
return prefix + rem;
};
/** @typedef {undefined | string | boolean | StatsOptions} ChildrenStatsOptions */
/** @typedef {Omit<StatsOptions, "children"> & { children?: ChildrenStatsOptions | ChildrenStatsOptions[] }} MultiStatsOptions */
/** @typedef {{ version: boolean, hash: boolean, errorsCount: boolean, warningsCount: boolean, errors: boolean, warnings: boolean, children: NormalizedStatsOptions[] }} ChildOptions */
class MultiStats {
/**
* @param {Stats[]} stats the child stats
*/
constructor(stats) {
this.stats = stats;
}
get hash() {
return this.stats.map((stat) => stat.hash).join("");
}
/**
* @returns {boolean} true if a child compilation encountered an error
*/
hasErrors() {
return this.stats.some((stat) => stat.hasErrors());
}
/**
* @returns {boolean} true if a child compilation had a warning
*/
hasWarnings() {
return this.stats.some((stat) => stat.hasWarnings());
}
/**
* @param {undefined | string | boolean | MultiStatsOptions} options stats options
* @param {CreateStatsOptionsContext} context context
* @returns {ChildOptions} context context
*/
_createChildOptions(options, context) {
const getCreateStatsOptions = () => {
if (!options) {
options = {};
}
const { children: childrenOptions = undefined, ...baseOptions } =
typeof options === "string"
? { preset: options }
: /** @type {StatsOptions} */ (options);
return { childrenOptions, baseOptions };
};
const children = this.stats.map((stat, idx) => {
if (typeof options === "boolean") {
return stat.compilation.createStatsOptions(options, context);
}
const { childrenOptions, baseOptions } = getCreateStatsOptions();
const childOptions = Array.isArray(childrenOptions)
? childrenOptions[idx]
: childrenOptions;
if (typeof childOptions === "boolean") {
return stat.compilation.createStatsOptions(childOptions, context);
}
return stat.compilation.createStatsOptions(
{
...baseOptions,
...(typeof childOptions === "string"
? { preset: childOptions }
: childOptions && typeof childOptions === "object"
? childOptions
: undefined)
},
context
);
});
return {
version: children.every((o) => o.version),
hash: children.every((o) => o.hash),
errorsCount: children.every((o) => o.errorsCount),
warningsCount: children.every((o) => o.warningsCount),
errors: children.every((o) => o.errors),
warnings: children.every((o) => o.warnings),
children
};
}
/**
* @param {(string | boolean | MultiStatsOptions)=} options stats options
* @returns {StatsCompilation} json output
*/
toJson(options) {
const childOptions = this._createChildOptions(options, {
forToString: false
});
/** @type {KnownStatsCompilation} */
const obj = {};
obj.children = this.stats.map((stat, idx) => {
const obj = stat.toJson(childOptions.children[idx]);
const compilationName = stat.compilation.name;
const name =
compilationName &&
identifierUtils.makePathsRelative(
stat.compilation.compiler.context,
compilationName,
stat.compilation.compiler.root
);
obj.name = name;
return obj;
});
if (childOptions.version) {
obj.version = obj.children[0].version;
}
if (childOptions.hash) {
obj.hash = obj.children.map((j) => j.hash).join("");
}
/**
* @param {StatsCompilation} j stats error
* @param {StatsError} obj Stats error
* @returns {StatsError} result
*/
const mapError = (j, obj) => ({
...obj,
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
});
if (childOptions.errors) {
obj.errors = [];
for (const j of obj.children) {
const errors =
/** @type {NonNullable<KnownStatsCompilation["errors"]>} */
(j.errors);
for (const i of errors) {
obj.errors.push(mapError(j, i));
}
}
}
if (childOptions.warnings) {
obj.warnings = [];
for (const j of obj.children) {
const warnings =
/** @type {NonNullable<KnownStatsCompilation["warnings"]>} */
(j.warnings);
for (const i of warnings) {
obj.warnings.push(mapError(j, i));
}
}
}
if (childOptions.errorsCount) {
obj.errorsCount = 0;
for (const j of obj.children) {
obj.errorsCount += /** @type {number} */ (j.errorsCount);
}
}
if (childOptions.warningsCount) {
obj.warningsCount = 0;
for (const j of obj.children) {
obj.warningsCount += /** @type {number} */ (j.warningsCount);
}
}
return obj;
}
/**
* @param {(string | boolean | MultiStatsOptions)=} options stats options
* @returns {string} string output
*/
toString(options) {
const childOptions = this._createChildOptions(options, {
forToString: true
});
const results = this.stats.map((stat, idx) => {
const str = stat.toString(childOptions.children[idx]);
const compilationName = stat.compilation.name;
const name =
compilationName &&
identifierUtils
.makePathsRelative(
stat.compilation.compiler.context,
compilationName,
stat.compilation.compiler.root
)
.replace(/\|/g, " ");
if (!str) return str;
return name ? `${name}:\n${indent(str, " ")}` : str;
});
return results.filter(Boolean).join("\n\n");
}
}
module.exports = MultiStats;
@@ -0,0 +1 @@
Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json;
@@ -0,0 +1 @@
Prism.languages.pascal={directive:{pattern:/\{\$[\s\S]*?\}/,greedy:!0,alias:["marco","property"]},comment:{pattern:/\(\*[\s\S]*?\*\)|\{[\s\S]*?\}|\/\/.*/,greedy:!0},string:{pattern:/(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i,greedy:!0},asm:{pattern:/(\basm\b)[\s\S]+?(?=\bend\s*[;[])/i,lookbehind:!0,greedy:!0,inside:null},keyword:[{pattern:/(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:dispose|exit|false|new|true)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,lookbehind:!0}],number:[/(?:[&%]\d+|\$[a-f\d]+)/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:[/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/,{pattern:/(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,lookbehind:!0}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/},Prism.languages.pascal.asm.inside=Prism.languages.extend("pascal",{asm:void 0,keyword:void 0,operator:void 0}),Prism.languages.objectpascal=Prism.languages.pascal;
@@ -0,0 +1,108 @@
import { withScope, captureException } from '@sentry/browser';
import { isError } from '@sentry/core';
import { version } from 'react';
/**
* See if React major version is 17+ by parsing version string.
*/
function isAtLeastReact17(reactVersion) {
const reactMajor = reactVersion.match(/^([^.]+)/);
return reactMajor !== null && parseInt(reactMajor[0]) >= 17;
}
/**
* Recurse through `error.cause` chain to set cause on an error.
*/
function setCause(error, cause) {
const seenErrors = new WeakSet();
function recurse(error, cause) {
// If we've already seen the error, there is a recursive loop somewhere in the error's
// cause chain. Let's just bail out then to prevent a stack overflow.
if (seenErrors.has(error)) {
return;
}
if (error.cause) {
seenErrors.add(error);
return recurse(error.cause, cause);
}
error.cause = cause;
}
recurse(error, cause);
}
/**
* Captures an error that was thrown by a React ErrorBoundary or React root.
*
* @param error The error to capture.
* @param errorInfo The errorInfo provided by React.
* @param hint Optional additional data to attach to the Sentry event.
* @returns the id of the captured Sentry event.
*/
function captureReactException(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
error,
{ componentStack },
hint,
) {
// If on React version >= 17, create stack trace from componentStack param and links
// to to the original error using `error.cause` otherwise relies on error param for stacktrace.
// Linking errors requires the `LinkedErrors` integration be enabled.
// See: https://reactjs.org/blog/2020/08/10/react-v17-rc.html#native-component-stacks
//
// Although `componentDidCatch` is typed to accept an `Error` object, it can also be invoked
// with non-error objects. This is why we need to check if the error is an error-like object.
// See: https://github.com/getsentry/sentry-javascript/issues/6167
if (isAtLeastReact17(version) && isError(error) && componentStack) {
const errorBoundaryError = new Error(error.message);
errorBoundaryError.name = `React ErrorBoundary ${error.name}`;
errorBoundaryError.stack = componentStack;
// Using the `LinkedErrors` integration to link the errors together.
setCause(error, errorBoundaryError);
}
return withScope(scope => {
scope.setContext('react', { componentStack });
return captureException(error, hint);
});
}
/**
* Creates an error handler that can be used with the `onCaughtError`, `onUncaughtError`,
* and `onRecoverableError` options in `createRoot` and `hydrateRoot` React DOM methods.
*
* @param callback An optional callback that will be called after the error is captured.
* Use this to add custom handling for errors.
*
* @example
*
* ```JavaScript
* const root = createRoot(container, {
* onCaughtError: Sentry.reactErrorHandler(),
* onUncaughtError: Sentry.reactErrorHandler((error, errorInfo) => {
* console.warn('Caught error', error, errorInfo.componentStack);
* });
* });
* ```
*/
function reactErrorHandler(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
callback,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (error, errorInfo) => {
const hasCallback = !!callback;
const eventId = captureReactException(error, errorInfo, {
mechanism: { handled: hasCallback, type: 'auto.function.react.error_handler' },
});
if (hasCallback) {
callback(error, errorInfo, eventId);
}
};
}
export { captureReactException, isAtLeastReact17, reactErrorHandler, setCause };
//# sourceMappingURL=error.js.map
@@ -0,0 +1,32 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Sean Larkin @thelarkinn
*/
"use strict";
const WebpackError = require("./WebpackError");
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
/** @typedef {import("./Module")} Module */
class AsyncDependencyToInitialChunkError extends WebpackError {
/**
* Creates an instance of AsyncDependencyToInitialChunkError.
* @param {string} chunkName Name of Chunk
* @param {Module} module module tied to dependency
* @param {DependencyLocation} loc location of dependency
*/
constructor(chunkName, module, loc) {
super(
`It's not allowed to load an initial chunk on demand. The chunk name "${chunkName}" is already used by an entrypoint.`
);
/** @type {string} */
this.name = "AsyncDependencyToInitialChunkError";
this.module = module;
this.loc = loc;
}
}
module.exports = AsyncDependencyToInitialChunkError;
@@ -0,0 +1,206 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["б.з.д.", "б.з."],
abbreviated: ["б.з.д.", "б.з."],
wide: ["біздің заманымызға дейін", "біздің заманымыз"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-ші тоқ.", "2-ші тоқ.", "3-ші тоқ.", "4-ші тоқ."],
wide: ["1-ші тоқсан", "2-ші тоқсан", "3-ші тоқсан", "4-ші тоқсан"],
};
const monthValues = {
narrow: ["Қ", "А", "Н", "С", "М", "М", "Ш", "Т", "Қ", "Қ", "Қ", "Ж"],
abbreviated: [
"қаң",
"ақп",
"нау",
"сәу",
"мам",
"мау",
"шіл",
"там",
"қыр",
"қаз",
"қар",
"жел",
],
wide: [
"қаңтар",
"ақпан",
"наурыз",
"сәуір",
"мамыр",
"маусым",
"шілде",
"тамыз",
"қыркүйек",
"қазан",
"қараша",
"желтоқсан",
],
};
const formattingMonthValues = {
narrow: ["Қ", "А", "Н", "С", "М", "М", "Ш", "Т", "Қ", "Қ", "Қ", "Ж"],
abbreviated: [
"қаң",
"ақп",
"нау",
"сәу",
"мам",
"мау",
"шіл",
"там",
"қыр",
"қаз",
"қар",
"жел",
],
wide: [
"қаңтар",
"ақпан",
"наурыз",
"сәуір",
"мамыр",
"маусым",
"шілде",
"тамыз",
"қыркүйек",
"қазан",
"қараша",
"желтоқсан",
],
};
const dayValues = {
narrow: ["Ж", "Д", "С", "С", "Б", "Ж", "С"],
short: ["жс", "дс", "сс", "ср", "бс", "жм", "сб"],
abbreviated: ["жс", "дс", "сс", "ср", "бс", "жм", "сб"],
wide: [
"жексенбі",
"дүйсенбі",
"сейсенбі",
"сәрсенбі",
"бейсенбі",
"жұма",
"сенбі",
],
};
const dayPeriodValues = {
narrow: {
am: "ТД",
pm: "ТК",
midnight: "түн ортасы",
noon: "түс",
morning: "таң",
afternoon: "күндіз",
evening: "кеш",
night: "түн",
},
wide: {
am: "ТД",
pm: "ТК",
midnight: "түн ортасы",
noon: "түс",
morning: "таң",
afternoon: "күндіз",
evening: "кеш",
night: "түн",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ТД",
pm: "ТК",
midnight: "түн ортасында",
noon: "түс",
morning: "таң",
afternoon: "күн",
evening: "кеш",
night: "түн",
},
wide: {
am: "ТД",
pm: "ТК",
midnight: "түн ортасында",
noon: "түсте",
morning: "таңертең",
afternoon: "күндіз",
evening: "кеште",
night: "түнде",
},
};
const suffixes = {
0: "-ші",
1: "-ші",
2: "-ші",
3: "-ші",
4: "-ші",
5: "-ші",
6: "-шы",
7: "-ші",
8: "-ші",
9: "-шы",
10: "-шы",
20: "-шы",
30: "-шы",
40: "-шы",
50: "-ші",
60: "-шы",
70: "-ші",
80: "-ші",
90: "-шы",
100: "-ші",
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
const mod10 = number % 10;
const b = number >= 100 ? 100 : null;
const suffix =
suffixes[number] || suffixes[mod10] || (b && suffixes[b]) || "";
return number + suffix;
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "any",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};
@@ -0,0 +1,17 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {};
//# sourceMappingURL=types_internal.js.map
@@ -0,0 +1,607 @@
/**
*
* audit/server
*
*/
import { ressert, audit, extendedTypeof, AuditError } from './utils.mjs';
/**
* List of server audits required to check GraphQL over HTTP spec conformance.
*
* @category Audits
*/
export function serverAudits(opts) {
const fetchFn = (opts.fetchFn || fetch);
return [
// Media Types
audit(
// TODO: convert to MUST after watershed
'22EB', 'SHOULD accept application/graphql-response+json and match the content-type', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBe(200);
ressert(res)
.header('content-type')
.toContain('application/graphql-response+json');
}),
audit('4655', 'MUST accept application/json and match the content-type', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBe(200);
ressert(res).header('content-type').toContain('application/json');
}),
audit('47DE', 'SHOULD accept */* and use application/json for the content-type', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: '*/*',
},
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBe(200);
ressert(res).header('content-type').toContain('application/json');
}),
audit('80D8', 'SHOULD assume application/json content-type when accept is missing', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBe(200);
ressert(res).header('content-type').toContain('application/json');
}),
audit('82A3', 'MUST use utf-8 encoding when responding', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBe(200);
try {
const decoder = new TextDecoder('utf-8');
decoder.decode(await res.arrayBuffer());
}
catch (_a) {
throw new AuditError(res, 'Response body is not UTF-8 encoded');
}
}),
audit('BF61', 'MUST accept utf-8 encoded request', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json; charset=utf-8',
},
body: JSON.stringify({
query: '{ __type(name: "Run🏃Swim🏊") { name } }',
}),
});
ressert(res).status.toBe(200);
}),
audit('78D5', 'MUST assume utf-8 in request if encoding is unspecified', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBe(200);
}),
// Request
audit('2C94', 'MUST accept POST requests', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBe(200);
}),
audit('5A70', 'MAY accept application/x-www-form-urlencoded formatted GET requests', async () => {
const url = new URL(await getUrl(opts.url));
url.searchParams.set('query', '{ __typename }');
const res = await fetchFn(url.toString());
ressert(res).status.toBe(200);
}),
// Request GET
// TODO: this is a MUST if the server supports GET requests
audit('9C48', 'MAY NOT allow executing mutations on GET requests', async () => {
const url = new URL(await getUrl(opts.url));
url.searchParams.set('query', 'mutation { __typename }');
const res = await fetchFn(url.toString(), {
headers: {
accept: 'application/graphql-response+json',
},
});
ressert(res).status.toBeBetween(400, 499);
}),
// Request POST
audit('9ABE', 'MAY respond with 4xx status code if content-type is not supplied on POST requests', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
});
ressert(res).status.toBeBetween(400, 499);
}),
audit('03D4', 'MUST accept application/json POST requests', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ query: '{ __typename }' }),
});
ressert(res).status.toBe(200);
}),
audit('A5BF', 'MAY use 400 status code when request body is missing on POST', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: { 'content-type': 'application/json' },
});
ressert(res).status.toBe(400);
}),
// Request Parameters
audit('423L', 'MAY use 400 status code on missing {query} parameter', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({ notquery: '{ __typename }' }),
});
ressert(res).status.toBe(400);
}),
...[{ obj: 'ect' }, 0, false, ['array']].map((invalid, index) => audit(`LKJ${index}`, `MAY use 400 status code on ${extendedTypeof(invalid)} {query} parameter`, async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
query: invalid,
}),
});
ressert(res).status.toBe(400);
})),
audit(
// TODO: convert to MUST after watershed
'34A2', 'SHOULD allow string {query} parameter when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{ __typename }',
}),
});
ressert(res).status.toBe(200);
}),
audit('13EE', 'MUST allow string {query} parameter when accepting application/json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({
query: '{ __typename }',
}),
});
ressert(res).status.toBe(200);
await ressert(res).bodyAsExecutionResult.notToHaveProperty('errors');
}),
...[{ obj: 'ect' }, 0, false, ['array']].map((invalid, index) => audit(`6C0${index}`, `MAY use 400 status code on ${extendedTypeof(invalid)} {operationName} parameter`, async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
operationName: invalid,
query: '{ __typename }',
}),
});
ressert(res).status.toBe(400);
})),
audit(
// TODO: convert to MUST after watershed
'8161', 'SHOULD allow string {operationName} parameter when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
operationName: 'Query',
query: 'query Query { __typename }',
}),
});
ressert(res).status.toBe(200);
}),
audit('B8B3', 'MUST allow string {operationName} parameter when accepting application/json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({
operationName: 'Query',
query: 'query Query { __typename }',
}),
});
ressert(res).status.toBe(200);
await ressert(res).bodyAsExecutionResult.notToHaveProperty('errors');
}),
...['variables', 'operationName', 'extensions'].flatMap((parameter, index) => [
audit(`94B${index}`,
// TODO: convert to MUST after watershed
`SHOULD allow null {${parameter}} parameter when accepting application/graphql-response+json`, async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{ __typename }',
[parameter]: null,
}),
});
ressert(res).status.toBe(200);
await ressert(res).bodyAsExecutionResult.notToHaveProperty('errors');
}),
audit(`022${index}`, `MUST allow null {${parameter}} parameter when accepting application/json`, async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({
query: '{ __typename }',
[parameter]: null,
}),
});
ressert(res).status.toBe(200);
await ressert(res).bodyAsExecutionResult.notToHaveProperty('errors');
}),
]),
...['string', 0, false, ['array']].map((invalid, index) => audit(`476${index}`, `MAY use 400 status code on ${extendedTypeof(invalid)} {variables} parameter`, async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
query: '{ __typename }',
variables: invalid,
}),
});
ressert(res).status.toBe(400);
})),
audit(
// TODO: convert to MUST after watershed
'2EA1', 'SHOULD allow map {variables} parameter when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: 'query Type($name: String!) { __type(name: $name) { name } }',
variables: { name: 'sometype' },
}),
});
ressert(res).status.toBe(200);
}),
audit('28B9', 'MUST allow map {variables} parameter when accepting application/json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({
query: 'query Type($name: String!) { __type(name: $name) { name } }',
variables: { name: 'sometype' },
}),
});
ressert(res).status.toBe(200);
await ressert(res).bodyAsExecutionResult.notToHaveProperty('errors');
}),
audit('D6D5', 'MAY allow URL-encoded JSON string {variables} parameter in GETs when accepting application/graphql-response+json', async () => {
const url = new URL(await getUrl(opts.url));
url.searchParams.set('query', 'query Type($name: String!) { __type(name: $name) { name } }');
url.searchParams.set('variables', JSON.stringify({ name: 'sometype' }));
const res = await fetchFn(url.toString(), {
method: 'GET',
headers: {
accept: 'application/graphql-response+json',
},
});
ressert(res).status.toBe(200);
}),
audit('6A70', 'MAY allow URL-encoded JSON string {variables} parameter in GETs when accepting application/json', async () => {
const url = new URL(await getUrl(opts.url));
url.searchParams.set('query', 'query Type($name: String!) { __type(name: $name) { name } }');
url.searchParams.set('variables', JSON.stringify({ name: 'sometype' }));
const res = await fetchFn(url.toString(), {
method: 'GET',
headers: {
accept: 'application/json',
},
});
ressert(res).status.toBe(200);
await ressert(res).bodyAsExecutionResult.notToHaveProperty('errors');
}),
...['string', 0, false, ['array']].map((invalid, index) => audit(`58B${index}`,
// TODO: convert to MUST after watershed
`MAY use 400 status code on ${extendedTypeof(invalid)} {extensions} parameter`, async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
query: '{ __typename }',
extensions: invalid,
}),
});
ressert(res).status.toBe(400);
})),
audit(
// TODO: convert to MUST after watershed
'428F', 'SHOULD allow map {extensions} parameter when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{ __typename }',
extensions: { some: 'value' },
}),
});
ressert(res).status.toBe(200);
}),
audit('1B7A', 'MUST allow map {extensions} parameter when accepting application/json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({
query: '{ __typename }',
extensions: { some: 'value' },
}),
});
ressert(res).status.toBe(200);
await ressert(res).bodyAsExecutionResult.notToHaveProperty('errors');
}),
audit('B6DC', 'MAY use 4xx or 5xx status codes on JSON parsing failure', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: '{ "not a JSON',
});
ressert(res).status.toBeBetween(400, 499);
}),
audit('BCF8', 'MAY use 400 status code on JSON parsing failure', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: '{ "not a JSON',
});
ressert(res).status.toBe(400);
}),
audit('8764', 'MAY use 4xx or 5xx status codes if parameters are invalid', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
qeury /* typo */: '{ __typename }',
}),
});
ressert(res).status.toBeBetween(400, 599);
}),
audit('3E3A', 'MAY use 400 status code if parameters are invalid', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
qeury: /* typo */ '{ __typename }',
}),
});
ressert(res).status.toBe(400);
}),
// TODO: audit('39AA', 'MUST accept a map for the {extensions} parameter'),
// Response application/json
audit('572B', 'SHOULD use 200 status code on document parsing failure when accepting application/json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({ query: '{' }),
});
ressert(res).status.toBe(200);
}),
audit('FDE2', 'SHOULD use 200 status code on document validation failure when accepting application/json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({
query: '{ 8f31403dfe404bccbb0e835f2629c6a7 }', // making sure the field doesnt exist
}),
});
ressert(res).status.toBe(200);
}),
audit('7B9B', 'SHOULD use a status code of 200 on variable coercion failure when accepting application/json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/json',
},
body: JSON.stringify({
query: 'query CoerceFailure($id: ID!){ __typename }',
variables: { id: null },
}),
});
ressert(res).status.toBe(200);
}),
// Response application/graphql-response+json
audit(
// TODO: convert to MUST after watershed
'865D', 'SHOULD use 4xx or 5xx status codes on document parsing failure when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{',
}),
});
ressert(res).status.toBeBetween(400, 599);
}),
audit('556A', 'SHOULD use 400 status code on document parsing failure when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{',
}),
});
ressert(res).status.toBe(400);
}),
audit('D586', 'SHOULD not contain the data entry on document parsing failure when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{',
}),
});
await ressert(res).bodyAsExecutionResult.data.toBe(undefined);
}),
audit(
// TODO: convert to MUST after watershed
'51FE', 'SHOULD use 4xx or 5xx status codes on document validation failure when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{ 8f31403dfe404bccbb0e835f2629c6a7 }', // making sure the field doesnt exist
}),
});
ressert(res).status.toBeBetween(400, 599);
}),
audit('74FF', 'SHOULD use 400 status code on document validation failure when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{ 8f31403dfe404bccbb0e835f2629c6a7 }', // making sure the field doesnt exist
}),
});
ressert(res).status.toBe(400);
}),
audit('5E5B', 'SHOULD not contain the data entry on document validation failure when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: '{ 8f31403dfe404bccbb0e835f2629c6a7 }', // making sure the field doesnt exist
}),
});
await ressert(res).bodyAsExecutionResult.data.toBe(undefined);
}),
audit('86EE', 'SHOULD use a status code of 400 on variable coercion failure when accepting application/graphql-response+json', async () => {
const res = await fetchFn(await getUrl(opts.url), {
method: 'POST',
headers: {
'content-type': 'application/json',
accept: 'application/graphql-response+json',
},
body: JSON.stringify({
query: 'query CoerceFailure($id: ID!){ __typename }',
variables: { id: null },
}),
});
ressert(res).status.toBe(400);
}),
// TODO: how to fail and have the data entry?
// audit('EE52', 'MUST use 2xx status code if response contains the data entry and it is not null when accepting application/graphql-response+json'),
// TODO: how to make an unauthorized request?
// https://graphql.github.io/graphql-over-http/draft/#sel-EANNNDTAAEVBAAqqc
// audit('BC58', 'SHOULD use 401 or 403 status codes when the request is not permitted')
];
}
/**
* Performs the full list of server audits required for GraphQL over HTTP spec conformance.
*
* Please consult the `AuditResult` for more information.
*
* @category Audits
*/
export async function auditServer(opts) {
const audits = serverAudits(opts);
// audit tests will throw only on fatal errors, tests are contained within the AuditResult
return await Promise.all(audits.map(({ fn }) => fn()));
}
/** @private */
async function getUrl(url) {
if (typeof url === 'function') {
return await url();
}
return url;
}
@@ -0,0 +1,584 @@
# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg
[travis-url]: https://travis-ci.org/feross/safe-buffer
[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
[npm-url]: https://npmjs.org/package/safe-buffer
[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
[downloads-url]: https://npmjs.org/package/safe-buffer
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com
#### Safer Node.js Buffer API
**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,
`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**
**Uses the built-in implementation when available.**
## install
```
npm install safe-buffer
```
## usage
The goal of this package is to provide a safe replacement for the node.js `Buffer`.
It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
the top of your node.js modules:
```js
var Buffer = require('safe-buffer').Buffer
// Existing buffer code will continue to work without issues:
new Buffer('hey', 'utf8')
new Buffer([1, 2, 3], 'utf8')
new Buffer(obj)
new Buffer(16) // create an uninitialized buffer (potentially unsafe)
// But you can use these new explicit APIs to make clear what you want:
Buffer.from('hey', 'utf8') // convert from many types to a Buffer
Buffer.alloc(16) // create a zero-filled buffer (safe)
Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
```
## api
### Class Method: Buffer.from(array)
<!-- YAML
added: v3.0.0
-->
* `array` {Array}
Allocates a new `Buffer` using an `array` of octets.
```js
const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
// creates a new Buffer containing ASCII bytes
// ['b','u','f','f','e','r']
```
A `TypeError` will be thrown if `array` is not an `Array`.
### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
<!-- YAML
added: v5.10.0
-->
* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
a `new ArrayBuffer()`
* `byteOffset` {Number} Default: `0`
* `length` {Number} Default: `arrayBuffer.length - byteOffset`
When passed a reference to the `.buffer` property of a `TypedArray` instance,
the newly created `Buffer` will share the same allocated memory as the
TypedArray.
```js
const arr = new Uint16Array(2);
arr[0] = 5000;
arr[1] = 4000;
const buf = Buffer.from(arr.buffer); // shares the memory with arr;
console.log(buf);
// Prints: <Buffer 88 13 a0 0f>
// changing the TypedArray changes the Buffer also
arr[1] = 6000;
console.log(buf);
// Prints: <Buffer 88 13 70 17>
```
The optional `byteOffset` and `length` arguments specify a memory range within
the `arrayBuffer` that will be shared by the `Buffer`.
```js
const ab = new ArrayBuffer(10);
const buf = Buffer.from(ab, 0, 2);
console.log(buf.length);
// Prints: 2
```
A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
### Class Method: Buffer.from(buffer)
<!-- YAML
added: v3.0.0
-->
* `buffer` {Buffer}
Copies the passed `buffer` data onto a new `Buffer` instance.
```js
const buf1 = Buffer.from('buffer');
const buf2 = Buffer.from(buf1);
buf1[0] = 0x61;
console.log(buf1.toString());
// 'auffer'
console.log(buf2.toString());
// 'buffer' (copy is not changed)
```
A `TypeError` will be thrown if `buffer` is not a `Buffer`.
### Class Method: Buffer.from(str[, encoding])
<!-- YAML
added: v5.10.0
-->
* `str` {String} String to encode.
* `encoding` {String} Encoding to use, Default: `'utf8'`
Creates a new `Buffer` containing the given JavaScript string `str`. If
provided, the `encoding` parameter identifies the character encoding.
If not provided, `encoding` defaults to `'utf8'`.
```js
const buf1 = Buffer.from('this is a tést');
console.log(buf1.toString());
// prints: this is a tést
console.log(buf1.toString('ascii'));
// prints: this is a tC)st
const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
console.log(buf2.toString());
// prints: this is a tést
```
A `TypeError` will be thrown if `str` is not a string.
### Class Method: Buffer.alloc(size[, fill[, encoding]])
<!-- YAML
added: v5.10.0
-->
* `size` {Number}
* `fill` {Value} Default: `undefined`
* `encoding` {String} Default: `utf8`
Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
`Buffer` will be *zero-filled*.
```js
const buf = Buffer.alloc(5);
console.log(buf);
// <Buffer 00 00 00 00 00>
```
The `size` must be less than or equal to the value of
`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
be created if a `size` less than or equal to 0 is specified.
If `fill` is specified, the allocated `Buffer` will be initialized by calling
`buf.fill(fill)`. See [`buf.fill()`][] for more information.
```js
const buf = Buffer.alloc(5, 'a');
console.log(buf);
// <Buffer 61 61 61 61 61>
```
If both `fill` and `encoding` are specified, the allocated `Buffer` will be
initialized by calling `buf.fill(fill, encoding)`. For example:
```js
const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
console.log(buf);
// <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
```
Calling `Buffer.alloc(size)` can be significantly slower than the alternative
`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
contents will *never contain sensitive data*.
A `TypeError` will be thrown if `size` is not a number.
### Class Method: Buffer.allocUnsafe(size)
<!-- YAML
added: v5.10.0
-->
* `size` {Number}
Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
thrown. A zero-length Buffer will be created if a `size` less than or equal to
0 is specified.
The underlying memory for `Buffer` instances created in this way is *not
initialized*. The contents of the newly created `Buffer` are unknown and
*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
`Buffer` instances to zeroes.
```js
const buf = Buffer.allocUnsafe(5);
console.log(buf);
// <Buffer 78 e0 82 02 01>
// (octets will be different, every time)
buf.fill(0);
console.log(buf);
// <Buffer 00 00 00 00 00>
```
A `TypeError` will be thrown if `size` is not a number.
Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
size `Buffer.poolSize` that is used as a pool for the fast allocation of new
`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
`new Buffer(size)` constructor) only when `size` is less than or equal to
`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
value of `Buffer.poolSize` is `8192` but can be modified.
Use of this pre-allocated internal memory pool is a key difference between
calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
difference is subtle but can be important when an application requires the
additional performance that `Buffer.allocUnsafe(size)` provides.
### Class Method: Buffer.allocUnsafeSlow(size)
<!-- YAML
added: v5.10.0
-->
* `size` {Number}
Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
`size` must be less than or equal to the value of
`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
be created if a `size` less than or equal to 0 is specified.
The underlying memory for `Buffer` instances created in this way is *not
initialized*. The contents of the newly created `Buffer` are unknown and
*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
`Buffer` instances to zeroes.
When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
allocations under 4KB are, by default, sliced from a single pre-allocated
`Buffer`. This allows applications to avoid the garbage collection overhead of
creating many individually allocated Buffers. This approach improves both
performance and memory usage by eliminating the need to track and cleanup as
many `Persistent` objects.
However, in the case where a developer may need to retain a small chunk of
memory from a pool for an indeterminate amount of time, it may be appropriate
to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
copy out the relevant bits.
```js
// need to keep around a few small chunks of memory
const store = [];
socket.on('readable', () => {
const data = socket.read();
// allocate for retained data
const sb = Buffer.allocUnsafeSlow(10);
// copy the data into the new allocation
data.copy(sb, 0, 0, 10);
store.push(sb);
});
```
Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
a developer has observed undue memory retention in their applications.
A `TypeError` will be thrown if `size` is not a number.
### All the Rest
The rest of the `Buffer` API is exactly the same as in node.js.
[See the docs](https://nodejs.org/api/buffer.html).
## Related links
- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
## Why is `Buffer` unsafe?
Today, the node.js `Buffer` constructor is overloaded to handle many different argument
types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
`ArrayBuffer`, and also `Number`.
The API is optimized for convenience: you can throw any type at it, and it will try to do
what you want.
Because the Buffer constructor is so powerful, you often see code like this:
```js
// Convert UTF-8 strings to hex
function toHex (str) {
return new Buffer(str).toString('hex')
}
```
***But what happens if `toHex` is called with a `Number` argument?***
### Remote Memory Disclosure
If an attacker can make your program call the `Buffer` constructor with a `Number`
argument, then they can make it allocate uninitialized memory from the node.js process.
This could potentially disclose TLS private keys, user data, or database passwords.
When the `Buffer` constructor is passed a `Number` argument, it returns an
**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
this, you **MUST** overwrite the contents before returning it to the user.
From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
> `new Buffer(size)`
>
> - `size` Number
>
> The underlying memory for `Buffer` instances created in this way is not initialized.
> **The contents of a newly created `Buffer` are unknown and could contain sensitive
> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
(Emphasis our own.)
Whenever the programmer intended to create an uninitialized `Buffer` you often see code
like this:
```js
var buf = new Buffer(16)
// Immediately overwrite the uninitialized buffer with data from another buffer
for (var i = 0; i < buf.length; i++) {
buf[i] = otherBuf[i]
}
```
### Would this ever be a problem in real code?
Yes. It's surprisingly common to forget to check the type of your variables in a
dynamically-typed language like JavaScript.
Usually the consequences of assuming the wrong type is that your program crashes with an
uncaught exception. But the failure mode for forgetting to check the type of arguments to
the `Buffer` constructor is more catastrophic.
Here's an example of a vulnerable service that takes a JSON payload and converts it to
hex:
```js
// Take a JSON payload {str: "some string"} and convert it to hex
var server = http.createServer(function (req, res) {
var data = ''
req.setEncoding('utf8')
req.on('data', function (chunk) {
data += chunk
})
req.on('end', function () {
var body = JSON.parse(data)
res.end(new Buffer(body.str).toString('hex'))
})
})
server.listen(8080)
```
In this example, an http client just has to send:
```json
{
"str": 1000
}
```
and it will get back 1,000 bytes of uninitialized memory from the server.
This is a very serious bug. It's similar in severity to the
[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
memory by remote attackers.
### Which real-world packages were vulnerable?
#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
[Mathias Buus](https://github.com/mafintosh) and I
([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
Here's
[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
that fixed it. We released a new fixed version, created a
[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
vulnerable versions on npm so users will get a warning to upgrade to a newer version.
#### [`ws`](https://www.npmjs.com/package/ws)
That got us wondering if there were other vulnerable packages. Sure enough, within a short
period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
most popular WebSocket implementation in node.js.
If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
expected, then uninitialized server memory would be disclosed to the remote peer.
These were the vulnerable methods:
```js
socket.send(number)
socket.ping(number)
socket.pong(number)
```
Here's a vulnerable socket server with some echo functionality:
```js
server.on('connection', function (socket) {
socket.on('message', function (message) {
message = JSON.parse(message)
if (message.type === 'echo') {
socket.send(message.data) // send back the user's message
}
})
})
```
`socket.send(number)` called on the server, will disclose server memory.
Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
was fixed, with a more detailed explanation. Props to
[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
### What's the solution?
It's important that node.js offers a fast way to get memory otherwise performance-critical
applications would needlessly get a lot slower.
But we need a better way to *signal our intent* as programmers. **When we want
uninitialized memory, we should request it explicitly.**
Sensitive functionality should not be packed into a developer-friendly API that loosely
accepts many different types. This type of API encourages the lazy practice of passing
variables in without checking the type very carefully.
#### A new API: `Buffer.allocUnsafe(number)`
The functionality of creating buffers with uninitialized memory should be part of another
API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
frequently gets user input of all sorts of different types passed into it.
```js
var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
// Immediately overwrite the uninitialized buffer with data from another buffer
for (var i = 0; i < buf.length; i++) {
buf[i] = otherBuf[i]
}
```
### How do we fix node.js core?
We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
`semver-major`) which defends against one case:
```js
var str = 16
new Buffer(str, 'utf8')
```
In this situation, it's implied that the programmer intended the first argument to be a
string, since they passed an encoding as a second argument. Today, node.js will allocate
uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
what the programmer intended.
But this is only a partial solution, since if the programmer does `new Buffer(variable)`
(without an `encoding` parameter) there's no way to know what they intended. If `variable`
is sometimes a number, then uninitialized memory will sometimes be returned.
### What's the real long-term fix?
We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
we need uninitialized memory. But that would break 1000s of packages.
~~We believe the best solution is to:~~
~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
#### Update
We now support adding three new APIs:
- `Buffer.from(value)` - convert from any type to a buffer
- `Buffer.alloc(size)` - create a zero-filled buffer
- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
This solves the core problem that affected `ws` and `bittorrent-dht` which is
`Buffer(variable)` getting tricked into taking a number argument.
This way, existing code continues working and the impact on the npm ecosystem will be
minimal. Over time, npm maintainers can migrate performance-critical code to use
`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
### Conclusion
We think there's a serious design issue with the `Buffer` API as it exists today. It
promotes insecure software by putting high-risk functionality into a convenient API
with friendly "developer ergonomics".
This wasn't merely a theoretical exercise because we found the issue in some of the
most popular npm packages.
Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
`buffer`.
```js
var Buffer = require('safe-buffer').Buffer
```
Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
the impact on the ecosystem would be minimal since it's not a breaking change.
Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
older, insecure packages would magically become safe from this attack vector.
## links
- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
## credit
The original issues in `bittorrent-dht`
([disclosure](https://nodesecurity.io/advisories/68)) and
`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
[Mathias Buus](https://github.com/mafintosh) and
[Feross Aboukhadijeh](http://feross.org/).
Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
and for his work running the [Node Security Project](https://nodesecurity.io/).
Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
auditing the code.
## license
MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
@@ -0,0 +1,67 @@
module.exports = {
'chunk': require('./chunk'),
'compact': require('./compact'),
'concat': require('./concat'),
'difference': require('./difference'),
'differenceBy': require('./differenceBy'),
'differenceWith': require('./differenceWith'),
'drop': require('./drop'),
'dropRight': require('./dropRight'),
'dropRightWhile': require('./dropRightWhile'),
'dropWhile': require('./dropWhile'),
'fill': require('./fill'),
'findIndex': require('./findIndex'),
'findLastIndex': require('./findLastIndex'),
'first': require('./first'),
'flatten': require('./flatten'),
'flattenDeep': require('./flattenDeep'),
'flattenDepth': require('./flattenDepth'),
'fromPairs': require('./fromPairs'),
'head': require('./head'),
'indexOf': require('./indexOf'),
'initial': require('./initial'),
'intersection': require('./intersection'),
'intersectionBy': require('./intersectionBy'),
'intersectionWith': require('./intersectionWith'),
'join': require('./join'),
'last': require('./last'),
'lastIndexOf': require('./lastIndexOf'),
'nth': require('./nth'),
'pull': require('./pull'),
'pullAll': require('./pullAll'),
'pullAllBy': require('./pullAllBy'),
'pullAllWith': require('./pullAllWith'),
'pullAt': require('./pullAt'),
'remove': require('./remove'),
'reverse': require('./reverse'),
'slice': require('./slice'),
'sortedIndex': require('./sortedIndex'),
'sortedIndexBy': require('./sortedIndexBy'),
'sortedIndexOf': require('./sortedIndexOf'),
'sortedLastIndex': require('./sortedLastIndex'),
'sortedLastIndexBy': require('./sortedLastIndexBy'),
'sortedLastIndexOf': require('./sortedLastIndexOf'),
'sortedUniq': require('./sortedUniq'),
'sortedUniqBy': require('./sortedUniqBy'),
'tail': require('./tail'),
'take': require('./take'),
'takeRight': require('./takeRight'),
'takeRightWhile': require('./takeRightWhile'),
'takeWhile': require('./takeWhile'),
'union': require('./union'),
'unionBy': require('./unionBy'),
'unionWith': require('./unionWith'),
'uniq': require('./uniq'),
'uniqBy': require('./uniqBy'),
'uniqWith': require('./uniqWith'),
'unzip': require('./unzip'),
'unzipWith': require('./unzipWith'),
'without': require('./without'),
'xor': require('./xor'),
'xorBy': require('./xorBy'),
'xorWith': require('./xorWith'),
'zip': require('./zip'),
'zipObject': require('./zipObject'),
'zipObjectDeep': require('./zipObjectDeep'),
'zipWith': require('./zipWith')
};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Anton Medvedev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,532 @@
declare const status: {
103: "Checkpoint";
"103_NAME": "CHECKPOINT";
"103_MESSAGE": "Used in the resumable requests proposal to resume aborted PUT or POST requests.";
"103_CLASS": "1xx";
CHECKPOINT: 103;
419: "Page Expired";
"419_NAME": "PAGE_EXPIRED";
"419_MESSAGE": "Used by the Laravel Framework when a CSRF Token is missing or expired.";
"419_CLASS": "4xx";
PAGE_EXPIRED: 419;
218: "This is fine";
"218_NAME": "THIS_IS_FINE";
"218_MESSAGE": "Used as a catch-all error condition for allowing response bodies to flow through Apache when ProxyErrorOverride is enabled. When ProxyErrorOverride is enabled in Apache, response bodies that contain a status code of 4xx or 5xx are automatically discarded by Apache in favor of a generic response or a custom response specified by the ErrorDocument directive.";
"218_CLASS": "2xx";
THIS_IS_FINE: 218;
420: "Enhance Your Calm";
"420_NAME": "ENHANCE_YOUR_CALM";
"420_MESSAGE": "Returned by version 1 of the Twitter Search and Trends API when the client is being rate limited; versions 1.1 and later use the 429 Too Many Requests response code instead.";
"420_CLASS": "4xx";
ENHANCE_YOUR_CALM: 420;
450: "Blocked by Windows Parental Controls";
"450_NAME": "BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS";
"450_MESSAGE": "The Microsoft extension code indicated when Windows Parental Controls are turned on and are blocking access to the requested webpage.";
"450_CLASS": "4xx";
BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS: 450;
498: "Invalid Token";
"498_NAME": "INVALID_TOKEN";
"498_MESSAGE": "Returned by ArcGIS for Server. Code 498 indicates an expired or otherwise invalid token.";
"498_CLASS": "4xx";
INVALID_TOKEN: 498;
499: "Token Required";
"499_NAME": "TOKEN_REQUIRED";
"499_MESSAGE": "Returned by ArcGIS for Server. Code 499 indicates that a token is required but was not submitted.";
"499_CLASS": "4xx";
TOKEN_REQUIRED: 499;
509: "Bandwidth Limit Exceeded";
"509_NAME": "BANDWIDTH_LIMIT_EXCEEDED";
"509_MESSAGE": "The server has exceeded the bandwidth specified by the server administrator.";
"509_CLASS": "5xx";
BANDWIDTH_LIMIT_EXCEEDED: 509;
530: "Site is frozen";
"530_NAME": "SITE_IS_FROZEN";
"530_MESSAGE": "Used by the Pantheon web platform to indicate a site that has been frozen due to inactivity.";
"530_CLASS": "5xx";
SITE_IS_FROZEN: 530;
598: "Network read timeout error";
"598_NAME": "NETWORK_READ_TIMEOUT_ERROR";
"598_MESSAGE": "Used by some HTTP proxies to signal a network read timeout behind the proxy to a client in front of the proxy.";
"598_CLASS": "5xx";
NETWORK_READ_TIMEOUT_ERROR: 598;
classes: {
readonly "1xx": "Informational";
readonly "1xx_NAME": "INFORMATIONAL";
readonly "1xx_MESSAGE": "Indicates an interim response for communicating connection status or request progress prior to completing the requested action and sending a final response.";
readonly INFORMATIONAL: "1xx";
readonly "2xx": "Successful";
readonly "2xx_NAME": "SUCCESSFUL";
readonly "2xx_MESSAGE": "Indicates that the client's request was successfully received, understood, and accepted.";
readonly SUCCESSFUL: "2xx";
readonly "3xx": "Redirection";
readonly "3xx_NAME": "REDIRECTION";
readonly "3xx_MESSAGE": "Indicates that further action needs to be taken by the user agent in order to fulfill the request.";
readonly REDIRECTION: "3xx";
readonly "4xx": "Client Error";
readonly "4xx_NAME": "CLIENT_ERROR";
readonly "4xx_MESSAGE": "Indicates that the client seems to have erred.";
readonly CLIENT_ERROR: "4xx";
readonly "5xx": "Server Error";
readonly "5xx_NAME": "SERVER_ERROR";
readonly "5xx_MESSAGE": "Indicates that the server is aware that it has erred or is incapable of performing the requested method.";
readonly SERVER_ERROR: "5xx";
};
100: "Continue";
"100_NAME": "CONTINUE";
"100_MESSAGE": "The server has received the request headers and the client should proceed to send the request body.";
"100_CLASS": "1xx";
CONTINUE: 100;
101: "Switching Protocols";
"101_NAME": "SWITCHING_PROTOCOLS";
"101_MESSAGE": "The requester has asked the server to switch protocols and the server has agreed to do so.";
"101_CLASS": "1xx";
SWITCHING_PROTOCOLS: 101;
102: "Processing";
"102_NAME": "PROCESSING";
"102_MESSAGE": "A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request. This code indicates that the server has received and is processing the request, but no response is available yet.[7] This prevents the client from timing out and assuming the request was lost.";
"102_CLASS": "1xx";
PROCESSING: 102;
EARLY_HINTS: 103;
200: "OK";
"200_NAME": "OK";
"200_MESSAGE": "Standard response for successful HTTP requests.";
"200_CLASS": "2xx";
OK: 200;
201: "Created";
"201_NAME": "CREATED";
"201_MESSAGE": "The request has been fulfilled, resulting in the creation of a new resource.";
"201_CLASS": "2xx";
CREATED: 201;
202: "Accepted";
"202_NAME": "ACCEPTED";
"202_MESSAGE": "The request has been accepted for processing, but the processing has not been completed.";
"202_CLASS": "2xx";
ACCEPTED: 202;
203: "Non-Authoritative Information";
"203_NAME": "NON_AUTHORITATIVE_INFORMATION";
"203_MESSAGE": "The server is a transforming proxy (e.g. a Web accelerator) that received a 200 OK from its origin, but is returning a modified version of the origin's response.";
"203_CLASS": "2xx";
NON_AUTHORITATIVE_INFORMATION: 203;
204: "No Content";
"204_NAME": "NO_CONTENT";
"204_MESSAGE": "The server successfully processed the request and is not returning any content.";
"204_CLASS": "2xx";
NO_CONTENT: 204;
205: "Reset Content";
"205_NAME": "RESET_CONTENT";
"205_MESSAGE": "The server successfully processed the request, but is not returning any content. Unlike a 204 response, this response requires that the requester reset the document view.";
"205_CLASS": "2xx";
RESET_CONTENT: 205;
206: "Partial Content";
"206_NAME": "PARTIAL_CONTENT";
"206_MESSAGE": "The server is delivering only part of the resource (byte serving) due to a range header sent by the client.";
"206_CLASS": "2xx";
PARTIAL_CONTENT: 206;
207: "Multi Status";
"207_NAME": "MULTI_STATUS";
"207_MESSAGE": "The message body that follows is by default an XML message and can contain a number of separate response codes, depending on how many sub-requests were made.";
"207_CLASS": "2xx";
MULTI_STATUS: 207;
208: "Already Reported";
"208_NAME": "ALREADY_REPORTED";
"208_MESSAGE": "The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response, and are not being included again.";
"208_CLASS": "2xx";
ALREADY_REPORTED: 208;
226: "IM Used";
"226_NAME": "IM_USED";
"226_MESSAGE": "The server has fulfilled a request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.";
"226_CLASS": "2xx";
IM_USED: 226;
300: "Multiple Choices";
"300_NAME": "MULTIPLE_CHOICES";
"300_MESSAGE": "Indicates multiple options for the resource from which the client may choose.";
"300_CLASS": "3xx";
MULTIPLE_CHOICES: 300;
301: "Moved Permanently";
"301_NAME": "MOVED_PERMANENTLY";
"301_MESSAGE": "This and all future requests should be directed to the given URI.";
"301_CLASS": "3xx";
MOVED_PERMANENTLY: 301;
302: "Found";
"302_NAME": "FOUND";
"302_MESSAGE": "This is an example of industry practice contradicting the standard. The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect (the original describing phrase was \"Moved Temporarily\"), but popular browsers implemented 302 with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours.";
"302_CLASS": "3xx";
FOUND: 302;
303: "See Other";
"303_NAME": "SEE_OTHER";
"303_MESSAGE": "The response to the request can be found under another URI using the GET method.";
"303_CLASS": "3xx";
SEE_OTHER: 303;
304: "Not Modified";
"304_NAME": "NOT_MODIFIED";
"304_MESSAGE": "Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.";
"304_CLASS": "3xx";
NOT_MODIFIED: 304;
305: "Use Proxy";
"305_NAME": "USE_PROXY";
"305_MESSAGE": "The requested resource is available only through a proxy, the address for which is provided in the response.";
"305_CLASS": "3xx";
USE_PROXY: 305;
306: "Switch Proxy";
"306_NAME": "SWITCH_PROXY";
"306_MESSAGE": "No longer used. Originally meant \"Subsequent requests should use the specified proxy.";
"306_CLASS": "3xx";
SWITCH_PROXY: 306;
307: "Temporary Redirect";
"307_NAME": "TEMPORARY_REDIRECT";
"307_MESSAGE": "In this case, the request should be repeated with another URI; however, future requests should still use the original URI.";
"307_CLASS": "3xx";
TEMPORARY_REDIRECT: 307;
308: "Permanent Redirect";
"308_NAME": "PERMANENT_REDIRECT";
"308_MESSAGE": "The request and all future requests should be repeated using another URI.";
"308_CLASS": "3xx";
PERMANENT_REDIRECT: 308;
400: "Bad Request";
"400_NAME": "BAD_REQUEST";
"400_MESSAGE": "The server cannot or will not process the request due to an apparent client error.";
"400_CLASS": "4xx";
BAD_REQUEST: 400;
401: "Unauthorized";
"401_NAME": "UNAUTHORIZED";
"401_MESSAGE": "Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.";
"401_CLASS": "4xx";
UNAUTHORIZED: 401;
402: "Payment Required";
"402_NAME": "PAYMENT_REQUIRED";
"402_MESSAGE": "Reserved for future use. The original intention was that this code might be used as part of some form of digital cash or micropayment scheme, as proposed for example by GNU Taler, but that has not yet happened, and this code is not usually used.";
"402_CLASS": "4xx";
PAYMENT_REQUIRED: 402;
403: "Forbidden";
"403_NAME": "FORBIDDEN";
"403_MESSAGE": "The request was valid, but the server is refusing action.";
"403_CLASS": "4xx";
FORBIDDEN: 403;
404: "Not Found";
"404_NAME": "NOT_FOUND";
"404_MESSAGE": "The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.";
"404_CLASS": "4xx";
NOT_FOUND: 404;
405: "Method Not Allowed";
"405_NAME": "METHOD_NOT_ALLOWED";
"405_MESSAGE": "A request method is not supported for the requested resource.";
"405_CLASS": "4xx";
METHOD_NOT_ALLOWED: 405;
406: "Not Acceptable";
"406_NAME": "NOT_ACCEPTABLE";
"406_MESSAGE": "The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.";
"406_CLASS": "4xx";
NOT_ACCEPTABLE: 406;
407: "Proxy Authentication Required";
"407_NAME": "PROXY_AUTHENTICATION_REQUIRED";
"407_MESSAGE": "The client must first authenticate itself with the proxy.";
"407_CLASS": "4xx";
PROXY_AUTHENTICATION_REQUIRED: 407;
408: "Request Time-out";
"408_NAME": "REQUEST_TIMEOUT";
"408_MESSAGE": "The server timed out waiting for the request.";
"408_CLASS": "4xx";
REQUEST_TIMEOUT: 408;
409: "Conflict";
"409_NAME": "CONFLICT";
"409_MESSAGE": "Indicates that the request could not be processed because of conflict in the request, such as an edit conflict between multiple simultaneous updates.";
"409_CLASS": "4xx";
CONFLICT: 409;
410: "Gone";
"410_NAME": "GONE";
"410_MESSAGE": "Indicates that the resource requested is no longer available and will not be available again.";
"410_CLASS": "4xx";
GONE: 410;
411: "Length Required";
"411_NAME": "LENGTH_REQUIRED";
"411_MESSAGE": "The request did not specify the length of its content, which is required by the requested resource.";
"411_CLASS": "4xx";
LENGTH_REQUIRED: 411;
412: "Precondition Failed";
"412_NAME": "PRECONDITION_FAILED";
"412_MESSAGE": "The server does not meet one of the preconditions that the requester put on the request.";
"412_CLASS": "4xx";
PRECONDITION_FAILED: 412;
413: "Request Entity Too Large";
"413_NAME": "REQUEST_ENTITY_TOO_LARGE";
"413_MESSAGE": "The request is larger than the server is willing or able to process. Previously called \"Request Entity Too Large\".";
"413_CLASS": "4xx";
REQUEST_ENTITY_TOO_LARGE: 413;
414: "Request-URI Too Large";
"414_NAME": "REQUEST_URI_TOO_LONG";
"414_MESSAGE": "The URI provided was too long for the server to process.";
"414_CLASS": "4xx";
REQUEST_URI_TOO_LONG: 414;
415: "Unsupported Media Type";
"415_NAME": "UNSUPPORTED_MEDIA_TYPE";
"415_MESSAGE": "The request entity has a media type which the server or resource does not support.";
"415_CLASS": "4xx";
UNSUPPORTED_MEDIA_TYPE: 415;
416: "Requested Range not Satisfiable";
"416_NAME": "REQUESTED_RANGE_NOT_SATISFIABLE";
"416_MESSAGE": "The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.";
"416_CLASS": "4xx";
REQUESTED_RANGE_NOT_SATISFIABLE: 416;
417: "Expectation Failed";
"417_NAME": "EXPECTATION_FAILED";
"417_MESSAGE": "The server cannot meet the requirements of the Expect request-header field.";
"417_CLASS": "4xx";
EXPECTATION_FAILED: 417;
418: "I'm a teapot";
"418_NAME": "IM_A_TEAPOT";
"418_MESSAGE": "Any attempt to brew coffee with a teapot should result in the error code \"418 I'm a teapot\". The resulting entity body MAY be short and stout.";
"418_CLASS": "4xx";
IM_A_TEAPOT: 418;
421: "Misdirected Request";
"421_NAME": "MISDIRECTED_REQUEST";
"421_MESSAGE": "The request was directed at a server that is not able to produce a response.";
"421_CLASS": "4xx";
MISDIRECTED_REQUEST: 421;
422: "Unprocessable Entity";
"422_NAME": "UNPROCESSABLE_ENTITY";
"422_MESSAGE": "The request was well-formed but was unable to be followed due to semantic errors.";
"422_CLASS": "4xx";
UNPROCESSABLE_ENTITY: 422;
423: "Locked";
"423_NAME": "LOCKED";
"423_MESSAGE": "The resource that is being accessed is locked.";
"423_CLASS": "4xx";
LOCKED: 423;
424: "Failed Dependency";
"424_NAME": "FAILED_DEPENDENCY";
"424_MESSAGE": "The request failed because it depended on another request and that request failed.";
"424_CLASS": "4xx";
FAILED_DEPENDENCY: 424;
425: "Too Early";
"425_NAME": "TOO_EARLY";
"425_MESSAGE": "The server is unwilling to risk processing a request that might be replayed.";
"425_CLASS": "4xx";
TOO_EARLY: 425;
426: "Upgrade Required";
"426_NAME": "UPGRADE_REQUIRED";
"426_MESSAGE": "The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.";
"426_CLASS": "4xx";
UPGRADE_REQUIRED: 426;
428: "Precondition Required";
"428_NAME": "PRECONDITION_REQUIRED";
"428_MESSAGE": "The origin server requires the request to be conditional.";
"428_CLASS": "4xx";
PRECONDITION_REQUIRED: 428;
429: "Too Many Requests";
"429_NAME": "TOO_MANY_REQUESTS";
"429_MESSAGE": "The user has sent too many requests in a given amount of time.";
"429_CLASS": "4xx";
TOO_MANY_REQUESTS: 429;
431: "Request Header Fields Too Large";
"431_NAME": "REQUEST_HEADER_FIELDS_TOO_LARGE";
"431_MESSAGE": "The server is unwilling to process the request because either an individual header field, or all the header fields collectively, are too large.";
"431_CLASS": "4xx";
REQUEST_HEADER_FIELDS_TOO_LARGE: 431;
451: "Unavailable For Legal Reasons";
"451_NAME": "UNAVAILABLE_FOR_LEGAL_REASONS";
"451_MESSAGE": "A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.";
"451_CLASS": "4xx";
UNAVAILABLE_FOR_LEGAL_REASONS: 451;
500: "Internal Server Error";
"500_NAME": "INTERNAL_SERVER_ERROR";
"500_MESSAGE": "A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.";
"500_CLASS": "5xx";
INTERNAL_SERVER_ERROR: 500;
501: "Not Implemented";
"501_NAME": "NOT_IMPLEMENTED";
"501_MESSAGE": "The server either does not recognize the request method, or it lacks the ability to fulfil the request. Usually this implies future availability.";
"501_CLASS": "5xx";
NOT_IMPLEMENTED: 501;
502: "Bad Gateway";
"502_NAME": "BAD_GATEWAY";
"502_MESSAGE": "The server was acting as a gateway or proxy and received an invalid response from the upstream server.";
"502_CLASS": "5xx";
BAD_GATEWAY: 502;
503: "Service Unavailable";
"503_NAME": "SERVICE_UNAVAILABLE";
"503_MESSAGE": "The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.";
"503_CLASS": "5xx";
SERVICE_UNAVAILABLE: 503;
504: "Gateway Time-out";
"504_NAME": "GATEWAY_TIMEOUT";
"504_MESSAGE": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.";
"504_CLASS": "5xx";
GATEWAY_TIMEOUT: 504;
505: "HTTP Version not Supported";
"505_NAME": "HTTP_VERSION_NOT_SUPPORTED";
"505_MESSAGE": "The server does not support the HTTP protocol version used in the request.";
"505_CLASS": "5xx";
HTTP_VERSION_NOT_SUPPORTED: 505;
506: "Variant Also Negotiates";
"506_NAME": "VARIANT_ALSO_NEGOTIATES";
"506_MESSAGE": "Transparent content negotiation for the request results in a circular reference.";
"506_CLASS": "5xx";
VARIANT_ALSO_NEGOTIATES: 506;
507: "Insufficient Storage";
"507_NAME": "INSUFFICIENT_STORAGE";
"507_MESSAGE": "The server is unable to store the representation needed to complete the request.";
"507_CLASS": "5xx";
INSUFFICIENT_STORAGE: 507;
508: "Loop Detected";
"508_NAME": "LOOP_DETECTED";
"508_MESSAGE": "The server detected an infinite loop while processing the request.";
"508_CLASS": "5xx";
LOOP_DETECTED: 508;
510: "Not Extended";
"510_NAME": "NOT_EXTENDED";
"510_MESSAGE": "Further extensions to the request are required for the server to fulfil it.";
"510_CLASS": "5xx";
NOT_EXTENDED: 510;
511: "Network Authentication Required";
"511_NAME": "NETWORK_AUTHENTICATION_REQUIRED";
"511_MESSAGE": "The client needs to authenticate to gain network access. Intended for use by intercepting proxies used to control access to the network.";
"511_CLASS": "5xx";
NETWORK_AUTHENTICATION_REQUIRED: 511;
extra: {
readonly unofficial: {
readonly 103: "Checkpoint";
readonly "103_NAME": "CHECKPOINT";
readonly "103_MESSAGE": "Used in the resumable requests proposal to resume aborted PUT or POST requests.";
readonly "103_CLASS": "1xx";
readonly CHECKPOINT: 103;
readonly 419: "Page Expired";
readonly "419_NAME": "PAGE_EXPIRED";
readonly "419_MESSAGE": "Used by the Laravel Framework when a CSRF Token is missing or expired.";
readonly "419_CLASS": "4xx";
readonly PAGE_EXPIRED: 419;
readonly 218: "This is fine";
readonly "218_NAME": "THIS_IS_FINE";
readonly "218_MESSAGE": "Used as a catch-all error condition for allowing response bodies to flow through Apache when ProxyErrorOverride is enabled. When ProxyErrorOverride is enabled in Apache, response bodies that contain a status code of 4xx or 5xx are automatically discarded by Apache in favor of a generic response or a custom response specified by the ErrorDocument directive.";
readonly "218_CLASS": "2xx";
readonly THIS_IS_FINE: 218;
readonly 420: "Enhance Your Calm";
readonly "420_NAME": "ENHANCE_YOUR_CALM";
readonly "420_MESSAGE": "Returned by version 1 of the Twitter Search and Trends API when the client is being rate limited; versions 1.1 and later use the 429 Too Many Requests response code instead.";
readonly "420_CLASS": "4xx";
readonly ENHANCE_YOUR_CALM: 420;
readonly 450: "Blocked by Windows Parental Controls";
readonly "450_NAME": "BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS";
readonly "450_MESSAGE": "The Microsoft extension code indicated when Windows Parental Controls are turned on and are blocking access to the requested webpage.";
readonly "450_CLASS": "4xx";
readonly BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS: 450;
readonly 498: "Invalid Token";
readonly "498_NAME": "INVALID_TOKEN";
readonly "498_MESSAGE": "Returned by ArcGIS for Server. Code 498 indicates an expired or otherwise invalid token.";
readonly "498_CLASS": "4xx";
readonly INVALID_TOKEN: 498;
readonly 499: "Token Required";
readonly "499_NAME": "TOKEN_REQUIRED";
readonly "499_MESSAGE": "Returned by ArcGIS for Server. Code 499 indicates that a token is required but was not submitted.";
readonly "499_CLASS": "4xx";
readonly TOKEN_REQUIRED: 499;
readonly 509: "Bandwidth Limit Exceeded";
readonly "509_NAME": "BANDWIDTH_LIMIT_EXCEEDED";
readonly "509_MESSAGE": "The server has exceeded the bandwidth specified by the server administrator.";
readonly "509_CLASS": "5xx";
readonly BANDWIDTH_LIMIT_EXCEEDED: 509;
readonly 530: "Site is frozen";
readonly "530_NAME": "SITE_IS_FROZEN";
readonly "530_MESSAGE": "Used by the Pantheon web platform to indicate a site that has been frozen due to inactivity.";
readonly "530_CLASS": "5xx";
readonly SITE_IS_FROZEN: 530;
readonly 598: "Network read timeout error";
readonly "598_NAME": "NETWORK_READ_TIMEOUT_ERROR";
readonly "598_MESSAGE": "Used by some HTTP proxies to signal a network read timeout behind the proxy to a client in front of the proxy.";
readonly "598_CLASS": "5xx";
readonly NETWORK_READ_TIMEOUT_ERROR: 598;
};
readonly iis: {
readonly 440: "Login Time-out";
readonly "440_NAME": "LOGIN_TIME_OUT";
readonly "440_MESSAGE": "The client's session has expired and must log in again.";
readonly "440_CLASS": "4xx";
readonly LOGIN_TIME_OUT: 440;
readonly 449: "Retry With";
readonly "449_NAME": "RETRY_WITH";
readonly "449_MESSAGE": "The server cannot honour the request because the user has not provided the required information.";
readonly "449_CLASS": "4xx";
readonly RETRY_WITH: 449;
readonly 451: "Redirect";
readonly "451_NAME": "REDIRECT";
readonly "451_MESSAGE": "Used in Exchange ActiveSync when either a more efficient server is available or the server cannot access the users' mailbox.";
readonly "451_CLASS": "4xx";
readonly REDIRECT: 451;
};
readonly nginx: {
readonly 444: "No Response";
readonly "444_NAME": "NO_RESPONSE";
readonly "444_MESSAGE": "Used internally to instruct the server to return no information to the client and close the connection immediately.";
readonly "444_CLASS": "4xx";
readonly NO_RESPONSE: 444;
readonly 494: "Request header too large";
readonly "494_NAME": "REQUEST_HEADER_TOO_LARGE";
readonly "494_MESSAGE": "Client sent too large request or too long header line.";
readonly "494_CLASS": "4xx";
readonly REQUEST_HEADER_TOO_LARGE: 494;
readonly 495: "SSL Certificate Error";
readonly "495_NAME": "SSL_CERTIFICATE_ERROR";
readonly "495_MESSAGE": "An expansion of the 400 Bad Request response code, used when the client has provided an invalid client certificate.";
readonly "495_CLASS": "4xx";
readonly SSL_CERTIFICATE_ERROR: 495;
readonly 496: "SSL Certificate Required";
readonly "496_NAME": "SSL_CERTIFICATE_REQUIRED";
readonly "496_MESSAGE": "An expansion of the 400 Bad Request response code, used when a client certificate is required but not provided.";
readonly "496_CLASS": "4xx";
readonly SSL_CERTIFICATE_REQUIRED: 496;
readonly 497: "HTTP Request Sent to HTTPS Port";
readonly "497_NAME": "HTTP_REQUEST_SENT_TO_HTTPS_PORT";
readonly "497_MESSAGE": "An expansion of the 400 Bad Request response code, used when the client has made a HTTP request to a port listening for HTTPS requests.";
readonly "497_CLASS": "4xx";
readonly HTTP_REQUEST_SENT_TO_HTTPS_PORT: 497;
readonly 499: "Client Closed Request";
readonly "499_NAME": "CLIENT_CLOSED_REQUEST";
readonly "499_MESSAGE": "Used when the client has closed the request before the server could send a response.";
readonly "499_CLASS": "4xx";
readonly CLIENT_CLOSED_REQUEST: 499;
};
readonly cloudflare: {
readonly 520: "Unknown Error";
readonly "520_NAME": "UNKNOWN_ERROR";
readonly "520_MESSAGE": "The 520 error is used as a \"catch-all response for when the origin server returns something unexpected\", listing connection resets, large headers, and empty or invalid responses as common triggers.";
readonly "520_CLASS": "5xx";
readonly UNKNOWN_ERROR: 520;
readonly 521: "Web Server Is Down";
readonly "521_NAME": "WEB_SERVER_IS_DOWN";
readonly "521_MESSAGE": "The origin server has refused the connection from Cloudflare.";
readonly "521_CLASS": "5xx";
readonly WEB_SERVER_IS_DOWN: 521;
readonly 522: "Connection Timed Out";
readonly "522_NAME": "CONNECTION_TIMED_OUT";
readonly "522_MESSAGE": "Cloudflare could not negotiate a TCP handshake with the origin server.";
readonly "522_CLASS": "5xx";
readonly CONNECTION_TIMED_OUT: 522;
readonly 523: "Origin Is Unreachable";
readonly "523_NAME": "ORIGIN_IS_UNREACHABLE";
readonly "523_MESSAGE": "Cloudflare could not reach the origin server.";
readonly "523_CLASS": "5xx";
readonly ORIGIN_IS_UNREACHABLE: 523;
readonly 524: "A Timeout Occurred";
readonly "524_NAME": "A_TIMEOUT_OCCURRED";
readonly "524_MESSAGE": "Cloudflare was able to complete a TCP connection to the origin server, but did not receive a timely HTTP response.";
readonly "524_CLASS": "5xx";
readonly A_TIMEOUT_OCCURRED: 524;
readonly 525: "SSL Handshake Failed";
readonly "525_NAME": "SSL_HANDSHAKE_FAILED";
readonly "525_MESSAGE": "Cloudflare could not negotiate a SSL/TLS handshake with the origin server.";
readonly "525_CLASS": "5xx";
readonly SSL_HANDSHAKE_FAILED: 525;
readonly 526: "Invalid SSL Certificate";
readonly "526_NAME": "INVALID_SSL_CERTIFICATE";
readonly "526_MESSAGE": "Cloudflare could not validate the SSL/TLS certificate that the origin server presented.";
readonly "526_CLASS": "5xx";
readonly INVALID_SSL_CERTIFICATE: 526;
readonly 527: "Railgun Error";
readonly "527_NAME": "RAILGUN_ERROR";
readonly "527_MESSAGE": "Error 527 indicates that the request timed out or failed after the WAN connection had been established.";
readonly "527_CLASS": "5xx";
readonly RAILGUN_ERROR: 527;
};
};
};
export { status as default, status };
@@ -0,0 +1 @@
{"version":3,"file":"equal-not.js","sources":["../../../src/icons/equal-not.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name EqualNot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iNSIgeDI9IjE5IiB5MT0iOSIgeTI9IjkiIC8+CiAgPGxpbmUgeDE9IjUiIHgyPSIxOSIgeTE9IjE1IiB5Mj0iMTUiIC8+CiAgPGxpbmUgeDE9IjE5IiB4Mj0iNSIgeTE9IjUiIHkyPSIxOSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/equal-not\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 EqualNot = createLucideIcon('EqualNot', [\n ['line', { x1: '5', x2: '19', y1: '9', y2: '9', key: '1nwqeh' }],\n ['line', { x1: '5', x2: '19', y1: '15', y2: '15', key: 'g8yjpy' }],\n ['line', { x1: '19', x2: '5', y1: '5', y2: '19', key: '1x9vlm' }],\n]);\n\nexport default EqualNot;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC/D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,9 @@
/**
* 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{DecoratorNode as t}from"lexical";class r extends t{constructor(t,r){super(r),this.__format=t||""}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(t){const r=this.getWritable();return r.__format=t,r}isInline(){return!1}}function e(t){return t instanceof r}export{e as $isDecoratorBlockNode,r as DecoratorBlockNode};
@@ -0,0 +1,198 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('../../currentScopes.js');
const semanticAttributes = require('../../semanticAttributes.js');
const trace = require('../../tracing/trace.js');
const attributeExtraction = require('./attributeExtraction.js');
const attributes = require('./attributes.js');
const methodConfig = require('./methodConfig.js');
const piiFiltering = require('./piiFiltering.js');
const sessionExtraction = require('./sessionExtraction.js');
/**
* Span creation and management functions for MCP server instrumentation
*
* Provides unified span creation following OpenTelemetry MCP semantic conventions and our opinitionated take on MCP.
* Handles both request and notification spans with attribute extraction.
*/
/**
* Creates a span name based on the method and target
* @internal
* @param method - MCP method name
* @param target - Optional target identifier
* @returns Formatted span name
*/
function createSpanName(method, target) {
return target ? `${method} ${target}` : method;
}
/**
* Build Sentry-specific attributes based on span type
* @internal
* @param type - Span type configuration
* @returns Sentry-specific attributes
*/
function buildSentryAttributes(type) {
let op;
let origin;
switch (type) {
case 'request':
op = attributes.MCP_SERVER_OP_VALUE;
origin = attributes.MCP_FUNCTION_ORIGIN_VALUE;
break;
case 'notification-incoming':
op = attributes.MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE;
origin = attributes.MCP_NOTIFICATION_ORIGIN_VALUE;
break;
case 'notification-outgoing':
op = attributes.MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE;
origin = attributes.MCP_NOTIFICATION_ORIGIN_VALUE;
break;
}
return {
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin,
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: attributes.MCP_ROUTE_SOURCE_VALUE,
};
}
/**
* Unified builder for creating MCP spans
* @internal
* @param config - Span configuration
* @returns Created span
*/
function createMcpSpan(config) {
const { type, message, transport, extra, callback, options } = config;
const { method } = message;
const params = message.params;
// Determine span name based on type and OTEL conventions
let spanName;
if (type === 'request') {
const targetInfo = methodConfig.extractTargetInfo(method, params || {});
spanName = createSpanName(method, targetInfo.target);
} else {
// For notifications, use method name directly per OpenTelemetry conventions
spanName = method;
}
const rawAttributes = {
...sessionExtraction.buildTransportAttributes(transport, extra),
[attributes.MCP_METHOD_NAME_ATTRIBUTE]: method,
...attributeExtraction.buildTypeSpecificAttributes(type, message, params, options?.recordInputs),
...buildSentryAttributes(type),
};
const client = currentScopes.getClient();
const sendDefaultPii = Boolean(client?.getOptions().sendDefaultPii);
const attributes$1 = piiFiltering.filterMcpPiiFromSpanData(rawAttributes, sendDefaultPii) ;
return trace.startSpan(
{
name: spanName,
forceTransaction: true,
attributes: attributes$1,
},
callback,
);
}
/**
* Creates a span for incoming MCP notifications
* @param jsonRpcMessage - Notification message
* @param transport - MCP transport instance
* @param extra - Extra handler data
* @param options - Resolved MCP options
* @param callback - Span execution callback
* @returns Span execution result
*/
function createMcpNotificationSpan(
jsonRpcMessage,
transport,
extra,
options,
callback,
) {
return createMcpSpan({
type: 'notification-incoming',
message: jsonRpcMessage,
transport,
extra,
callback,
options,
});
}
/**
* Creates a span for outgoing MCP notifications
* @param jsonRpcMessage - Notification message
* @param transport - MCP transport instance
* @param options - Resolved MCP options
* @param callback - Span execution callback
* @returns Span execution result
*/
function createMcpOutgoingNotificationSpan(
jsonRpcMessage,
transport,
options,
callback,
) {
return createMcpSpan({
type: 'notification-outgoing',
message: jsonRpcMessage,
transport,
options,
callback,
});
}
/**
* Builds span configuration for MCP server requests
* @param jsonRpcMessage - Request message
* @param transport - MCP transport instance
* @param extra - Optional extra handler data
* @param options - Resolved MCP options
* @returns Span configuration object
*/
function buildMcpServerSpanConfig(
jsonRpcMessage,
transport,
extra,
options,
)
{
const { method } = jsonRpcMessage;
const params = jsonRpcMessage.params;
const targetInfo = methodConfig.extractTargetInfo(method, params || {});
const spanName = createSpanName(method, targetInfo.target);
const rawAttributes = {
...sessionExtraction.buildTransportAttributes(transport, extra),
[attributes.MCP_METHOD_NAME_ATTRIBUTE]: method,
...attributeExtraction.buildTypeSpecificAttributes('request', jsonRpcMessage, params, options?.recordInputs),
...buildSentryAttributes('request'),
};
const client = currentScopes.getClient();
const sendDefaultPii = Boolean(client?.getOptions().sendDefaultPii);
const attributes$1 = piiFiltering.filterMcpPiiFromSpanData(rawAttributes, sendDefaultPii) ;
return {
name: spanName,
op: attributes.MCP_SERVER_OP_VALUE,
forceTransaction: true,
attributes: attributes$1,
};
}
exports.buildMcpServerSpanConfig = buildMcpServerSpanConfig;
exports.createMcpNotificationSpan = createMcpNotificationSpan;
exports.createMcpOutgoingNotificationSpan = createMcpOutgoingNotificationSpan;
//# sourceMappingURL=spans.js.map

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