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,5 @@
var assertClassBrand = require("./assertClassBrand.js");
function _classPrivateSetter(s, r, a, t) {
return r(assertClassBrand(s, a), t), t;
}
module.exports = _classPrivateSetter, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,7 @@
/**
* Email adapter interface. Allows a generic type for the response of the sendEmail method.
*
* This is the interface to use if you are creating a new email adapter.
*/ export { };
//# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"drama.js","sources":["../../../src/icons/drama.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Drama\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMTFoLjAxIiAvPgogIDxwYXRoIGQ9Ik0xNCA2aC4wMSIgLz4KICA8cGF0aCBkPSJNMTggNmguMDEiIC8+CiAgPHBhdGggZD0iTTYuNSAxMy4xaC4wMSIgLz4KICA8cGF0aCBkPSJNMjIgNWMwIDktNCAxMi02IDEycy02LTMtNi0xMmMwLTIgMi0zIDYtM3M2IDEgNiAzIiAvPgogIDxwYXRoIGQ9Ik0xNy40IDkuOWMtLjguOC0yIC44LTIuOCAwIiAvPgogIDxwYXRoIGQ9Ik0xMC4xIDcuMUM5IDcuMiA3LjcgNy43IDYgOC42Yy0zLjUgMi00LjcgMy45LTMuNyA1LjYgNC41IDcuOCA5LjUgOC40IDExLjIgNy40LjktLjUgMS45LTIuMSAxLjktNC43IiAvPgogIDxwYXRoIGQ9Ik05LjEgMTYuNWMuMy0xLjEgMS40LTEuNyAyLjQtMS40IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/drama\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 Drama = createLucideIcon('Drama', [\n ['path', { d: 'M10 11h.01', key: 'd2at3l' }],\n ['path', { d: 'M14 6h.01', key: 'k028ub' }],\n ['path', { d: 'M18 6h.01', key: '1v4wsw' }],\n ['path', { d: 'M6.5 13.1h.01', key: '1748ia' }],\n ['path', { d: 'M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3', key: '172yzv' }],\n ['path', { d: 'M17.4 9.9c-.8.8-2 .8-2.8 0', key: '1obv0w' }],\n [\n 'path',\n {\n d: 'M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7',\n key: 'rqjl8i',\n },\n ],\n ['path', { d: 'M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4', key: '1mr6wy' }],\n]);\n\nexport default Drama;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAClF,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,CAC3D,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,12 @@
import type { StaticLabel } from 'payload';
import React from 'react';
import './index.scss';
export type SortColumnProps = {
readonly appearance?: 'condensed' | 'default';
readonly disable?: boolean;
readonly Label: React.ReactNode;
readonly label?: StaticLabel;
readonly name: string;
};
export declare const SortColumn: React.FC<SortColumnProps>;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,120 @@
import { withMonitor, captureException } from '@sentry/core';
import { replaceCronNames } from './common.js';
const ERROR_TEXT = 'Automatic instrumentation of CronJob only supports crontab string';
/**
* Instruments the `cron` library to send a check-in event to Sentry for each job execution.
*
* ```ts
* import * as Sentry from '@sentry/node';
* import { CronJob } from 'cron';
*
* const CronJobWithCheckIn = Sentry.cron.instrumentCron(CronJob, 'my-cron-job');
*
* // use the constructor
* const job = new CronJobWithCheckIn('* * * * *', () => {
* console.log('You will see this message every minute');
* });
*
* // or from
* const job = CronJobWithCheckIn.from({ cronTime: '* * * * *', onTick: () => {
* console.log('You will see this message every minute');
* });
* ```
*/
function instrumentCron(lib, monitorSlug) {
let jobScheduled = false;
return new Proxy(lib, {
construct(target, args) {
const [cronTime, onTick, onComplete, start, timeZone, ...rest] = args;
if (typeof cronTime !== 'string') {
throw new Error(ERROR_TEXT);
}
if (jobScheduled) {
throw new Error(`A job named '${monitorSlug}' has already been scheduled`);
}
jobScheduled = true;
const cronString = replaceCronNames(cronTime);
async function monitoredTick(context, onComplete) {
return withMonitor(
monitorSlug,
async () => {
try {
await onTick(context, onComplete);
} catch (e) {
captureException(e, {
mechanism: {
handled: false,
type: 'auto.function.cron.instrumentCron',
},
});
throw e;
}
},
{
schedule: { type: 'crontab', value: cronString },
timezone: timeZone || undefined,
},
);
}
return new target(cronTime, monitoredTick, onComplete, start, timeZone, ...rest);
},
get(target, prop) {
if (prop === 'from') {
return (param) => {
const { cronTime, onTick, timeZone } = param;
if (typeof cronTime !== 'string') {
throw new Error(ERROR_TEXT);
}
if (jobScheduled) {
throw new Error(`A job named '${monitorSlug}' has already been scheduled`);
}
jobScheduled = true;
const cronString = replaceCronNames(cronTime);
param.onTick = async (context, onComplete) => {
return withMonitor(
monitorSlug,
async () => {
try {
await onTick(context, onComplete);
} catch (e) {
captureException(e, {
mechanism: {
handled: false,
type: 'auto.function.cron.instrumentCron',
},
});
throw e;
}
},
{
schedule: { type: 'crontab', value: cronString },
timezone: timeZone || undefined,
},
);
};
return target.from(param);
};
} else {
return target[prop];
}
},
});
}
export { instrumentCron };
//# sourceMappingURL=cron.js.map
@@ -0,0 +1,119 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)(-?[врмт][и])?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((пр)?н\.?\s?е\.?)/i,
abbreviated: /^((пр)?н\.?\s?е\.?)/i,
wide: /^(пред нашата ера|нашата ера)/i,
};
const parseEraPatterns = {
any: [/^п/i, /^н/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234](-?[врт]?и?)? кв.?/i,
wide: /^[1234](-?[врт]?и?)? квартал/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchDayPatterns = {
narrow: /^[нпвсч]/i,
short: /^(не|по|вт|ср|че|пе|са)/i,
abbreviated: /^(нед|пон|вто|сре|чет|пет|саб)/i,
wide: /^(недела|понеделник|вторник|среда|четврток|петок|сабота)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[аб]/i],
};
const matchMonthPatterns = {
abbreviated: /^(јан|фев|мар|апр|мај|јун|јул|авг|сеп|окт|ноем|дек)/i,
wide: /^(јануари|февруари|март|април|мај|јуни|јули|август|септември|октомври|ноември|декември)/i,
};
const parseMonthPatterns = {
any: [
/^ја/i,
/^Ф/i,
/^мар/i,
/^ап/i,
/^мај/i,
/^јун/i,
/^јул/i,
/^ав/i,
/^се/i,
/^окт/i,
/^но/i,
/^де/i,
],
};
const matchDayPeriodPatterns = {
any: /^(претп|попл|полноќ|утро|пладне|вечер|ноќ)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /претпладне/i,
pm: /попладне/i,
midnight: /полноќ/i,
noon: /напладне/i,
morning: /наутро/i,
afternoon: /попладне/i,
evening: /навечер/i,
night: /ноќе/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-2025 HackerOne Inc and individual contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,10 @@
"use strict";
exports.endOfISOWeekYear = void 0;
var _index = require("../endOfISOWeekYear.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const endOfISOWeekYear = (exports.endOfISOWeekYear = (0, _index2.convertToFP)(
_index.endOfISOWeekYear,
1,
));
@@ -0,0 +1,8 @@
import { down } from './down.js';
import { up } from './up.js';
export declare const localizeStatus: {
down: typeof down;
up: typeof up;
};
export type { LocalizeStatusArgs } from './up.js';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,97 @@
name: CI
on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
dependency-review:
name: Dependency Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Dependency review
uses: actions/dependency-review-action@v3
test:
name: Test
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
node-version: [18, 20, 22]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Restore cached dependencies
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package.json') }}
- name: Install dependencies
run: npm i --ignore-scripts
- name: Run Tests
run: npm run test-ci
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2.1.2
with:
github-token: ${{ secrets.github_token }}
parallel: true
flag-name: run-${{ matrix.node-version }}-${{ matrix.os }}
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
automerge:
name: Automerge Dependabot PRs
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs: test
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './plug-zap.js';
//# sourceMappingURL=plug-zap-2.js.map
@@ -0,0 +1 @@
Prism.languages.prolog={comment:{pattern:/\/\*[\s\S]*?\*\/|%.*/,greedy:!0},string:{pattern:/(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1(?!\1)/,greedy:!0},builtin:/\b(?:fx|fy|xf[xy]?|yfx?)\b/,function:/\b[a-z]\w*(?:(?=\()|\/\d+)/,number:/\b\d+(?:\.\d*)?/,operator:/[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,punctuation:/[(){}\[\],]/};
@@ -0,0 +1,14 @@
@import '../../scss/styles';
@layer payload-default {
.icon--drag-handle {
height: $baseline;
width: $baseline;
.fill {
stroke: currentColor;
stroke-width: $style-stroke-width-s;
fill: var(--theme-elevation-800);
}
}
}
@@ -0,0 +1,18 @@
/**
* @name minutesToSeconds
* @category Conversion Helpers
* @summary Convert minutes to seconds.
*
* @description
* Convert a number of minutes to a full number of seconds.
*
* @param minutes - The number of minutes to be converted
*
* @returns The number of minutes converted in seconds
*
* @example
* // Convert 2 minutes to seconds
* const result = minutesToSeconds(2)
* //=> 120
*/
export declare function minutesToSeconds(minutes: number): number;
@@ -0,0 +1,209 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { SyncWaterfallHook } = require("tapable");
const Compilation = require("../Compilation");
const Generator = require("../Generator");
const { tryRunOrWebpackError } = require("../HookWebpackError");
const { WEBASSEMBLY_MODULE_TYPE_ASYNC } = require("../ModuleTypeConstants");
const WebAssemblyImportDependency = require("../dependencies/WebAssemblyImportDependency");
const { compareModulesByFullName } = require("../util/comparators");
const memoize = require("../util/memoize");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
/** @typedef {import("../CodeGenerationResults")} CodeGenerationResults */
/** @typedef {import("../Compiler")} Compiler */
/** @typedef {import("../DependencyTemplates")} DependencyTemplates */
/** @typedef {import("../Module")} Module */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
/** @typedef {import("../WebpackError")} WebpackError */
const getAsyncWebAssemblyGenerator = memoize(() =>
require("./AsyncWebAssemblyGenerator")
);
const getAsyncWebAssemblyJavascriptGenerator = memoize(() =>
require("./AsyncWebAssemblyJavascriptGenerator")
);
const getAsyncWebAssemblyParser = memoize(() =>
require("./AsyncWebAssemblyParser")
);
/**
* @typedef {object} WebAssemblyRenderContext
* @property {Chunk} chunk the chunk
* @property {DependencyTemplates} dependencyTemplates the dependency templates
* @property {RuntimeTemplate} runtimeTemplate the runtime template
* @property {ModuleGraph} moduleGraph the module graph
* @property {ChunkGraph} chunkGraph the chunk graph
* @property {CodeGenerationResults} codeGenerationResults results of code generation
*/
/**
* @typedef {object} CompilationHooks
* @property {SyncWaterfallHook<[Source, Module, WebAssemblyRenderContext]>} renderModuleContent
*/
/**
* @typedef {object} AsyncWebAssemblyModulesPluginOptions
* @property {boolean=} mangleImports mangle imports
*/
/** @type {WeakMap<Compilation, CompilationHooks>} */
const compilationHooksMap = new WeakMap();
const PLUGIN_NAME = "AsyncWebAssemblyModulesPlugin";
class AsyncWebAssemblyModulesPlugin {
/**
* @param {Compilation} compilation the compilation
* @returns {CompilationHooks} the attached hooks
*/
static getCompilationHooks(compilation) {
if (!(compilation instanceof Compilation)) {
throw new TypeError(
"The 'compilation' argument must be an instance of Compilation"
);
}
let hooks = compilationHooksMap.get(compilation);
if (hooks === undefined) {
hooks = {
renderModuleContent: new SyncWaterfallHook([
"source",
"module",
"renderContext"
])
};
compilationHooksMap.set(compilation, hooks);
}
return hooks;
}
/**
* @param {AsyncWebAssemblyModulesPluginOptions} options options
*/
constructor(options) {
/** @type {AsyncWebAssemblyModulesPluginOptions} */
this.options = options;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
const hooks =
AsyncWebAssemblyModulesPlugin.getCompilationHooks(compilation);
compilation.dependencyFactories.set(
WebAssemblyImportDependency,
normalModuleFactory
);
normalModuleFactory.hooks.createParser
.for(WEBASSEMBLY_MODULE_TYPE_ASYNC)
.tap(PLUGIN_NAME, () => {
const AsyncWebAssemblyParser = getAsyncWebAssemblyParser();
return new AsyncWebAssemblyParser();
});
normalModuleFactory.hooks.createGenerator
.for(WEBASSEMBLY_MODULE_TYPE_ASYNC)
.tap(PLUGIN_NAME, () => {
const AsyncWebAssemblyJavascriptGenerator =
getAsyncWebAssemblyJavascriptGenerator();
const AsyncWebAssemblyGenerator = getAsyncWebAssemblyGenerator();
return Generator.byType({
javascript: new AsyncWebAssemblyJavascriptGenerator(),
webassembly: new AsyncWebAssemblyGenerator(this.options)
});
});
compilation.hooks.renderManifest.tap(PLUGIN_NAME, (result, options) => {
const { moduleGraph, chunkGraph, runtimeTemplate } = compilation;
const {
chunk,
outputOptions,
dependencyTemplates,
codeGenerationResults
} = options;
for (const module of chunkGraph.getOrderedChunkModulesIterable(
chunk,
compareModulesByFullName(compiler)
)) {
if (module.type === WEBASSEMBLY_MODULE_TYPE_ASYNC) {
const filenameTemplate = outputOptions.webassemblyModuleFilename;
result.push({
render: () =>
this.renderModule(
module,
{
chunk,
dependencyTemplates,
runtimeTemplate,
moduleGraph,
chunkGraph,
codeGenerationResults
},
hooks
),
filenameTemplate,
pathOptions: {
module,
runtime: chunk.runtime,
chunkGraph
},
auxiliary: true,
identifier: `webassemblyAsyncModule${chunkGraph.getModuleId(
module
)}`,
hash: chunkGraph.getModuleHash(module, chunk.runtime)
});
}
}
return result;
});
}
);
}
/**
* @param {Module} module the rendered module
* @param {WebAssemblyRenderContext} renderContext options object
* @param {CompilationHooks} hooks hooks
* @returns {Source} the newly generated source from rendering
*/
renderModule(module, renderContext, hooks) {
const { codeGenerationResults, chunk } = renderContext;
try {
const moduleSource = codeGenerationResults.getSource(
module,
chunk.runtime,
"webassembly"
);
return tryRunOrWebpackError(
() =>
hooks.renderModuleContent.call(moduleSource, module, renderContext),
"AsyncWebAssemblyModulesPlugin.getCompilationHooks().renderModuleContent"
);
} catch (err) {
/** @type {WebpackError} */ (err).module = module;
throw err;
}
}
}
module.exports = AsyncWebAssemblyModulesPlugin;
@@ -0,0 +1 @@
{"version":3,"file":"globalUnhandledRejection.d.ts","sourceRoot":"","sources":["../../../src/instrument/globalUnhandledRejection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAM/E;;;;;GAKG;AACH,wBAAgB,iDAAiD,CAC/D,OAAO,EAAE,CAAC,IAAI,EAAE,6BAA6B,KAAK,IAAI,GACrD,IAAI,CAIN"}
@@ -0,0 +1,7 @@
import { RestCommand } from "../types.js";
//#region src/rest/helpers/with-token.d.ts
declare function withToken<Schema, Output>(token: string, getOptions: RestCommand<Output, Schema>): RestCommand<Output, Schema>;
//#endregion
export { withToken };
//# sourceMappingURL=with-token.d.ts.map
@@ -0,0 +1,6 @@
/**
* Sets the async context strategy to use follow the OTEL context under the hood.
* We handle forking a hub inside of our custom OTEL Context Manager (./otelContextManager.ts)
*/
export declare function setOpenTelemetryContextAsyncContextStrategy(): void;
//# sourceMappingURL=asyncContextStrategy.d.ts.map
@@ -0,0 +1,15 @@
var isObject = require('./isObject');
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
module.exports = isStrictComparable;
@@ -0,0 +1,74 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { CLEAR_EDITOR_COMMAND, $getRoot, $getSelection, $createParagraphNode, $isRangeSelection, COMMAND_PRIORITY_EDITOR } from 'lexical';
import { useLayoutEffect, useEffect } from 'react';
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
// This workaround is no longer necessary in React 19,
// but we currently support React >=17.x
// https://github.com/facebook/react/pull/26395
const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect;
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
function ClearEditorPlugin({
onClear
}) {
const [editor] = useLexicalComposerContext();
useLayoutEffectImpl(() => {
return editor.registerCommand(CLEAR_EDITOR_COMMAND, payload => {
editor.update(() => {
if (onClear == null) {
const root = $getRoot();
const selection = $getSelection();
const paragraph = $createParagraphNode();
root.clear();
root.append(paragraph);
if (selection !== null) {
paragraph.select();
}
if ($isRangeSelection(selection)) {
selection.format = 0;
}
} else {
onClear();
}
});
return true;
}, COMMAND_PRIORITY_EDITOR);
}, [editor, onClear]);
return null;
}
export { ClearEditorPlugin };
@@ -0,0 +1 @@
{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAUlD,CAAA"}
@@ -0,0 +1,29 @@
"use strict";
exports.it = void 0;
var _index = require("./it/_lib/formatDistance.js");
var _index2 = require("./it/_lib/formatLong.js");
var _index3 = require("./it/_lib/formatRelative.js");
var _index4 = require("./it/_lib/localize.js");
var _index5 = require("./it/_lib/match.js");
/**
* @category Locales
* @summary Italian locale.
* @language Italian
* @iso-639-2 ita
* @author Alberto Restifo [@albertorestifo](https://github.com/albertorestifo)
* @author Giovanni Polimeni [@giofilo](https://github.com/giofilo)
* @author Vincenzo Carrese [@vin-car](https://github.com/vin-car)
*/
const it = (exports.it = {
code: "it",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const PanelRightClose = createLucideIcon("PanelRightClose", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M15 3v18", key: "14nvp0" }],
["path", { d: "m8 9 3 3-3 3", key: "12hl5m" }]
]);
export { PanelRightClose as default };
//# sourceMappingURL=panel-right-close.js.map
@@ -0,0 +1,119 @@
import { _INTERNAL_safeMathRandom } from '@sentry/core';
/**
* Generates a random tunnel route path that's less likely to be blocked by ad-blockers
*/
function generateRandomTunnelRoute() {
// Generate a random 8-character alphanumeric string
const randomString = _INTERNAL_safeMathRandom().toString(36).substring(2, 10);
return `/${randomString}`;
}
/**
* Resolves the tunnel route based on the user's configuration and the environment.
* @param tunnelRoute - The user-provided tunnel route option
*/
function resolveTunnelRoute(tunnelRoute) {
if (process.env.__SENTRY_TUNNEL_ROUTE__) {
// Reuse cached value from previous build (server/client)
return process.env.__SENTRY_TUNNEL_ROUTE__;
}
const resolvedTunnelRoute = typeof tunnelRoute === 'string' ? tunnelRoute : generateRandomTunnelRoute();
// Cache for subsequent builds (only during build time)
// Turbopack runs the config twice, so we need a shared context to avoid generating a new tunnel route for each build.
// env works well here
// https://linear.app/getsentry/issue/JS-549/adblock-plus-blocking-requests-to-sentry-and-monitoring-tunnel
if (resolvedTunnelRoute) {
process.env.__SENTRY_TUNNEL_ROUTE__ = resolvedTunnelRoute;
}
return resolvedTunnelRoute;
}
/**
* Injects rewrite rules into the Next.js config provided by the user to tunnel
* requests from the `tunnelPath` to Sentry.
*
* See https://nextjs.org/docs/api-reference/next.config.js/rewrites.
*/
function setUpTunnelRewriteRules(userNextConfig, tunnelPath) {
const originalRewrites = userNextConfig.rewrites;
// Allow overriding the tunnel destination for E2E tests via environment variable
const destinationOverride = process.env._SENTRY_TUNNEL_DESTINATION_OVERRIDE;
// Make sure destinations are statically defined at build time
const destination = destinationOverride || 'https://o:orgid.ingest.sentry.io/api/:projectid/envelope/?hsts=0';
const destinationWithRegion =
destinationOverride || 'https://o:orgid.ingest.:region.sentry.io/api/:projectid/envelope/?hsts=0';
// This function doesn't take any arguments at the time of writing but we future-proof
// here in case Next.js ever decides to pass some
userNextConfig.rewrites = async (...args) => {
const tunnelRouteRewrite = {
// Matched rewrite routes will look like the following: `[tunnelPath]?o=[orgid]&p=[projectid]`
// Nextjs will automatically convert `source` into a regex for us
source: `${tunnelPath}(/?)`,
has: [
{
type: 'query',
key: 'o', // short for orgId - we keep it short so matching is harder for ad-blockers
value: '(?<orgid>\\d*)',
},
{
type: 'query',
key: 'p', // short for projectId - we keep it short so matching is harder for ad-blockers
value: '(?<projectid>\\d*)',
},
],
destination,
};
const tunnelRouteRewriteWithRegion = {
// Matched rewrite routes will look like the following: `[tunnelPath]?o=[orgid]&p=[projectid]?r=[region]`
// Nextjs will automatically convert `source` into a regex for us
source: `${tunnelPath}(/?)`,
has: [
{
type: 'query',
key: 'o', // short for orgId - we keep it short so matching is harder for ad-blockers
value: '(?<orgid>\\d*)',
},
{
type: 'query',
key: 'p', // short for projectId - we keep it short so matching is harder for ad-blockers
value: '(?<projectid>\\d*)',
},
{
type: 'query',
key: 'r', // short for region - we keep it short so matching is harder for ad-blockers
value: '(?<region>[a-z]{2})',
},
],
destination: destinationWithRegion,
};
// Order of these is important, they get applied first to last.
const newRewrites = [tunnelRouteRewriteWithRegion, tunnelRouteRewrite];
if (typeof originalRewrites !== 'function') {
return newRewrites;
}
// @ts-expect-error Expected 0 arguments but got 1 - this is from the future-proofing mentioned above, so we don't care about it
const originalRewritesResult = await originalRewrites(...args);
if (Array.isArray(originalRewritesResult)) {
return [...newRewrites, ...originalRewritesResult];
} else {
return {
...originalRewritesResult,
beforeFiles: [...newRewrites, ...(originalRewritesResult.beforeFiles || [])],
};
}
};
}
export { resolveTunnelRoute, setUpTunnelRewriteRules };
//# sourceMappingURL=tunnel.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,uCAAmE;AAA1D,8GAAA,kBAAkB,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAC9C,oEAAmE;AAA1D,0HAAA,mBAAmB,OAAA;AAC5B,sEAAqE;AAA5D,4HAAA,oBAAoB,OAAA;AAE7B,oEAAmE;AAA1D,0HAAA,mBAAmB,OAAA;AAE5B,gEAA+D;AAAtD,sHAAA,iBAAiB,OAAA;AAC1B,+DAA8D;AAArD,oHAAA,gBAAgB,OAAA;AACzB,6DAA4D;AAAnD,kHAAA,eAAe,OAAA;AACxB,mEAAkE;AAAzD,wHAAA,kBAAkB,OAAA;AAC3B,+EAA8E;AAArE,oIAAA,wBAAwB,OAAA;AACjC,qCAA6C;AAApC,2GAAA,gBAAgB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { BasicTracerProvider } from './BasicTracerProvider';\nexport { BatchSpanProcessor, RandomIdGenerator } from './platform';\nexport { ConsoleSpanExporter } from './export/ConsoleSpanExporter';\nexport { InMemorySpanExporter } from './export/InMemorySpanExporter';\nexport type { ReadableSpan } from './export/ReadableSpan';\nexport { SimpleSpanProcessor } from './export/SimpleSpanProcessor';\nexport type { SpanExporter } from './export/SpanExporter';\nexport { NoopSpanProcessor } from './export/NoopSpanProcessor';\nexport { AlwaysOffSampler } from './sampler/AlwaysOffSampler';\nexport { AlwaysOnSampler } from './sampler/AlwaysOnSampler';\nexport { ParentBasedSampler } from './sampler/ParentBasedSampler';\nexport { TraceIdRatioBasedSampler } from './sampler/TraceIdRatioBasedSampler';\nexport { SamplingDecision } from './Sampler';\nexport type { Sampler, SamplingResult } from './Sampler';\nexport type { Span } from './Span';\nexport type { SpanProcessor } from './SpanProcessor';\nexport type { TimedEvent } from './TimedEvent';\nexport type {\n BatchSpanProcessorBrowserConfig,\n BufferConfig,\n GeneralLimits,\n SDKRegistrationConfig,\n SpanLimits,\n TracerConfig,\n} from './types';\nexport type { IdGenerator } from './IdGenerator';\n"]}
@@ -0,0 +1,24 @@
import {KeywordCxt} from "../../ajv"
import type {CodeKeywordDefinition} from "../../types"
import {alwaysValidSchema} from "../../compile/util"
const def: CodeKeywordDefinition = {
keyword: "metadata",
schemaType: "object",
code(cxt: KeywordCxt) {
checkMetadata(cxt)
const {gen, schema, it} = cxt
if (alwaysValidSchema(it, schema)) return
const valid = gen.name("valid")
cxt.subschema({keyword: "metadata", jtdMetadata: true}, valid)
cxt.ok(valid)
},
}
export function checkMetadata({it, keyword}: KeywordCxt, metadata?: boolean): void {
if (it.jtdMetadata !== metadata) {
throw new Error(`JTD: "${keyword}" cannot be used in this schema location`)
}
}
export default def
@@ -0,0 +1,251 @@
import { getSentryCarrier } from '../carrier.js';
import { dsnToString } from './dsn.js';
import { normalize } from './normalize.js';
import { GLOBAL_OBJ } from './worldwide.js';
/**
* Creates an envelope.
* Make sure to always explicitly provide the generic to this function
* so that the envelope types resolve correctly.
*/
function createEnvelope(headers, items = []) {
return [headers, items] ;
}
/**
* Add an item to an envelope.
* Make sure to always explicitly provide the generic to this function
* so that the envelope types resolve correctly.
*/
function addItemToEnvelope(envelope, newItem) {
const [headers, items] = envelope;
return [headers, [...items, newItem]] ;
}
/**
* Convenience function to loop through the items and item types of an envelope.
* (This function was mostly created because working with envelope types is painful at the moment)
*
* If the callback returns true, the rest of the items will be skipped.
*/
function forEachEnvelopeItem(
envelope,
callback,
) {
const envelopeItems = envelope[1];
for (const envelopeItem of envelopeItems) {
const envelopeItemType = envelopeItem[0].type;
const result = callback(envelopeItem, envelopeItemType);
if (result) {
return true;
}
}
return false;
}
/**
* Returns true if the envelope contains any of the given envelope item types
*/
function envelopeContainsItemType(envelope, types) {
return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));
}
/**
* Encode a string to UTF8 array.
*/
function encodeUTF8(input) {
const carrier = getSentryCarrier(GLOBAL_OBJ);
return carrier.encodePolyfill ? carrier.encodePolyfill(input) : new TextEncoder().encode(input);
}
/**
* Decode a UTF8 array to string.
*/
function decodeUTF8(input) {
const carrier = getSentryCarrier(GLOBAL_OBJ);
return carrier.decodePolyfill ? carrier.decodePolyfill(input) : new TextDecoder().decode(input);
}
/**
* Serializes an envelope.
*/
function serializeEnvelope(envelope) {
const [envHeaders, items] = envelope;
// Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data
let parts = JSON.stringify(envHeaders);
function append(next) {
if (typeof parts === 'string') {
parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts), next];
} else {
parts.push(typeof next === 'string' ? encodeUTF8(next) : next);
}
}
for (const item of items) {
const [itemHeaders, payload] = item;
append(`\n${JSON.stringify(itemHeaders)}\n`);
if (typeof payload === 'string' || payload instanceof Uint8Array) {
append(payload);
} else {
let stringifiedPayload;
try {
stringifiedPayload = JSON.stringify(payload);
} catch {
// In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.stringify()` still
// fails, we try again after normalizing it again with infinite normalization depth. This of course has a
// performance impact but in this case a performance hit is better than throwing.
stringifiedPayload = JSON.stringify(normalize(payload));
}
append(stringifiedPayload);
}
}
return typeof parts === 'string' ? parts : concatBuffers(parts);
}
function concatBuffers(buffers) {
const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);
const merged = new Uint8Array(totalLength);
let offset = 0;
for (const buffer of buffers) {
merged.set(buffer, offset);
offset += buffer.length;
}
return merged;
}
/**
* Parses an envelope
*/
function parseEnvelope(env) {
let buffer = typeof env === 'string' ? encodeUTF8(env) : env;
function readBinary(length) {
const bin = buffer.subarray(0, length);
// Replace the buffer with the remaining data excluding trailing newline
buffer = buffer.subarray(length + 1);
return bin;
}
function readJson() {
let i = buffer.indexOf(0xa);
// If we couldn't find a newline, we must have found the end of the buffer
if (i < 0) {
i = buffer.length;
}
return JSON.parse(decodeUTF8(readBinary(i))) ;
}
const envelopeHeader = readJson();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const items = [];
while (buffer.length) {
const itemHeader = readJson();
const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;
items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);
}
return [envelopeHeader, items];
}
/**
* Creates envelope item for a single span
*/
function createSpanEnvelopeItem(spanJson) {
const spanHeaders = {
type: 'span',
};
return [spanHeaders, spanJson];
}
/**
* Creates attachment envelope items
*/
function createAttachmentEnvelopeItem(attachment) {
const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data) : attachment.data;
return [
{
type: 'attachment',
length: buffer.length,
filename: attachment.filename,
content_type: attachment.contentType,
attachment_type: attachment.attachmentType,
},
buffer,
];
}
const ITEM_TYPE_TO_DATA_CATEGORY_MAP = {
session: 'session',
sessions: 'session',
attachment: 'attachment',
transaction: 'transaction',
event: 'error',
client_report: 'internal',
user_report: 'default',
profile: 'profile',
profile_chunk: 'profile',
replay_event: 'replay',
replay_recording: 'replay',
check_in: 'monitor',
feedback: 'feedback',
span: 'span',
raw_security: 'security',
log: 'log_item',
metric: 'metric',
trace_metric: 'metric',
};
/**
* Maps the type of an envelope item to a data category.
*/
function envelopeItemTypeToDataCategory(type) {
return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];
}
/** Extracts the minimal SDK info from the metadata or an events */
function getSdkMetadataForEnvelopeHeader(metadataOrEvent) {
if (!metadataOrEvent?.sdk) {
return;
}
const { name, version } = metadataOrEvent.sdk;
return { name, version };
}
/**
* Creates event envelope headers, based on event, sdk info and tunnel
* Note: This function was extracted from the core package to make it available in Replay
*/
function createEventEnvelopeHeaders(
event,
sdkInfo,
tunnel,
dsn,
) {
const dynamicSamplingContext = event.sdkProcessingMetadata?.dynamicSamplingContext;
return {
event_id: event.event_id ,
sent_at: new Date().toISOString(),
...(sdkInfo && { sdk: sdkInfo }),
...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),
...(dynamicSamplingContext && {
trace: dynamicSamplingContext,
}),
};
}
export { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, createEventEnvelopeHeaders, createSpanEnvelopeItem, envelopeContainsItemType, envelopeItemTypeToDataCategory, forEachEnvelopeItem, getSdkMetadataForEnvelopeHeader, parseEnvelope, serializeEnvelope };
//# sourceMappingURL=envelope.js.map
@@ -0,0 +1 @@
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../src/tracing/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAEN,eAAe,EACf,gBAAgB,EAEhB,IAAI,EACL,MAAM,cAAc,CAAC;AAgCtB,0CAA0C;AAC1C,MAAM,WAAW,6BAA6B;IAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,uBAAuB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEjD;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;;;;OAQG;IACH,2BAA2B,EAAE,OAAO,CAAC;IAErC;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;;;;OAKG;IACH,0BAA0B,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE9D;;OAEG;IACH,kBAAkB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,eAAe,GAAG,IAAI,CAAC;IAE3E;;OAEG;IACH,gBAAgB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5E;AAKD,eAAO,MAAM,oCAAoC,EAAE,6BAKlD,CAAC;AAEF,0DAA0D;AAC1D,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAAG,IAAI,CAyGlH;AA2BD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,uBAAuB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,GACvD,OAAO,CAqCT"}
@@ -0,0 +1,29 @@
import type { OPSQLiteDatabase } from "./driver.js";
interface MigrationConfig {
journal: {
entries: {
idx: number;
when: number;
tag: string;
breakpoints: boolean;
}[];
};
migrations: Record<string, string>;
}
export declare function migrate<TSchema extends Record<string, unknown>>(db: OPSQLiteDatabase<TSchema>, config: MigrationConfig): Promise<void>;
interface State {
success: boolean;
error?: Error;
}
export declare const useMigrations: (db: OPSQLiteDatabase<any>, migrations: {
journal: {
entries: {
idx: number;
when: number;
tag: string;
breakpoints: boolean;
}[];
};
migrations: Record<string, string>;
}) => State;
export {};
@@ -0,0 +1,45 @@
{
"name": "@react-email/font",
"version": "0.0.9",
"description": "A React Font component to set your fonts",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"license": "MIT",
"peerDependencies": {
"react": "^18.0 || ^19.0 || ^19.0.0-rc"
},
"devDependencies": {
"typescript": "5.1.6",
"@react-email/render": "1.0.3",
"eslint-config-custom": "0.0.0",
"tsconfig": "0.0.0"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
"clean": "rm -rf dist",
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
"lint": "eslint .",
"test:watch": "vitest",
"test": "vitest run"
}
}
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/admin/fields/Textarea.ts"],"sourcesContent":["import type React from 'react'\nimport type { MarkOptional } from 'ts-essentials'\n\nimport type { TextareaField, TextareaFieldClient } from '../../fields/config/types.js'\nimport type { TextareaFieldValidation } from '../../fields/validations.js'\nimport type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'\nimport type {\n ClientFieldBase,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerFieldBase,\n} from '../forms/Field.js'\nimport type {\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n FieldDiffClientComponent,\n FieldDiffServerComponent,\n FieldLabelClientComponent,\n FieldLabelServerComponent,\n} from '../types.js'\n\ntype TextareaFieldClientWithoutType = MarkOptional<TextareaFieldClient, 'type'>\n\ntype TextareaFieldBaseClientProps = {\n readonly inputRef?: React.Ref<HTMLInputElement>\n readonly onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>\n readonly path: string\n readonly validate?: TextareaFieldValidation\n}\n\ntype TextareaFieldBaseServerProps = Pick<FieldPaths, 'path'>\n\nexport type TextareaFieldClientProps = ClientFieldBase<TextareaFieldClientWithoutType> &\n TextareaFieldBaseClientProps\n\nexport type TextareaFieldServerProps = ServerFieldBase<\n TextareaField,\n TextareaFieldClientWithoutType\n> &\n TextareaFieldBaseServerProps\n\nexport type TextareaFieldServerComponent = FieldServerComponent<\n TextareaField,\n TextareaFieldClientWithoutType,\n TextareaFieldBaseServerProps\n>\n\nexport type TextareaFieldClientComponent = FieldClientComponent<\n TextareaFieldClientWithoutType,\n TextareaFieldBaseClientProps\n>\n\nexport type TextareaFieldLabelServerComponent = FieldLabelServerComponent<\n TextareaField,\n TextareaFieldClientWithoutType\n>\n\nexport type TextareaFieldLabelClientComponent =\n FieldLabelClientComponent<TextareaFieldClientWithoutType>\n\nexport type TextareaFieldDescriptionServerComponent = FieldDescriptionServerComponent<\n TextareaField,\n TextareaFieldClientWithoutType\n>\n\nexport type TextareaFieldDescriptionClientComponent =\n FieldDescriptionClientComponent<TextareaFieldClientWithoutType>\n\nexport type TextareaFieldErrorServerComponent = FieldErrorServerComponent<\n TextareaField,\n TextareaFieldClientWithoutType\n>\n\nexport type TextareaFieldErrorClientComponent =\n FieldErrorClientComponent<TextareaFieldClientWithoutType>\n\nexport type TextareaFieldDiffServerComponent = FieldDiffServerComponent<\n TextareaField,\n TextareaFieldClient\n>\n\nexport type TextareaFieldDiffClientComponent = FieldDiffClientComponent<TextareaFieldClient>\n"],"names":[],"mappings":"AAkFA,WAA4F"}
@@ -0,0 +1,55 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.UniqueArgumentNamesRule = UniqueArgumentNamesRule;
var _groupBy = require('../../jsutils/groupBy.js');
var _GraphQLError = require('../../error/GraphQLError.js');
/**
* Unique argument names
*
* A GraphQL field or directive is only valid if all supplied arguments are
* uniquely named.
*
* See https://spec.graphql.org/draft/#sec-Argument-Names
*/
function UniqueArgumentNamesRule(context) {
return {
Field: checkArgUniqueness,
Directive: checkArgUniqueness,
};
function checkArgUniqueness(parentNode) {
var _parentNode$arguments;
// FIXME: https://github.com/graphql/graphql-js/issues/2203
/* c8 ignore next */
const argumentNodes =
(_parentNode$arguments = parentNode.arguments) !== null &&
_parentNode$arguments !== void 0
? _parentNode$arguments
: [];
const seenArgs = (0, _groupBy.groupBy)(
argumentNodes,
(arg) => arg.name.value,
);
for (const [argName, argNodes] of seenArgs) {
if (argNodes.length > 1) {
context.reportError(
new _GraphQLError.GraphQLError(
`There can be only one argument named "${argName}".`,
{
nodes: argNodes.map((node) => node.name),
},
),
);
}
}
}
}
@@ -0,0 +1,6 @@
/**
* Useful when parsing query parameters where booleans are represented as strings.
* Falls back to `undefined` to allow default handling elsewhere.
*/
export declare const parseBooleanString: (value: boolean | null | string | undefined) => boolean | undefined;
//# sourceMappingURL=parseBooleanString.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"operatorMap.d.ts","sourceRoot":"","sources":["../../src/queries/operatorMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,MAAM,EAcX,KAAK,GAAG,EACT,MAAM,aAAa,CAAA;AAEpB,KAAK,YAAY,GACb,KAAK,GACL,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,IAAI,GACJ,QAAQ,GACR,WAAW,GACX,iBAAiB,GACjB,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,IAAI,CAAA;AAER,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,GAAG,CAAC,CAAA;AAErF,eAAO,MAAM,WAAW,EAAE,SAkBzB,CAAA"}
@@ -0,0 +1,381 @@
import { SEMATTRS_HTTP_TARGET, ATTR_URL_QUERY, SEMATTRS_HTTP_METHOD, ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';
import { GLOBAL_OBJ, debug, applySdkMetadata, getGlobalScope, extractTraceparentData, SEMANTIC_ATTRIBUTE_SENTRY_OP, stripUrlQueryAndFragment, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, getClient } from '@sentry/core';
import { getDefaultIntegrations, httpIntegration, init as init$1 } from '@sentry/node';
export * from '@sentry/node';
import { DEBUG_BUILD } from '../common/debug-build.js';
import { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolicationEventProcessor.js';
import { getVercelEnv } from '../common/getVercelEnv.js';
import { ATTR_NEXT_SPAN_TYPE, ATTR_NEXT_ROUTE, ATTR_NEXT_SPAN_NAME } from '../common/nextSpanAttributes.js';
import { TRANSACTION_ATTR_SHOULD_DROP_TRANSACTION, TRANSACTION_ATTR_SENTRY_TRACE_BACKFILL, TRANSACTION_ATTR_SENTRY_ROUTE_BACKFILL } from '../common/span-attributes-with-logic-attached.js';
import { isBuild } from '../common/utils/isBuild.js';
import { isCloudflareWaitUntilAvailable } from '../common/utils/responseEnd.js';
import { setUrlProcessingMetadata } from '../common/utils/setUrlProcessingMetadata.js';
import { distDirRewriteFramesIntegration } from './distDirRewriteFramesIntegration.js';
import { handleOnSpanStart } from './handleOnSpanStart.js';
import { prepareSafeIdGeneratorContext } from './prepareSafeIdGeneratorContext.js';
import { maybeCompleteCronCheckIn } from './vercelCronsMonitoring.js';
export { captureUnderscoreErrorException } from '../common/pages-router-instrumentation/_error.js';
export { startInactiveSpan, startSpan, startSpanManual } from '../common/utils/nextSpan.js';
export { wrapGetStaticPropsWithSentry } from '../common/pages-router-instrumentation/wrapGetStaticPropsWithSentry.js';
export { wrapGetInitialPropsWithSentry } from '../common/pages-router-instrumentation/wrapGetInitialPropsWithSentry.js';
export { wrapAppGetInitialPropsWithSentry } from '../common/pages-router-instrumentation/wrapAppGetInitialPropsWithSentry.js';
export { wrapDocumentGetInitialPropsWithSentry } from '../common/pages-router-instrumentation/wrapDocumentGetInitialPropsWithSentry.js';
export { wrapErrorGetInitialPropsWithSentry } from '../common/pages-router-instrumentation/wrapErrorGetInitialPropsWithSentry.js';
export { wrapGetServerSidePropsWithSentry } from '../common/pages-router-instrumentation/wrapGetServerSidePropsWithSentry.js';
export { wrapServerComponentWithSentry } from '../common/wrapServerComponentWithSentry.js';
export { wrapRouteHandlerWithSentry } from '../common/wrapRouteHandlerWithSentry.js';
export { wrapApiHandlerWithSentryVercelCrons } from '../common/pages-router-instrumentation/wrapApiHandlerWithSentryVercelCrons.js';
export { wrapMiddlewareWithSentry } from '../common/wrapMiddlewareWithSentry.js';
export { wrapPageComponentWithSentry } from '../common/pages-router-instrumentation/wrapPageComponentWithSentry.js';
export { wrapGenerationFunctionWithSentry } from '../common/wrapGenerationFunctionWithSentry.js';
export { withServerActionInstrumentation } from '../common/withServerActionInstrumentation.js';
export { captureRequestError } from '../common/captureRequestError.js';
export { wrapApiHandlerWithSentry } from '../common/pages-router-instrumentation/wrapApiHandlerWithSentry.js';
// import/export got a false positive, and affects most of our index barrel files
// can be removed once following issue is fixed: https://github.com/import-js/eslint-plugin-import/issues/703
/* eslint-disable import/export */
const globalWithInjectedValues = GLOBAL_OBJ
;
/**
* A passthrough error boundary for the server that doesn't depend on any react. Error boundaries don't catch SSR errors
* so they should simply be a passthrough.
*/
const ErrorBoundary = (props) => {
if (!props.children) {
return null;
}
if (typeof props.children === 'function') {
return (props.children )();
}
// since Next.js >= 10 requires React ^16.6.0 we are allowed to return children like this here
return props.children ;
};
/**
* A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.
*/
function createReduxEnhancer() {
return (createStore) => createStore;
}
/**
* A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
* SSR errors so they should simply be a passthrough.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function withErrorBoundary(
WrappedComponent,
) {
return WrappedComponent ;
}
/**
* Just a passthrough since we're on the server and showing the report dialog on the server doesn't make any sense.
*/
function showReportDialog() {
return;
}
/**
* Returns the runtime configuration for the SDK based on the environment.
* When running on OpenNext/Cloudflare, returns cloudflare runtime config.
*/
function getCloudflareRuntimeConfig() {
if (isCloudflareWaitUntilAvailable()) {
// todo: add version information?
return { runtime: { name: 'cloudflare' } };
}
return undefined;
}
/** Inits the Sentry NextJS SDK on node. */
function init(options) {
prepareSafeIdGeneratorContext();
if (isBuild()) {
return;
}
if (!DEBUG_BUILD && options.debug) {
// eslint-disable-next-line no-console
console.warn(
'[@sentry/nextjs] You have enabled `debug: true`, but Sentry debug logging was removed from your bundle (likely via `withSentryConfig({ disableLogger: true })` / `webpack.treeshake.removeDebugLogging: true`). Set that option to `false` to see Sentry debug output.',
);
}
const customDefaultIntegrations = getDefaultIntegrations(options)
.filter(integration => integration.name !== 'Http')
.concat(
// We are using the HTTP integration without instrumenting incoming HTTP requests because Next.js does that by itself.
httpIntegration({
disableIncomingRequestSpans: true,
}),
);
// Turn off Next.js' own fetch instrumentation (only when we manage OTEL)
// https://github.com/lforst/nextjs-fork/blob/1994fd186defda77ad971c36dc3163db263c993f/packages/next/src/server/lib/patch-fetch.ts#L245
// Enable with custom OTel setup: https://github.com/getsentry/sentry-javascript/issues/17581
if (!options.skipOpenTelemetrySetup) {
process.env.NEXT_OTEL_FETCH_DISABLED = '1';
}
// This value is injected at build time, based on the output directory specified in the build config. Though a default
// is set there, we set it here as well, just in case something has gone wrong with the injection.
const distDirName = process.env._sentryRewriteFramesDistDir || globalWithInjectedValues._sentryRewriteFramesDistDir;
if (distDirName) {
customDefaultIntegrations.push(distDirRewriteFramesIntegration({ distDirName }));
}
// Detect if running on OpenNext/Cloudflare and get runtime config
const cloudflareConfig = getCloudflareRuntimeConfig();
const opts = {
environment: process.env.SENTRY_ENVIRONMENT || getVercelEnv(false) || process.env.NODE_ENV,
release: process.env._sentryRelease || globalWithInjectedValues._sentryRelease,
defaultIntegrations: customDefaultIntegrations,
...options,
// Override runtime to 'cloudflare' when running on OpenNext/Cloudflare
...cloudflareConfig,
};
if (DEBUG_BUILD && opts.debug) {
debug.enable();
}
DEBUG_BUILD && debug.log('Initializing SDK...');
if (sdkAlreadyInitialized()) {
DEBUG_BUILD && debug.log('SDK already initialized');
return;
}
// Use appropriate SDK metadata based on the runtime environment
applySdkMetadata(opts, 'nextjs', ['nextjs', cloudflareConfig ? 'cloudflare' : 'node']);
const client = init$1(opts);
client?.on('beforeSampling', ({ spanAttributes }, samplingDecision) => {
// There are situations where the Next.js Node.js server forwards requests for the Edge Runtime server (e.g. in
// middleware) and this causes spans for Sentry ingest requests to be created. These are not exempt from our tracing
// because we didn't get the chance to do `suppressTracing`, since this happens outside of userland.
// We need to drop these spans.
if (
// eslint-disable-next-line deprecation/deprecation
(typeof spanAttributes[SEMATTRS_HTTP_TARGET] === 'string' &&
// eslint-disable-next-line deprecation/deprecation
spanAttributes[SEMATTRS_HTTP_TARGET].includes('sentry_key') &&
// eslint-disable-next-line deprecation/deprecation
spanAttributes[SEMATTRS_HTTP_TARGET].includes('sentry_client')) ||
(typeof spanAttributes[ATTR_URL_QUERY] === 'string' &&
spanAttributes[ATTR_URL_QUERY].includes('sentry_key') &&
spanAttributes[ATTR_URL_QUERY].includes('sentry_client'))
) {
samplingDecision.decision = false;
}
});
client?.on('spanStart', handleOnSpanStart);
client?.on('spanEnd', maybeCompleteCronCheckIn);
getGlobalScope().addEventProcessor(
Object.assign(
(event => {
if (event.type === 'transaction') {
// Filter out transactions for static assets
// This regex matches the default path to the static assets (`_next/static`) and could potentially filter out too many transactions.
// We match `/_next/static/` anywhere in the transaction name because its location may change with the basePath setting.
if (event.transaction?.match(/^GET (\/.*)?\/_next\/static\//)) {
return null;
}
// Filter out transactions for requests to the tunnel route
if (
(globalWithInjectedValues._sentryRewritesTunnelPath &&
event.transaction === `POST ${globalWithInjectedValues._sentryRewritesTunnelPath}`) ||
(process.env._sentryRewritesTunnelPath &&
event.transaction === `POST ${process.env._sentryRewritesTunnelPath}`)
) {
return null;
}
// Filter out requests to resolve source maps for stack frames in dev mode
if (event.transaction?.match(/\/__nextjs_original-stack-frame/)) {
return null;
}
// Filter out /404 transactions which seem to be created excessively
if (
// Pages router
event.transaction === '/404' ||
// App router (could be "GET /404", "POST /404", ...)
event.transaction?.match(/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH) \/(404|_not-found)$/)
) {
return null;
}
// Filter transactions that we explicitly want to drop.
if (event.contexts?.trace?.data?.[TRANSACTION_ATTR_SHOULD_DROP_TRANSACTION]) {
return null;
}
// Next.js 13 sometimes names the root transactions like this containing useless tracing.
if (event.transaction === 'NextServer.getRequestHandler') {
return null;
}
// Next.js 13 is not correctly picking up tracing data for trace propagation so we use a back-fill strategy
if (typeof event.contexts?.trace?.data?.[TRANSACTION_ATTR_SENTRY_TRACE_BACKFILL] === 'string') {
const traceparentData = extractTraceparentData(
event.contexts.trace.data[TRANSACTION_ATTR_SENTRY_TRACE_BACKFILL],
);
if (traceparentData?.parentSampled === false) {
return null;
}
}
return event;
} else {
return event;
}
}) ,
{ id: 'NextLowQualityTransactionsFilter' },
),
);
getGlobalScope().addEventProcessor(
Object.assign(
((event, hint) => {
if (event.type !== undefined) {
return event;
}
const originalException = hint.originalException;
const isPostponeError =
typeof originalException === 'object' &&
originalException !== null &&
'$$typeof' in originalException &&
originalException.$$typeof === Symbol.for('react.postpone');
if (isPostponeError) {
// Postpone errors are used for partial-pre-rendering (PPR)
return null;
}
// We don't want to capture suspense errors as they are simply used by React/Next.js for control flow
const exceptionMessage = event.exception?.values?.[0]?.value;
if (
exceptionMessage?.includes('Suspense Exception: This is not a real error!') ||
exceptionMessage?.includes('Suspense Exception: This is not a real error, and should not leak')
) {
return null;
}
return event;
}) ,
{ id: 'DropReactControlFlowErrors' },
),
);
// Use the preprocessEvent hook instead of an event processor, so that the users event processors receive the most
// up-to-date value, but also so that the logic that detects changes to the transaction names to set the source to
// "custom", doesn't trigger.
client?.on('preprocessEvent', event => {
// Enhance route handler transactions
if (
event.type === 'transaction' &&
event.contexts?.trace?.data?.[ATTR_NEXT_SPAN_TYPE] === 'BaseServer.handleRequest'
) {
event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_OP] = 'http.server';
event.contexts.trace.op = 'http.server';
if (event.transaction) {
event.transaction = stripUrlQueryAndFragment(event.transaction);
}
// eslint-disable-next-line deprecation/deprecation
const method = event.contexts.trace.data[SEMATTRS_HTTP_METHOD];
// eslint-disable-next-line deprecation/deprecation
const target = event.contexts?.trace?.data?.[SEMATTRS_HTTP_TARGET];
const route = event.contexts.trace.data[ATTR_HTTP_ROUTE] || event.contexts.trace.data[ATTR_NEXT_ROUTE];
const spanName = event.contexts.trace.data[ATTR_NEXT_SPAN_NAME];
if (typeof method === 'string' && typeof route === 'string' && !route.startsWith('middleware')) {
const cleanRoute = route.replace(/\/route$/, '');
event.transaction = `${method} ${cleanRoute}`;
event.contexts.trace.data[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'route';
// Preserve next.route in case it did not get hoisted
event.contexts.trace.data[ATTR_NEXT_ROUTE] = cleanRoute;
}
// backfill transaction name for pages that would otherwise contain unparameterized routes
if (event.contexts.trace.data[TRANSACTION_ATTR_SENTRY_ROUTE_BACKFILL] && event.transaction !== 'GET /_app') {
event.transaction = `${method} ${event.contexts.trace.data[TRANSACTION_ATTR_SENTRY_ROUTE_BACKFILL]}`;
}
const middlewareMatch =
typeof spanName === 'string' && spanName.match(/^middleware (GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)/);
if (middlewareMatch) {
const normalizedName = `middleware ${middlewareMatch[1]}`;
event.transaction = normalizedName;
event.contexts.trace.op = 'http.server.middleware';
}
// Next.js overrides transaction names for page loads that throw an error
// but we want to keep the original target name
if (event.transaction === 'GET /_error' && target) {
event.transaction = `${method ? `${method} ` : ''}${target}`;
}
}
// Next.js 13 is not correctly picking up tracing data for trace propagation so we use a back-fill strategy
if (
event.type === 'transaction' &&
typeof event.contexts?.trace?.data?.[TRANSACTION_ATTR_SENTRY_TRACE_BACKFILL] === 'string'
) {
const traceparentData = extractTraceparentData(event.contexts.trace.data[TRANSACTION_ATTR_SENTRY_TRACE_BACKFILL]);
if (traceparentData?.traceId) {
event.contexts.trace.trace_id = traceparentData.traceId;
}
if (traceparentData?.parentSpanId) {
event.contexts.trace.parent_span_id = traceparentData.parentSpanId;
}
}
setUrlProcessingMetadata(event);
});
if (process.env.NODE_ENV === 'development') {
getGlobalScope().addEventProcessor(devErrorSymbolicationEventProcessor);
}
try {
// @ts-expect-error `process.turbopack` is a magic string that will be replaced by Next.js
if (process.turbopack) {
getGlobalScope().setTag('turbopack', true);
}
} catch {
// Noop
// The statement above can throw because process is not defined on the client
}
DEBUG_BUILD && debug.log('SDK successfully initialized');
return client;
}
function sdkAlreadyInitialized() {
return !!getClient();
}
export { ErrorBoundary, createReduxEnhancer, init, showReportDialog, withErrorBoundary };
//# sourceMappingURL=index.js.map
@@ -0,0 +1,100 @@
import { BestFitMatcher } from './BestFitMatcher';
import { CanonicalizeUValue } from './CanonicalizeUValue';
import { InsertUnicodeExtensionAndCanonicalize } from './InsertUnicodeExtensionAndCanonicalize';
import { LookupMatcher } from './LookupMatcher';
import { UnicodeExtensionComponents } from './UnicodeExtensionComponents';
import { invariant } from './utils';
/**
* https://tc39.es/ecma402/#sec-resolvelocale
*/
export function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
var _a;
var matcher = options.localeMatcher;
var r;
if (matcher === 'lookup') {
r = LookupMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
}
else {
r = BestFitMatcher(Array.from(availableLocales), requestedLocales, getDefaultLocale);
}
if (r == null) {
r = {
locale: getDefaultLocale(),
extension: '',
};
}
var foundLocale = r.locale;
var foundLocaleData = localeData[foundLocale];
// TODO: We can't really guarantee that the locale data is available
// invariant(
// foundLocaleData !== undefined,
// `Missing locale data for ${foundLocale}`
// )
var result = { locale: 'en', dataLocale: foundLocale };
var components;
var keywords;
if (r.extension) {
components = UnicodeExtensionComponents(r.extension);
keywords = components.keywords;
}
else {
keywords = [];
}
var supportedKeywords = [];
var _loop_1 = function (key) {
// TODO: Shouldn't default to empty array, see TODO above
var keyLocaleData = (_a = foundLocaleData === null || foundLocaleData === void 0 ? void 0 : foundLocaleData[key]) !== null && _a !== void 0 ? _a : [];
invariant(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
var value = keyLocaleData[0];
invariant(value === undefined || typeof value === 'string', "value must be a string or undefined");
var supportedKeyword = void 0;
var entry = keywords.find(function (k) { return k.key === key; });
if (entry) {
var requestedValue = entry.value;
if (requestedValue !== '') {
if (keyLocaleData.indexOf(requestedValue) > -1) {
value = requestedValue;
supportedKeyword = {
key: key,
value: value,
};
}
}
else if (keyLocaleData.indexOf('true') > -1) {
value = 'true';
supportedKeyword = {
key: key,
value: value,
};
}
}
var optionsValue = options[key];
invariant(optionsValue == null || typeof optionsValue === 'string', "optionsValue must be a string or undefined");
if (typeof optionsValue === 'string') {
var ukey = key.toLowerCase();
optionsValue = CanonicalizeUValue(ukey, optionsValue);
if (optionsValue === '') {
optionsValue = 'true';
}
}
if (optionsValue !== value && keyLocaleData.indexOf(optionsValue) > -1) {
value = optionsValue;
supportedKeyword = undefined;
}
if (supportedKeyword) {
supportedKeywords.push(supportedKeyword);
}
result[key] = value;
};
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
var key = relevantExtensionKeys_1[_i];
_loop_1(key);
}
var supportedAttributes = [];
if (supportedKeywords.length > 0) {
supportedAttributes = [];
foundLocale = InsertUnicodeExtensionAndCanonicalize(foundLocale, supportedAttributes, supportedKeywords);
}
result.locale = foundLocale;
return result;
}
@@ -0,0 +1 @@
{"version":3,"file":"pi.js","sources":["../../../src/icons/pi.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Pi\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iOSIgeDI9IjkiIHkxPSI0IiB5Mj0iMjAiIC8+CiAgPHBhdGggZD0iTTQgN2MwLTEuNyAxLjMtMyAzLTNoMTMiIC8+CiAgPHBhdGggZD0iTTE4IDIwYy0xLjcgMC0zLTEuMy0zLTNWNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/pi\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 Pi = createLucideIcon('Pi', [\n ['line', { x1: '9', x2: '9', y1: '4', y2: '20', key: 'ovs5a5' }],\n ['path', { d: 'M4 7c0-1.7 1.3-3 3-3h13', key: '10pag4' }],\n ['path', { d: 'M18 20c-1.7 0-3-1.3-3-3V4', key: '1gaosr' }],\n]);\n\nexport default Pi;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,iBAAiB,IAAM,CAAA,CAAA,CAAA;AAAA,CAChC,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC5D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,UAAU,EACV,sBAAsB,EACvB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAa,MAAM,gBAAgB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAS,MAAM,sBAAsB,CAAA;AAwBjE,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,kBAAkB,IAAI;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,kBAAkB,IAAI;IACxD,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE,gCAAgC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAA;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,KAAK,wBAAwB,CAAC,KAAK,SAAS,kBAAkB,IAAI;IAChE,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAA;CACpC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,SAAS,kBAAkB,yCAIlE,wBAAwB,CAAC,KAAK,CAAC,SAQjC,CAAA;AAED,eAAO,MAAM,cAAc,GAAU,KAAK,SAAS,kBAAkB,gBACrD,SAAS,CAAC,KAAK,CAAC,KAC7B,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CA+V5B,CAAA"}
@@ -0,0 +1,8 @@
'use strict';
module.exports = (flag, argv = process.argv) => {
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
const position = argv.indexOf(prefix + flag);
const terminatorPosition = argv.indexOf('--');
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
};
@@ -0,0 +1,43 @@
import { promise } from './promise.js';
/**
* This function is responsible for the following actions, in order:
* - Run condition
* - Execute field hooks
* - Validate data
* - Transform data for storage
* - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.
*/ export const traverseFields = async ({ id, blockData, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipValidation })=>{
const promises = [];
fields.forEach((field, fieldIndex)=>{
promises.push(promise({
id,
blockData,
collection,
context,
data,
doc,
docWithLocales,
errors,
field,
fieldIndex,
fieldLabelPath,
global,
mergeLocaleActions,
operation,
overrideAccess,
parentIndexPath,
parentIsLocalized: parentIsLocalized,
parentPath,
parentSchemaPath,
req,
siblingData,
siblingDoc,
siblingDocWithLocales,
siblingFields: fields,
skipValidation: skipValidation
}));
});
await Promise.all(promises);
};
//# sourceMappingURL=traverseFields.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dom/replaced-elements/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('dropRight', require('../dropRight'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/resolvers/auth/me.ts"],"sourcesContent":["import type { Collection } from 'payload'\n\nimport { extractJWT, isolateObjectProperty, meOperation } from 'payload'\n\nimport type { Context } from '../types.js'\n\nexport function me(collection: Collection): any {\n async function resolver(_, args, context: Context) {\n const currentToken = extractJWT(context.req)\n\n const options = {\n collection,\n currentToken,\n depth: 0,\n req: isolateObjectProperty(context.req, 'transactionID'),\n }\n\n const result = await meOperation(options)\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return result\n }\n\n return resolver\n}\n"],"names":["extractJWT","isolateObjectProperty","meOperation","me","collection","resolver","_","args","context","currentToken","req","options","depth","result","config","auth","removeTokenFromResponses","token"],"mappings":"AAEA,SAASA,UAAU,EAAEC,qBAAqB,EAAEC,WAAW,QAAQ,UAAS;AAIxE,OAAO,SAASC,GAAGC,UAAsB;IACvC,eAAeC,SAASC,CAAC,EAAEC,IAAI,EAAEC,OAAgB;QAC/C,MAAMC,eAAeT,WAAWQ,QAAQE,GAAG;QAE3C,MAAMC,UAAU;YACdP;YACAK;YACAG,OAAO;YACPF,KAAKT,sBAAsBO,QAAQE,GAAG,EAAE;QAC1C;QAEA,MAAMG,SAAS,MAAMX,YAAYS;QAEjC,IAAIP,WAAWU,MAAM,CAACC,IAAI,CAACC,wBAAwB,EAAE;YACnD,OAAOH,OAAOI,KAAK;QACrB;QAEA,OAAOJ;IACT;IAEA,OAAOR;AACT"}
@@ -0,0 +1,48 @@
var baseLodash = require('./_baseLodash'),
wrapperClone = require('./_wrapperClone');
/**
* Creates a clone of the chain sequence planting `value` as the wrapped value.
*
* @name plant
* @memberOf _
* @since 3.2.0
* @category Seq
* @param {*} value The value to plant.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2]).map(square);
* var other = wrapped.plant([3, 4]);
*
* other.value();
* // => [9, 16]
*
* wrapped.value();
* // => [1, 4]
*/
function wrapperPlant(value) {
var result,
parent = this;
while (parent instanceof baseLodash) {
var clone = wrapperClone(parent);
clone.__index__ = 0;
clone.__values__ = undefined;
if (result) {
previous.__wrapped__ = clone;
} else {
result = clone;
}
var previous = clone;
parent = parent.__wrapped__;
}
previous.__wrapped__ = value;
return result;
}
module.exports = wrapperPlant;
@@ -0,0 +1,69 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
const HelperRuntimeModule = require("./HelperRuntimeModule");
/** @typedef {import("../Compilation")} Compilation */
class CreateFakeNamespaceObjectRuntimeModule extends HelperRuntimeModule {
constructor() {
super("create fake namespace object");
}
/**
* @returns {string | null} runtime code
*/
generate() {
const compilation = /** @type {Compilation} */ (this.compilation);
const { runtimeTemplate } = compilation;
const fn = RuntimeGlobals.createFakeNamespaceObject;
return Template.asString([
`var getProto = Object.getPrototypeOf ? ${runtimeTemplate.returningFunction(
"Object.getPrototypeOf(obj)",
"obj"
)} : ${runtimeTemplate.returningFunction("obj.__proto__", "obj")};`,
"var leafPrototypes;",
"// create a fake namespace object",
"// mode & 1: value is a module id, require it",
"// mode & 2: merge all properties of value into the ns",
"// mode & 4: return value when already ns object",
"// mode & 16: return value when it's Promise-like",
"// mode & 8|1: behave like require",
// Note: must be a function (not arrow), because this is used in body!
`${fn} = function(value, mode) {`,
Template.indent([
"if(mode & 1) value = this(value);",
"if(mode & 8) return value;",
"if(typeof value === 'object' && value) {",
Template.indent([
"if((mode & 4) && value.__esModule) return value;",
"if((mode & 16) && typeof value.then === 'function') return value;"
]),
"}",
"var ns = Object.create(null);",
`${RuntimeGlobals.makeNamespaceObject}(ns);`,
"var def = {};",
"leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];",
"for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {",
Template.indent([
`Object.getOwnPropertyNames(current).forEach(${runtimeTemplate.expressionFunction(
`def[key] = ${runtimeTemplate.returningFunction("value[key]", "")}`,
"key"
)});`
]),
"}",
`def['default'] = ${runtimeTemplate.returningFunction("value", "")};`,
`${RuntimeGlobals.definePropertyGetters}(ns, def);`,
"return ns;"
]),
"};"
]);
}
}
module.exports = CreateFakeNamespaceObjectRuntimeModule;
@@ -0,0 +1,46 @@
import type { LocalizedOptions, WeekOptions } from "./types.js";
/**
* The {@link differenceInCalendarWeeks} function options.
*/
export interface DifferenceInCalendarWeeksOptions
extends LocalizedOptions<"options">,
WeekOptions {}
/**
* @name differenceInCalendarWeeks
* @category Week Helpers
* @summary Get the number of calendar weeks between the given dates.
*
* @description
* Get the number of calendar weeks between the given dates.
*
* @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 calendar weeks
*
* @example
* // How many calendar weeks are between 5 July 2014 and 20 July 2014?
* const result = differenceInCalendarWeeks(
* new Date(2014, 6, 20),
* new Date(2014, 6, 5)
* )
* //=> 3
*
* @example
* // If the week starts on Monday,
* // how many calendar weeks are between 5 July 2014 and 20 July 2014?
* const result = differenceInCalendarWeeks(
* new Date(2014, 6, 20),
* new Date(2014, 6, 5),
* { weekStartsOn: 1 }
* )
* //=> 2
*/
export declare function differenceInCalendarWeeks<DateType extends Date>(
dateLeft: DateType | number | string,
dateRight: DateType | number | string,
options?: DifferenceInCalendarWeeksOptions,
): number;
@@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var bun_sqlite_exports = {};
module.exports = __toCommonJS(bun_sqlite_exports);
__reExport(bun_sqlite_exports, require("./driver.cjs"), module.exports);
__reExport(bun_sqlite_exports, require("./session.cjs"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
...require("./driver.cjs"),
...require("./session.cjs")
});
//# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/collections/endpoints/findByID.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { getRequestCollectionWithID } from '../../utilities/getRequestEntity.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { parseParams } from '../../utilities/parseParams/index.js'\nimport { findByIDOperation } from '../operations/findByID.js'\n\nexport const findByIDHandler: PayloadHandler = async (req) => {\n const { data: dataArg } = req\n const { id, collection } = getRequestCollectionWithID(req)\n\n const { data, depth, draft, flattenLocales, joins, populate, select, trash } = parseParams({\n ...req.query,\n ...dataArg,\n })\n\n const result = await findByIDOperation({\n id,\n collection,\n data,\n depth,\n draft,\n flattenLocales,\n joins,\n populate,\n req,\n select,\n trash,\n })\n\n return Response.json(result, {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["status","httpStatus","getRequestCollectionWithID","headersWithCors","parseParams","findByIDOperation","findByIDHandler","req","data","dataArg","id","collection","depth","draft","flattenLocales","joins","populate","select","trash","query","result","Response","json","headers","Headers","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,0BAA0B,QAAQ,sCAAqC;AAChF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,WAAW,QAAQ,uCAAsC;AAClE,SAASC,iBAAiB,QAAQ,4BAA2B;AAE7D,OAAO,MAAMC,kBAAkC,OAAOC;IACpD,MAAM,EAAEC,MAAMC,OAAO,EAAE,GAAGF;IAC1B,MAAM,EAAEG,EAAE,EAAEC,UAAU,EAAE,GAAGT,2BAA2BK;IAEtD,MAAM,EAAEC,IAAI,EAAEI,KAAK,EAAEC,KAAK,EAAEC,cAAc,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGd,YAAY;QACzF,GAAGG,IAAIY,KAAK;QACZ,GAAGV,OAAO;IACZ;IAEA,MAAMW,SAAS,MAAMf,kBAAkB;QACrCK;QACAC;QACAH;QACAI;QACAC;QACAC;QACAC;QACAC;QACAT;QACAU;QACAC;IACF;IAEA,OAAOG,SAASC,IAAI,CAACF,QAAQ;QAC3BG,SAASpB,gBAAgB;YACvBoB,SAAS,IAAIC;YACbjB;QACF;QACAP,QAAQC,WAAWwB,EAAE;IACvB;AACF,EAAC"}
@@ -0,0 +1,16 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = isWindow;
var _isDocument = _interopRequireDefault(require("./isDocument"));
function isWindow(node) {
if ('window' in node && node.window === node) return node;
if ((0, _isDocument.default)(node)) return node.defaultView || false;
return false;
}
module.exports = exports["default"];
@@ -0,0 +1,160 @@
import { CaptureContext } from './scope';
import { CheckIn, MonitorConfig } from './types-hoist/checkin';
import { Event, EventHint } from './types-hoist/event';
import { EventProcessor } from './types-hoist/eventprocessor';
import { Extra, Extras } from './types-hoist/extra';
import { Primitive } from './types-hoist/misc';
import { Session, SessionContext } from './types-hoist/session';
import { SeverityLevel } from './types-hoist/severity';
import { User } from './types-hoist/user';
import { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';
/**
* Captures an exception event and sends it to Sentry.
*
* @param exception The exception to capture.
* @param hint Optional additional data to attach to the Sentry event.
* @returns the id of the captured Sentry event.
*/
export declare function captureException(exception: unknown, hint?: ExclusiveEventHintOrCaptureContext): string;
/**
* Captures a message event and sends it to Sentry.
*
* @param message The message to send to Sentry.
* @param captureContext Define the level of the message or pass in additional data to attach to the message.
* @returns the id of the captured message.
*/
export declare function captureMessage(message: string, captureContext?: CaptureContext | SeverityLevel): string;
/**
* Captures a manually created event and sends it to Sentry.
*
* @param event The event to send to Sentry.
* @param hint Optional additional data to attach to the Sentry event.
* @returns the id of the captured event.
*/
export declare function captureEvent(event: Event, hint?: EventHint): string;
/**
* Sets context data with the given name.
* @param name of the context
* @param context Any kind of data. This data will be normalized.
*/
export declare function setContext(name: string, context: {
[key: string]: unknown;
} | null): void;
/**
* Set an object that will be merged sent as extra data with the event.
* @param extras Extras object to merge into current context.
*/
export declare function setExtras(extras: Extras): void;
/**
* Set key:value that will be sent as extra data with the event.
* @param key String of extra
* @param extra Any kind of data. This data will be normalized.
*/
export declare function setExtra(key: string, extra: Extra): void;
/**
* Set an object that will be merged sent as tags data with the event.
* @param tags Tags context object to merge into current context.
*/
export declare function setTags(tags: {
[key: string]: Primitive;
}): void;
/**
* Set key:value that will be sent as tags data with the event.
*
* Can also be used to unset a tag, by passing `undefined`.
*
* @param key String key of tag
* @param value Value of tag
*/
export declare function setTag(key: string, value: Primitive): void;
/**
* Updates user context information for future events.
*
* @param user User context object to be set in the current context. Pass `null` to unset the user.
*/
export declare function setUser(user: User | null): void;
/**
* Sets the conversation ID for the current isolation scope.
*
* @param conversationId The conversation ID to set. Pass `null` or `undefined` to unset the conversation ID.
*/
export declare function setConversationId(conversationId: string | null | undefined): void;
/**
* The last error event id of the isolation scope.
*
* Warning: This function really returns the last recorded error event id on the current
* isolation scope. If you call this function after handling a certain error and another error
* is captured in between, the last one is returned instead of the one you might expect.
* Also, ids of events that were never sent to Sentry (for example because
* they were dropped in `beforeSend`) could be returned.
*
* @returns The last event id of the isolation scope.
*/
export declare function lastEventId(): string | undefined;
/**
* Create a cron monitor check in and send it to Sentry.
*
* @param checkIn An object that describes a check in.
* @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want
* to create a monitor automatically when sending a check in.
*/
export declare function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string;
/**
* Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.
*
* @param monitorSlug The distinct slug of the monitor.
* @param callback Callback to be monitored
* @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want
* to create a monitor automatically when sending a check in.
*/
export declare function withMonitor<T>(monitorSlug: CheckIn['monitorSlug'], callback: () => T, upsertMonitorConfig?: MonitorConfig): T;
/**
* Call `flush()` on the current client, if there is one. See {@link Client.flush}.
*
* @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
* the client to wait until all events are sent before resolving the promise.
* @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
* doesn't (or if there's no client defined).
*/
export declare function flush(timeout?: number): Promise<boolean>;
/**
* Call `close()` on the current client, if there is one. See {@link Client.close}.
*
* @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
* parameter will cause the client to wait until all events are sent before disabling itself.
* @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
* doesn't (or if there's no client defined).
*/
export declare function close(timeout?: number): Promise<boolean>;
/**
* Returns true if Sentry has been properly initialized.
*/
export declare function isInitialized(): boolean;
/** If the SDK is initialized & enabled. */
export declare function isEnabled(): boolean;
/**
* Add an event processor.
* This will be added to the current isolation scope, ensuring any event that is processed in the current execution
* context will have the processor applied.
*/
export declare function addEventProcessor(callback: EventProcessor): void;
/**
* Start a session on the current isolation scope.
*
* @param context (optional) additional properties to be applied to the returned session object
*
* @returns the new active session
*/
export declare function startSession(context?: SessionContext): Session;
/**
* End the session on the current isolation scope.
*/
export declare function endSession(): void;
/**
* Sends the current session on the scope to Sentry
*
* @param end If set the session will be marked as exited and removed from the scope.
* Defaults to `false`.
*/
export declare function captureSession(end?: boolean): void;
//# sourceMappingURL=exports.d.ts.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/gel-core/checks.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport type { SQL } from '~/sql/index.ts';\nimport type { GelTable } from './table.ts';\n\nexport class CheckBuilder {\n\tstatic readonly [entityKind]: string = 'GelCheckBuilder';\n\n\tprotected brand!: 'GelConstraintBuilder';\n\n\tconstructor(public name: string, public value: SQL) {}\n\n\t/** @internal */\n\tbuild(table: GelTable): Check {\n\t\treturn new Check(table, this);\n\t}\n}\n\nexport class Check {\n\tstatic readonly [entityKind]: string = 'GelCheck';\n\n\treadonly name: string;\n\treadonly value: SQL;\n\n\tconstructor(public table: GelTable, builder: CheckBuilder) {\n\t\tthis.name = builder.name;\n\t\tthis.value = builder.value;\n\t}\n}\n\nexport function check(name: string, value: SQL): CheckBuilder {\n\treturn new CheckBuilder(name, value);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAIpB,MAAM,aAAa;AAAA,EAKzB,YAAmB,MAAqB,OAAY;AAAjC;AAAqB;AAAA,EAAa;AAAA,EAJrD,QAAiB,wBAAU,IAAY;AAAA,EAE7B;AAAA;AAAA,EAKV,MAAM,OAAwB;AAC7B,WAAO,IAAI,MAAM,OAAO,IAAI;AAAA,EAC7B;AACD;AAEO,MAAM,MAAM;AAAA,EAMlB,YAAmB,OAAiB,SAAuB;AAAxC;AAClB,SAAK,OAAO,QAAQ;AACpB,SAAK,QAAQ,QAAQ;AAAA,EACtB;AAAA,EARA,QAAiB,wBAAU,IAAY;AAAA,EAE9B;AAAA,EACA;AAMV;AAEO,SAAS,MAAM,MAAc,OAA0B;AAC7D,SAAO,IAAI,aAAa,MAAM,KAAK;AACpC;","names":[]}
@@ -0,0 +1,43 @@
/**
* Gets the appropriate version label and version pill styling
* given existing versions and the current version status.
*/export function getVersionLabel({
currentLocale,
currentlyPublishedVersion,
latestDraftVersion,
t,
version
}) {
const status = version.version._status;
if (status === 'draft') {
const publishedNewerThanDraft = currentlyPublishedVersion?.updatedAt > latestDraftVersion?.updatedAt;
if (publishedNewerThanDraft) {
return {
name: 'draft',
label: t('version:draft'),
pillStyle: 'light'
};
}
const isCurrentDraft = version.id === latestDraftVersion?.id;
return {
name: isCurrentDraft ? 'currentDraft' : 'draft',
label: isCurrentDraft ? t('version:currentDraft') : t('version:draft'),
pillStyle: 'light'
};
}
const publishedInAnotherLocale = status === 'published' && version.publishedLocale && currentLocale !== version.publishedLocale;
if (publishedInAnotherLocale) {
return {
name: 'currentDraft',
label: t('version:currentDraft'),
pillStyle: 'light'
};
}
const isCurrentlyPublished = currentlyPublishedVersion && version.id === currentlyPublishedVersion.id;
return {
name: isCurrentlyPublished ? 'currentlyPublished' : 'previouslyPublished',
label: isCurrentlyPublished ? t('version:currentlyPublished') : t('version:previouslyPublished'),
pillStyle: isCurrentlyPublished ? 'success' : 'light'
};
}
//# sourceMappingURL=getVersionLabel.js.map
@@ -0,0 +1,41 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.UniqueFragmentNamesRule = UniqueFragmentNamesRule;
var _GraphQLError = require('../../error/GraphQLError.js');
/**
* Unique fragment names
*
* A GraphQL document is only valid if all defined fragments have unique names.
*
* See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness
*/
function UniqueFragmentNamesRule(context) {
const knownFragmentNames = Object.create(null);
return {
OperationDefinition: () => false,
FragmentDefinition(node) {
const fragmentName = node.name.value;
if (knownFragmentNames[fragmentName]) {
context.reportError(
new _GraphQLError.GraphQLError(
`There can be only one fragment named "${fragmentName}".`,
{
nodes: [knownFragmentNames[fragmentName], node.name],
},
),
);
} else {
knownFragmentNames[fragmentName] = node.name;
}
return false;
},
};
}
@@ -0,0 +1 @@
{"version":3,"names":["_isNode","require","assertNode","node","isNode","_node$type","type","JSON","stringify","TypeError"],"sources":["../../src/asserts/assertNode.ts"],"sourcesContent":["import isNode from \"../validators/isNode.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function assertNode(node?: any): asserts node is t.Node {\n if (!isNode(node)) {\n const type = node?.type ?? JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${type}\"`);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAGe,SAASC,UAAUA,CAACC,IAAU,EAA0B;EACrE,IAAI,CAAC,IAAAC,eAAM,EAACD,IAAI,CAAC,EAAE;IAAA,IAAAE,UAAA;IACjB,MAAMC,IAAI,IAAAD,UAAA,GAAGF,IAAI,oBAAJA,IAAI,CAAEG,IAAI,YAAAD,UAAA,GAAIE,IAAI,CAACC,SAAS,CAACL,IAAI,CAAC;IAC/C,MAAM,IAAIM,SAAS,CAAC,6BAA6BH,IAAI,GAAG,CAAC;EAC3D;AACF","ignoreList":[]}
@@ -0,0 +1,64 @@
var baseTrim = require('./_baseTrim'),
isObject = require('./isObject'),
isSymbol = require('./isSymbol');
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;
/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;
/**
* Converts `value` to a number.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
*
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value);
}
module.exports = toNumber;
@@ -0,0 +1,5 @@
export { hostDetector } from './HostDetector';
export { osDetector } from './OSDetector';
export { processDetector } from './ProcessDetector';
export { serviceInstanceIdDetector } from './ServiceInstanceIdDetector';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,mCAAiD;AAAxC,+GAAA,qBAAqB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { UndiciInstrumentation } from './undici';\nexport type {\n IgnoreRequestFunction,\n RequestHookFunction,\n ResponseHookFunction,\n StartSpanHookFunction,\n UndiciInstrumentationConfig,\n UndiciRequest,\n UndiciResponse,\n} from './types';\n"]}
@@ -0,0 +1,739 @@
'use strict'
const { isArrayBuffer } = require('node:util/types')
const { webidl } = require('../webidl')
const { URLSerializer } = require('../fetch/data-url')
const { environmentSettingsObject } = require('../fetch/util')
const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints, opcodes } = require('./constants')
const {
isConnecting,
isEstablished,
isClosing,
isClosed,
isValidSubprotocol,
fireEvent,
utf8Decode,
toArrayBuffer,
getURLRecord
} = require('./util')
const { establishWebSocketConnection, closeWebSocketConnection, failWebsocketConnection } = require('./connection')
const { ByteParser } = require('./receiver')
const { kEnumerableProperty } = require('../../core/util')
const { getGlobalDispatcher } = require('../../global')
const { ErrorEvent, CloseEvent, createFastMessageEvent } = require('./events')
const { SendQueue } = require('./sender')
const { WebsocketFrameSend } = require('./frame')
const { channels } = require('../../core/diagnostics')
/**
* @typedef {object} Handler
* @property {(response: any, extensions?: string[]) => void} onConnectionEstablished
* @property {(opcode: number, data: Buffer) => void} onMessage
* @property {(error: Error) => void} onParserError
* @property {() => void} onParserDrain
* @property {(chunk: Buffer) => void} onSocketData
* @property {(err: Error) => void} onSocketError
* @property {() => void} onSocketClose
* @property {(body: Buffer) => void} onPing
* @property {(body: Buffer) => void} onPong
*
* @property {number} readyState
* @property {import('stream').Duplex} socket
* @property {Set<number>} closeState
* @property {import('../fetch/index').Fetch} controller
* @property {boolean} [wasEverConnected=false]
*/
// https://websockets.spec.whatwg.org/#interface-definition
class WebSocket extends EventTarget {
#events = {
open: null,
error: null,
close: null,
message: null
}
#bufferedAmount = 0
#protocol = ''
#extensions = ''
/** @type {SendQueue} */
#sendQueue
/** @type {Handler} */
#handler = {
onConnectionEstablished: (response, extensions) => this.#onConnectionEstablished(response, extensions),
onMessage: (opcode, data) => this.#onMessage(opcode, data),
onParserError: (err) => failWebsocketConnection(this.#handler, null, err.message),
onParserDrain: () => this.#onParserDrain(),
onSocketData: (chunk) => {
if (!this.#parser.write(chunk)) {
this.#handler.socket.pause()
}
},
onSocketError: (err) => {
this.#handler.readyState = states.CLOSING
if (channels.socketError.hasSubscribers) {
channels.socketError.publish(err)
}
this.#handler.socket.destroy()
},
onSocketClose: () => this.#onSocketClose(),
onPing: (body) => {
if (channels.ping.hasSubscribers) {
channels.ping.publish({
payload: body,
websocket: this
})
}
},
onPong: (body) => {
if (channels.pong.hasSubscribers) {
channels.pong.publish({
payload: body,
websocket: this
})
}
},
readyState: states.CONNECTING,
socket: null,
closeState: new Set(),
controller: null,
wasEverConnected: false
}
#url
#binaryType
/** @type {import('./receiver').ByteParser} */
#parser
/**
* @param {string} url
* @param {string|string[]} protocols
*/
constructor (url, protocols = []) {
super()
webidl.util.markAsUncloneable(this)
const prefix = 'WebSocket constructor'
webidl.argumentLengthCheck(arguments, 1, prefix)
const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols, prefix, 'options')
url = webidl.converters.USVString(url)
protocols = options.protocols
// 1. Let baseURL be this's relevant settings object's API base URL.
const baseURL = environmentSettingsObject.settingsObject.baseUrl
// 2. Let urlRecord be the result of getting a URL record given url and baseURL.
const urlRecord = getURLRecord(url, baseURL)
// 3. If protocols is a string, set protocols to a sequence consisting
// of just that string.
if (typeof protocols === 'string') {
protocols = [protocols]
}
// 4. If any of the values in protocols occur more than once or otherwise
// fail to match the requirements for elements that comprise the value
// of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
// protocol, then throw a "SyntaxError" DOMException.
if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
}
if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
}
// 5. Set this's url to urlRecord.
this.#url = new URL(urlRecord.href)
// 6. Let client be this's relevant settings object.
const client = environmentSettingsObject.settingsObject
// 7. Run this step in parallel:
// 7.1. Establish a WebSocket connection given urlRecord, protocols,
// and client.
this.#handler.controller = establishWebSocketConnection(
urlRecord,
protocols,
client,
this.#handler,
options
)
// Each WebSocket object has an associated ready state, which is a
// number representing the state of the connection. Initially it must
// be CONNECTING (0).
this.#handler.readyState = WebSocket.CONNECTING
// The extensions attribute must initially return the empty string.
// The protocol attribute must initially return the empty string.
// Each WebSocket object has an associated binary type, which is a
// BinaryType. Initially it must be "blob".
this.#binaryType = 'blob'
}
/**
* @see https://websockets.spec.whatwg.org/#dom-websocket-close
* @param {number|undefined} code
* @param {string|undefined} reason
*/
close (code = undefined, reason = undefined) {
webidl.brandCheck(this, WebSocket)
const prefix = 'WebSocket.close'
if (code !== undefined) {
code = webidl.converters['unsigned short'](code, prefix, 'code', webidl.attributes.Clamp)
}
if (reason !== undefined) {
reason = webidl.converters.USVString(reason)
}
// 1. If code is the special value "missing", then set code to null.
code ??= null
// 2. If reason is the special value "missing", then set reason to the empty string.
reason ??= ''
// 3. Close the WebSocket with this, code, and reason.
closeWebSocketConnection(this.#handler, code, reason, true)
}
/**
* @see https://websockets.spec.whatwg.org/#dom-websocket-send
* @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
*/
send (data) {
webidl.brandCheck(this, WebSocket)
const prefix = 'WebSocket.send'
webidl.argumentLengthCheck(arguments, 1, prefix)
data = webidl.converters.WebSocketSendData(data, prefix, 'data')
// 1. If this's ready state is CONNECTING, then throw an
// "InvalidStateError" DOMException.
if (isConnecting(this.#handler.readyState)) {
throw new DOMException('Sent before connected.', 'InvalidStateError')
}
// 2. Run the appropriate set of steps from the following list:
// https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
// https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
if (!isEstablished(this.#handler.readyState) || isClosing(this.#handler.readyState)) {
return
}
// If data is a string
if (typeof data === 'string') {
// If the WebSocket connection is established and the WebSocket
// closing handshake has not yet started, then the user agent
// must send a WebSocket Message comprised of the data argument
// using a text frame opcode; if the data cannot be sent, e.g.
// because it would need to be buffered but the buffer is full,
// the user agent must flag the WebSocket as full and then close
// the WebSocket connection. Any invocation of this method with a
// string argument that does not throw an exception must increase
// the bufferedAmount attribute by the number of bytes needed to
// express the argument as UTF-8.
const buffer = Buffer.from(data)
this.#bufferedAmount += buffer.byteLength
this.#sendQueue.add(buffer, () => {
this.#bufferedAmount -= buffer.byteLength
}, sendHints.text)
} else if (isArrayBuffer(data)) {
// If the WebSocket connection is established, and the WebSocket
// closing handshake has not yet started, then the user agent must
// send a WebSocket Message comprised of data using a binary frame
// opcode; if the data cannot be sent, e.g. because it would need
// to be buffered but the buffer is full, the user agent must flag
// the WebSocket as full and then close the WebSocket connection.
// The data to be sent is the data stored in the buffer described
// by the ArrayBuffer object. Any invocation of this method with an
// ArrayBuffer argument that does not throw an exception must
// increase the bufferedAmount attribute by the length of the
// ArrayBuffer in bytes.
this.#bufferedAmount += data.byteLength
this.#sendQueue.add(data, () => {
this.#bufferedAmount -= data.byteLength
}, sendHints.arrayBuffer)
} else if (ArrayBuffer.isView(data)) {
// If the WebSocket connection is established, and the WebSocket
// closing handshake has not yet started, then the user agent must
// send a WebSocket Message comprised of data using a binary frame
// opcode; if the data cannot be sent, e.g. because it would need to
// be buffered but the buffer is full, the user agent must flag the
// WebSocket as full and then close the WebSocket connection. The
// data to be sent is the data stored in the section of the buffer
// described by the ArrayBuffer object that data references. Any
// invocation of this method with this kind of argument that does
// not throw an exception must increase the bufferedAmount attribute
// by the length of data’s buffer in bytes.
this.#bufferedAmount += data.byteLength
this.#sendQueue.add(data, () => {
this.#bufferedAmount -= data.byteLength
}, sendHints.typedArray)
} else if (webidl.is.Blob(data)) {
// If the WebSocket connection is established, and the WebSocket
// closing handshake has not yet started, then the user agent must
// send a WebSocket Message comprised of data using a binary frame
// opcode; if the data cannot be sent, e.g. because it would need to
// be buffered but the buffer is full, the user agent must flag the
// WebSocket as full and then close the WebSocket connection. The data
// to be sent is the raw data represented by the Blob object. Any
// invocation of this method with a Blob argument that does not throw
// an exception must increase the bufferedAmount attribute by the size
// of the Blob object’s raw data, in bytes.
this.#bufferedAmount += data.size
this.#sendQueue.add(data, () => {
this.#bufferedAmount -= data.size
}, sendHints.blob)
}
}
get readyState () {
webidl.brandCheck(this, WebSocket)
// The readyState getter steps are to return this's ready state.
return this.#handler.readyState
}
get bufferedAmount () {
webidl.brandCheck(this, WebSocket)
return this.#bufferedAmount
}
get url () {
webidl.brandCheck(this, WebSocket)
// The url getter steps are to return this's url, serialized.
return URLSerializer(this.#url)
}
get extensions () {
webidl.brandCheck(this, WebSocket)
return this.#extensions
}
get protocol () {
webidl.brandCheck(this, WebSocket)
return this.#protocol
}
get onopen () {
webidl.brandCheck(this, WebSocket)
return this.#events.open
}
set onopen (fn) {
webidl.brandCheck(this, WebSocket)
if (this.#events.open) {
this.removeEventListener('open', this.#events.open)
}
const listener = webidl.converters.EventHandlerNonNull(fn)
if (listener !== null) {
this.addEventListener('open', listener)
this.#events.open = fn
} else {
this.#events.open = null
}
}
get onerror () {
webidl.brandCheck(this, WebSocket)
return this.#events.error
}
set onerror (fn) {
webidl.brandCheck(this, WebSocket)
if (this.#events.error) {
this.removeEventListener('error', this.#events.error)
}
const listener = webidl.converters.EventHandlerNonNull(fn)
if (listener !== null) {
this.addEventListener('error', listener)
this.#events.error = fn
} else {
this.#events.error = null
}
}
get onclose () {
webidl.brandCheck(this, WebSocket)
return this.#events.close
}
set onclose (fn) {
webidl.brandCheck(this, WebSocket)
if (this.#events.close) {
this.removeEventListener('close', this.#events.close)
}
const listener = webidl.converters.EventHandlerNonNull(fn)
if (listener !== null) {
this.addEventListener('close', listener)
this.#events.close = fn
} else {
this.#events.close = null
}
}
get onmessage () {
webidl.brandCheck(this, WebSocket)
return this.#events.message
}
set onmessage (fn) {
webidl.brandCheck(this, WebSocket)
if (this.#events.message) {
this.removeEventListener('message', this.#events.message)
}
const listener = webidl.converters.EventHandlerNonNull(fn)
if (listener !== null) {
this.addEventListener('message', listener)
this.#events.message = fn
} else {
this.#events.message = null
}
}
get binaryType () {
webidl.brandCheck(this, WebSocket)
return this.#binaryType
}
set binaryType (type) {
webidl.brandCheck(this, WebSocket)
if (type !== 'blob' && type !== 'arraybuffer') {
this.#binaryType = 'blob'
} else {
this.#binaryType = type
}
}
/**
* @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
*/
#onConnectionEstablished (response, parsedExtensions) {
// processResponse is called when the "response’s header list has been received and initialized."
// once this happens, the connection is open
this.#handler.socket = response.socket
const parser = new ByteParser(this.#handler, parsedExtensions)
parser.on('drain', () => this.#handler.onParserDrain())
parser.on('error', (err) => this.#handler.onParserError(err))
this.#parser = parser
this.#sendQueue = new SendQueue(response.socket)
// 1. Change the ready state to OPEN (1).
this.#handler.readyState = states.OPEN
// 2. Change the extensions attribute’s value to the extensions in use, if
// it is not the null value.
// https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
const extensions = response.headersList.get('sec-websocket-extensions')
if (extensions !== null) {
this.#extensions = extensions
}
// 3. Change the protocol attribute’s value to the subprotocol in use, if
// it is not the null value.
// https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
const protocol = response.headersList.get('sec-websocket-protocol')
if (protocol !== null) {
this.#protocol = protocol
}
// 4. Fire an event named open at the WebSocket object.
fireEvent('open', this)
if (channels.open.hasSubscribers) {
// Convert headers to a plain object for the event
const headers = response.headersList.entries
channels.open.publish({
address: response.socket.address(),
protocol: this.#protocol,
extensions: this.#extensions,
websocket: this,
handshakeResponse: {
status: response.status,
statusText: response.statusText,
headers
}
})
}
}
#onMessage (type, data) {
// 1. If ready state is not OPEN (1), then return.
if (this.#handler.readyState !== states.OPEN) {
return
}
// 2. Let dataForEvent be determined by switching on type and binary type:
let dataForEvent
if (type === opcodes.TEXT) {
// -> type indicates that the data is Text
// a new DOMString containing data
try {
dataForEvent = utf8Decode(data)
} catch {
failWebsocketConnection(this.#handler, 1007, 'Received invalid UTF-8 in text frame.')
return
}
} else if (type === opcodes.BINARY) {
if (this.#binaryType === 'blob') {
// -> type indicates that the data is Binary and binary type is "blob"
// a new Blob object, created in the relevant Realm of the WebSocket
// object, that represents data as its raw data
dataForEvent = new Blob([data])
} else {
// -> type indicates that the data is Binary and binary type is "arraybuffer"
// a new ArrayBuffer object, created in the relevant Realm of the
// WebSocket object, whose contents are data
dataForEvent = toArrayBuffer(data)
}
}
// 3. Fire an event named message at the WebSocket object, using MessageEvent,
// with the origin attribute initialized to the serialization of the WebSocket
// object’s url's origin, and the data attribute initialized to dataForEvent.
fireEvent('message', this, createFastMessageEvent, {
origin: this.#url.origin,
data: dataForEvent
})
}
#onParserDrain () {
this.#handler.socket.resume()
}
/**
* @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
* @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
*/
#onSocketClose () {
// If the TCP connection was closed after the
// WebSocket closing handshake was completed, the WebSocket connection
// is said to have been closed _cleanly_.
const wasClean =
this.#handler.closeState.has(sentCloseFrameState.SENT) &&
this.#handler.closeState.has(sentCloseFrameState.RECEIVED)
let code = 1005
let reason = ''
const result = this.#parser?.closingInfo
if (result && !result.error) {
code = result.code ?? 1005
reason = result.reason
}
// 1. Change the ready state to CLOSED (3).
this.#handler.readyState = states.CLOSED
// 2. If the user agent was required to fail the WebSocket
// connection, or if the WebSocket connection was closed
// after being flagged as full, fire an event named error
// at the WebSocket object.
if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
// If _The WebSocket
// Connection is Closed_ and no Close control frame was received by the
// endpoint (such as could occur if the underlying transport connection
// is lost), _The WebSocket Connection Close Code_ is considered to be
// 1006.
code = 1006
fireEvent('error', this, (type, init) => new ErrorEvent(type, init), {
error: new TypeError(reason)
})
}
// 3. Fire an event named close at the WebSocket object,
// using CloseEvent, with the wasClean attribute
// initialized to true if the connection closed cleanly
// and false otherwise, the code attribute initialized to
// the WebSocket connection close code, and the reason
// attribute initialized to the result of applying UTF-8
// decode without BOM to the WebSocket connection close
// reason.
// TODO: process.nextTick
fireEvent('close', this, (type, init) => new CloseEvent(type, init), {
wasClean, code, reason
})
if (channels.close.hasSubscribers) {
channels.close.publish({
websocket: this,
code,
reason
})
}
}
/**
* @param {WebSocket} ws
* @param {Buffer|undefined} buffer
*/
static ping (ws, buffer) {
if (Buffer.isBuffer(buffer)) {
if (buffer.length > 125) {
throw new TypeError('A PING frame cannot have a body larger than 125 bytes.')
}
} else if (buffer !== undefined) {
throw new TypeError('Expected buffer payload')
}
// An endpoint MAY send a Ping frame any time after the connection is
// established and before the connection is closed.
const readyState = ws.#handler.readyState
if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) {
const frame = new WebsocketFrameSend(buffer)
ws.#handler.socket.write(frame.createFrame(opcodes.PING))
}
}
}
const { ping } = WebSocket
Reflect.deleteProperty(WebSocket, 'ping')
// https://websockets.spec.whatwg.org/#dom-websocket-connecting
WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
// https://websockets.spec.whatwg.org/#dom-websocket-open
WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
// https://websockets.spec.whatwg.org/#dom-websocket-closing
WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
// https://websockets.spec.whatwg.org/#dom-websocket-closed
WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
Object.defineProperties(WebSocket.prototype, {
CONNECTING: staticPropertyDescriptors,
OPEN: staticPropertyDescriptors,
CLOSING: staticPropertyDescriptors,
CLOSED: staticPropertyDescriptors,
url: kEnumerableProperty,
readyState: kEnumerableProperty,
bufferedAmount: kEnumerableProperty,
onopen: kEnumerableProperty,
onerror: kEnumerableProperty,
onclose: kEnumerableProperty,
close: kEnumerableProperty,
onmessage: kEnumerableProperty,
binaryType: kEnumerableProperty,
send: kEnumerableProperty,
extensions: kEnumerableProperty,
protocol: kEnumerableProperty,
[Symbol.toStringTag]: {
value: 'WebSocket',
writable: false,
enumerable: false,
configurable: true
}
})
Object.defineProperties(WebSocket, {
CONNECTING: staticPropertyDescriptors,
OPEN: staticPropertyDescriptors,
CLOSING: staticPropertyDescriptors,
CLOSED: staticPropertyDescriptors
})
webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
webidl.converters.DOMString
)
webidl.converters['DOMString or sequence<DOMString>'] = function (V, prefix, argument) {
if (webidl.util.Type(V) === webidl.util.Types.OBJECT && Symbol.iterator in V) {
return webidl.converters['sequence<DOMString>'](V)
}
return webidl.converters.DOMString(V, prefix, argument)
}
// This implements the proposal made in https://github.com/whatwg/websockets/issues/42
webidl.converters.WebSocketInit = webidl.dictionaryConverter([
{
key: 'protocols',
converter: webidl.converters['DOMString or sequence<DOMString>'],
defaultValue: () => []
},
{
key: 'dispatcher',
converter: webidl.converters.any,
defaultValue: () => getGlobalDispatcher()
},
{
key: 'headers',
converter: webidl.nullableConverter(webidl.converters.HeadersInit)
}
])
webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
if (webidl.util.Type(V) === webidl.util.Types.OBJECT && !(Symbol.iterator in V)) {
return webidl.converters.WebSocketInit(V)
}
return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
}
webidl.converters.WebSocketSendData = function (V) {
if (webidl.util.Type(V) === webidl.util.Types.OBJECT) {
if (webidl.is.Blob(V)) {
return V
}
if (webidl.is.BufferSource(V)) {
return V
}
}
return webidl.converters.USVString(V)
}
module.exports = {
WebSocket,
ping
}
@@ -0,0 +1,37 @@
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime'
import Emotion, { createEmotionProps } from './emotion-element'
import { hasOwn } from './utils'
import { Interpolation } from '@emotion/serialize'
import { Theme } from './theming'
export type { EmotionJSX as JSX } from './jsx-namespace'
export const Fragment = ReactJSXRuntimeDev.Fragment
export const jsxDEV: typeof ReactJSXRuntimeDev.jsxDEV = (
type,
props,
key,
isStaticChildren,
source,
self
) => {
if (!hasOwn.call(props, 'css')) {
return ReactJSXRuntimeDev.jsxDEV(
type,
props,
key,
isStaticChildren,
source,
self
)
}
return ReactJSXRuntimeDev.jsxDEV(
Emotion,
createEmotionProps(type, props as { css: Interpolation<Theme> }),
key,
isStaticChildren,
source,
self
)
}
@@ -0,0 +1,3 @@
export { types } from './types/index.mjs';
export { imageSize as default, disableTypes, imageSize } from './lookup.mjs';
import './types/interface.mjs';
@@ -0,0 +1 @@
{"version":3,"file":"gamepad.js","sources":["../../../src/icons/gamepad.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Gamepad\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iNiIgeDI9IjEwIiB5MT0iMTIiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iOCIgeDI9IjgiIHkxPSIxMCIgeTI9IjE0IiAvPgogIDxsaW5lIHgxPSIxNSIgeDI9IjE1LjAxIiB5MT0iMTMiIHkyPSIxMyIgLz4KICA8bGluZSB4MT0iMTgiIHgyPSIxOC4wMSIgeTE9IjExIiB5Mj0iMTEiIC8+CiAgPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjEyIiB4PSIyIiB5PSI2IiByeD0iMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/gamepad\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 Gamepad = createLucideIcon('Gamepad', [\n ['line', { x1: '6', x2: '10', y1: '12', y2: '12', key: '161bw2' }],\n ['line', { x1: '8', x2: '8', y1: '10', y2: '14', key: '1i6ji0' }],\n ['line', { x1: '15', x2: '15.01', y1: '13', y2: '13', key: 'dqpgro' }],\n ['line', { x1: '18', x2: '18.01', y1: '11', y2: '11', key: 'meh2c' }],\n ['rect', { width: '20', height: '12', x: '2', y: '6', rx: '2', key: '9lu3g6' }],\n]);\n\nexport default Gamepad;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,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,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,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,CAAS,CAAA,CAAA,CAAA,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,CACrE,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,CAAS,CAAA,CAAA,CAAA,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,SAAS,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"move-horizontal.js","sources":["../../../src/icons/move-horizontal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MoveHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxOCA4IDIyIDEyIDE4IDE2IiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjYgOCAyIDEyIDYgMTYiIC8+CiAgPGxpbmUgeDE9IjIiIHgyPSIyMiIgeTE9IjEyIiB5Mj0iMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/move-horizontal\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 MoveHorizontal = createLucideIcon('MoveHorizontal', [\n ['polyline', { points: '18 8 22 12 18 16', key: '1hqrds' }],\n ['polyline', { points: '6 8 2 12 6 16', key: 'f0ernq' }],\n ['line', { x1: '2', x2: '22', y1: '12', y2: '12', key: '1dnqot' }],\n]);\n\nexport default MoveHorizontal;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAoB,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,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACvD,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,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;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,502 @@
import { encode, decode } from '@jridgewell/sourcemap-codec';
import resolver from './resolve';
import maybeSort from './sort';
import buildBySources from './by-source';
import {
memoizedState,
memoizedBinarySearch,
upperBound,
lowerBound,
found as bsFound,
} from './binary-search';
import {
COLUMN,
SOURCES_INDEX,
SOURCE_LINE,
SOURCE_COLUMN,
NAMES_INDEX,
REV_GENERATED_LINE,
REV_GENERATED_COLUMN,
} from './sourcemap-segment';
import { parse } from './types';
import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';
import type {
SourceMapV3,
DecodedSourceMap,
EncodedSourceMap,
InvalidOriginalMapping,
OriginalMapping,
InvalidGeneratedMapping,
GeneratedMapping,
SourceMapInput,
Needle,
SourceNeedle,
SourceMap,
EachMapping,
Bias,
XInput,
SectionedSourceMap,
Ro,
} from './types';
import type { Source } from './by-source';
import type { MemoState } from './binary-search';
export type { SourceMapSegment } from './sourcemap-segment';
export type {
SourceMap,
DecodedSourceMap,
EncodedSourceMap,
Section,
SectionedSourceMap,
SourceMapV3,
Bias,
EachMapping,
GeneratedMapping,
InvalidGeneratedMapping,
InvalidOriginalMapping,
Needle,
OriginalMapping,
OriginalMapping as Mapping,
SectionedSourceMapInput,
SourceMapInput,
SourceNeedle,
XInput,
EncodedSourceMapXInput,
DecodedSourceMapXInput,
SectionedSourceMapXInput,
SectionXInput,
} from './types';
interface PublicMap {
_encoded: TraceMap['_encoded'];
_decoded: TraceMap['_decoded'];
_decodedMemo: TraceMap['_decodedMemo'];
_bySources: TraceMap['_bySources'];
_bySourceMemos: TraceMap['_bySourceMemos'];
}
const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';
const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';
export const LEAST_UPPER_BOUND = -1;
export const GREATEST_LOWER_BOUND = 1;
export { FlattenMap, FlattenMap as AnyMap } from './flatten-map';
export class TraceMap implements SourceMap {
declare version: SourceMapV3['version'];
declare file: SourceMapV3['file'];
declare names: SourceMapV3['names'];
declare sourceRoot: SourceMapV3['sourceRoot'];
declare sources: SourceMapV3['sources'];
declare sourcesContent: SourceMapV3['sourcesContent'];
declare ignoreList: SourceMapV3['ignoreList'];
declare resolvedSources: string[];
declare private _encoded: string | undefined;
declare private _decoded: SourceMapSegment[][] | undefined;
declare private _decodedMemo: MemoState;
declare private _bySources: Source[] | undefined;
declare private _bySourceMemos: MemoState[] | undefined;
constructor(map: Ro<SourceMapInput>, mapUrl?: string | null) {
const isString = typeof map === 'string';
if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;
const parsed = parse(map as Exclude<SourceMapInput, TraceMap>);
const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
this.version = version;
this.file = file;
this.names = names || [];
this.sourceRoot = sourceRoot;
this.sources = sources;
this.sourcesContent = sourcesContent;
this.ignoreList = parsed.ignoreList || (parsed as XInput).x_google_ignoreList || undefined;
const resolve = resolver(mapUrl, sourceRoot);
this.resolvedSources = sources.map(resolve);
const { mappings } = parsed;
if (typeof mappings === 'string') {
this._encoded = mappings;
this._decoded = undefined;
} else if (Array.isArray(mappings)) {
this._encoded = undefined;
this._decoded = maybeSort(mappings, isString);
} else if ((parsed as unknown as SectionedSourceMap).sections) {
throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
} else {
throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
}
this._decodedMemo = memoizedState();
this._bySources = undefined;
this._bySourceMemos = undefined;
}
}
/**
* Typescript doesn't allow friend access to private fields, so this just casts the map into a type
* with public access modifiers.
*/
function cast(map: unknown): PublicMap {
return map as any;
}
/**
* Returns the encoded (VLQ string) form of the SourceMap's mappings field.
*/
export function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'] {
return (cast(map)._encoded ??= encode(cast(map)._decoded!));
}
/**
* Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
*/
export function decodedMappings(map: TraceMap): Readonly<DecodedSourceMap['mappings']> {
return (cast(map)._decoded ||= decode(cast(map)._encoded!));
}
/**
* A low-level API to find the segment associated with a generated line/column (think, from a
* stack trace). Line and column here are 0-based, unlike `originalPositionFor`.
*/
export function traceSegment(
map: TraceMap,
line: number,
column: number,
): Readonly<SourceMapSegment> | null {
const decoded = decodedMappings(map);
// It's common for parent source maps to have pointers to lines that have no
// mapping (like a "//# sourceMappingURL=") at the end of the child file.
if (line >= decoded.length) return null;
const segments = decoded[line];
const index = traceSegmentInternal(
segments,
cast(map)._decodedMemo,
line,
column,
GREATEST_LOWER_BOUND,
);
return index === -1 ? null : segments[index];
}
/**
* A higher-level API to find the source/line/column associated with a generated line/column
* (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
* `source-map` library.
*/
export function originalPositionFor(
map: TraceMap,
needle: Needle,
): OriginalMapping | InvalidOriginalMapping {
let { line, column, bias } = needle;
line--;
if (line < 0) throw new Error(LINE_GTR_ZERO);
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
const decoded = decodedMappings(map);
// It's common for parent source maps to have pointers to lines that have no
// mapping (like a "//# sourceMappingURL=") at the end of the child file.
if (line >= decoded.length) return OMapping(null, null, null, null);
const segments = decoded[line];
const index = traceSegmentInternal(
segments,
cast(map)._decodedMemo,
line,
column,
bias || GREATEST_LOWER_BOUND,
);
if (index === -1) return OMapping(null, null, null, null);
const segment = segments[index];
if (segment.length === 1) return OMapping(null, null, null, null);
const { names, resolvedSources } = map;
return OMapping(
resolvedSources[segment[SOURCES_INDEX]],
segment[SOURCE_LINE] + 1,
segment[SOURCE_COLUMN],
segment.length === 5 ? names[segment[NAMES_INDEX]] : null,
);
}
/**
* Finds the generated line/column position of the provided source/line/column source position.
*/
export function generatedPositionFor(
map: TraceMap,
needle: SourceNeedle,
): GeneratedMapping | InvalidGeneratedMapping {
const { source, line, column, bias } = needle;
return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);
}
/**
* Finds all generated line/column positions of the provided source/line/column source position.
*/
export function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[] {
const { source, line, column, bias } = needle;
// SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.
return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);
}
/**
* Iterates each mapping in generated position order.
*/
export function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void {
const decoded = decodedMappings(map);
const { names, resolvedSources } = map;
for (let i = 0; i < decoded.length; i++) {
const line = decoded[i];
for (let j = 0; j < line.length; j++) {
const seg = line[j];
const generatedLine = i + 1;
const generatedColumn = seg[0];
let source = null;
let originalLine = null;
let originalColumn = null;
let name = null;
if (seg.length !== 1) {
source = resolvedSources[seg[1]];
originalLine = seg[2] + 1;
originalColumn = seg[3];
}
if (seg.length === 5) name = names[seg[4]];
cb({
generatedLine,
generatedColumn,
source,
originalLine,
originalColumn,
name,
} as EachMapping);
}
}
}
function sourceIndex(map: TraceMap, source: string): number {
const { sources, resolvedSources } = map;
let index = sources.indexOf(source);
if (index === -1) index = resolvedSources.indexOf(source);
return index;
}
/**
* Retrieves the source content for a particular source, if its found. Returns null if not.
*/
export function sourceContentFor(map: TraceMap, source: string): string | null {
const { sourcesContent } = map;
if (sourcesContent == null) return null;
const index = sourceIndex(map, source);
return index === -1 ? null : sourcesContent[index];
}
/**
* Determines if the source is marked to ignore by the source map.
*/
export function isIgnored(map: TraceMap, source: string): boolean {
const { ignoreList } = map;
if (ignoreList == null) return false;
const index = sourceIndex(map, source);
return index === -1 ? false : ignoreList.includes(index);
}
/**
* A helper that skips sorting of the input map's mappings array, which can be expensive for larger
* maps.
*/
export function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap {
const tracer = new TraceMap(clone(map, []), mapUrl);
cast(tracer)._decoded = map.mappings;
return tracer;
}
/**
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export function decodedMap(
map: TraceMap,
): Omit<DecodedSourceMap, 'mappings'> & { mappings: readonly SourceMapSegment[][] } {
return clone(map, decodedMappings(map));
}
/**
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
* a sourcemap, or to JSON.stringify.
*/
export function encodedMap(map: TraceMap): EncodedSourceMap {
return clone(map, encodedMappings(map));
}
function clone<T extends string | readonly SourceMapSegment[][]>(
map: TraceMap | DecodedSourceMap,
mappings: T,
): T extends string ? EncodedSourceMap : DecodedSourceMap {
return {
version: map.version,
file: map.file,
names: map.names,
sourceRoot: map.sourceRoot,
sources: map.sources,
sourcesContent: map.sourcesContent,
mappings,
ignoreList: map.ignoreList || (map as XInput).x_google_ignoreList,
} as any;
}
function OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;
function OMapping(
source: string,
line: number,
column: number,
name: string | null,
): OriginalMapping;
function OMapping(
source: string | null,
line: number | null,
column: number | null,
name: string | null,
): OriginalMapping | InvalidOriginalMapping {
return { source, line, column, name } as any;
}
function GMapping(line: null, column: null): InvalidGeneratedMapping;
function GMapping(line: number, column: number): GeneratedMapping;
function GMapping(
line: number | null,
column: number | null,
): GeneratedMapping | InvalidGeneratedMapping {
return { line, column } as any;
}
function traceSegmentInternal(
segments: SourceMapSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number;
function traceSegmentInternal(
segments: ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number;
function traceSegmentInternal(
segments: SourceMapSegment[] | ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): number {
let index = memoizedBinarySearch(segments, column, memo, line);
if (bsFound) {
index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
} else if (bias === LEAST_UPPER_BOUND) index++;
if (index === -1 || index === segments.length) return -1;
return index;
}
function sliceGeneratedPositions(
segments: ReverseSegment[],
memo: MemoState,
line: number,
column: number,
bias: Bias,
): GeneratedMapping[] {
let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);
// We ignored the bias when tracing the segment so that we're guarnateed to find the first (in
// insertion order) segment that matched. Even if we did respect the bias when tracing, we would
// still need to call `lowerBound()` to find the first segment, which is slower than just looking
// for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the
// binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to
// match LEAST_UPPER_BOUND.
if (!bsFound && bias === LEAST_UPPER_BOUND) min++;
if (min === -1 || min === segments.length) return [];
// We may have found the segment that started at an earlier column. If this is the case, then we
// need to slice all generated segments that match _that_ column, because all such segments span
// to our desired column.
const matchedColumn = bsFound ? column : segments[min][COLUMN];
// The binary search is not guaranteed to find the lower bound when a match wasn't found.
if (!bsFound) min = lowerBound(segments, matchedColumn, min);
const max = upperBound(segments, matchedColumn, min);
const result = [];
for (; min <= max; min++) {
const segment = segments[min];
result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));
}
return result;
}
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: false,
): GeneratedMapping | InvalidGeneratedMapping;
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: true,
): GeneratedMapping[];
function generatedPosition(
map: TraceMap,
source: string,
line: number,
column: number,
bias: Bias,
all: boolean,
): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {
line--;
if (line < 0) throw new Error(LINE_GTR_ZERO);
if (column < 0) throw new Error(COL_GTR_EQ_ZERO);
const { sources, resolvedSources } = map;
let sourceIndex = sources.indexOf(source);
if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);
if (sourceIndex === -1) return all ? [] : GMapping(null, null);
const bySourceMemos = (cast(map)._bySourceMemos ||= sources.map(memoizedState));
const generated = (cast(map)._bySources ||= buildBySources(decodedMappings(map), bySourceMemos));
const segments = generated[sourceIndex][line];
if (segments == null) return all ? [] : GMapping(null, null);
const memo = bySourceMemos[sourceIndex];
if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);
const index = traceSegmentInternal(segments, memo, line, column, bias);
if (index === -1) return GMapping(null, null);
const segment = segments[index];
return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);
}
@@ -0,0 +1 @@
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../src/core/__mocks__/logger.ts"],"names":[],"mappings":";;;AAAA;IAAA;IAmBA,CAAC;IAlBG,gEAAgE;IAChE,sBAAK,GAAL,cAAe,CAAC;IAEhB,gEAAgE;IACzD,aAAM,GAAb,cAAuB,CAAC;IAExB,gEAAgE;IACzD,cAAO,GAAd,cAAwB,CAAC;IAElB,kBAAW,GAAlB;QACI,OAAO,cAAM,CAAC;IAClB,CAAC;IAED,gEAAgE;IAChE,qBAAI,GAAJ,cAAc,CAAC;IAEf,gEAAgE;IAChE,sBAAK,GAAL,cAAe,CAAC;IACpB,aAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,wBAAM;AAqBN,QAAA,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC"}
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
};
const def = {
keyword: "unevaluatedItems",
type: "array",
schemaType: ["boolean", "object"],
error,
code(cxt) {
const { gen, schema, data, it } = cxt;
const items = it.items || 0;
if (items === true)
return;
const len = gen.const("len", (0, codegen_1._) `${data}.length`);
if (schema === false) {
cxt.setParams({ len: items });
cxt.fail((0, codegen_1._) `${len} > ${items}`);
}
else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items}`);
gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
cxt.ok(valid);
}
it.items = true;
function validateItems(valid, from) {
gen.forRange("i", from, len, (i) => {
cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
if (!it.allErrors)
gen.if((0, codegen_1.not)(valid), () => gen.break());
});
}
},
};
exports.default = def;
//# sourceMappingURL=unevaluatedItems.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/database/migrations/migrateDown.ts"],"sourcesContent":["import type { BaseDatabaseAdapter } from '../types.js'\n\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { createLocalReq } from '../../utilities/createLocalReq.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getMigrations } from './getMigrations.js'\nimport { readMigrationFiles } from './readMigrationFiles.js'\n\nexport async function migrateDown(this: BaseDatabaseAdapter): Promise<void> {\n const { payload } = this\n const migrationFiles = await readMigrationFiles({ payload })\n\n const { existingMigrations, latestBatch } = await getMigrations({\n payload,\n })\n\n if (!existingMigrations?.length) {\n payload.logger.info({ msg: 'No migrations to rollback.' })\n return\n }\n\n payload.logger.info({\n msg: `Rolling back batch ${latestBatch} consisting of ${existingMigrations.length} migration(s).`,\n })\n\n const latestBatchMigrations = existingMigrations.filter(({ batch }) => batch === latestBatch)\n\n for (const migration of latestBatchMigrations) {\n const migrationFile = migrationFiles.find((m) => m.name === migration.name)\n if (!migrationFile) {\n throw new Error(`Migration ${migration.name} not found locally.`)\n }\n\n const start = Date.now()\n const req = await createLocalReq({}, payload)\n\n try {\n payload.logger.info({ msg: `Migrating down: ${migrationFile.name}` })\n await initTransaction(req)\n const session = payload.db.sessions?.[await req.transactionID!]\n await migrationFile.down({ payload, req, session })\n payload.logger.info({\n msg: `Migrated down: ${migrationFile.name} (${Date.now() - start}ms)`,\n })\n // Waiting for implementation here\n await payload.delete({\n id: migration.id!,\n collection: 'payload-migrations',\n req,\n })\n\n await commitTransaction(req)\n } catch (err: unknown) {\n await killTransaction(req)\n payload.logger.error({\n err,\n msg: `Error running migration ${migrationFile.name}`,\n })\n process.exit(1)\n }\n }\n}\n"],"names":["commitTransaction","createLocalReq","initTransaction","killTransaction","getMigrations","readMigrationFiles","migrateDown","payload","migrationFiles","existingMigrations","latestBatch","length","logger","info","msg","latestBatchMigrations","filter","batch","migration","migrationFile","find","m","name","Error","start","Date","now","req","session","db","sessions","transactionID","down","delete","id","collection","err","error","process","exit"],"mappings":"AAEA,SAASA,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,OAAO,eAAeC;IACpB,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI;IACxB,MAAMC,iBAAiB,MAAMH,mBAAmB;QAAEE;IAAQ;IAE1D,MAAM,EAAEE,kBAAkB,EAAEC,WAAW,EAAE,GAAG,MAAMN,cAAc;QAC9DG;IACF;IAEA,IAAI,CAACE,oBAAoBE,QAAQ;QAC/BJ,QAAQK,MAAM,CAACC,IAAI,CAAC;YAAEC,KAAK;QAA6B;QACxD;IACF;IAEAP,QAAQK,MAAM,CAACC,IAAI,CAAC;QAClBC,KAAK,CAAC,mBAAmB,EAAEJ,YAAY,eAAe,EAAED,mBAAmBE,MAAM,CAAC,cAAc,CAAC;IACnG;IAEA,MAAMI,wBAAwBN,mBAAmBO,MAAM,CAAC,CAAC,EAAEC,KAAK,EAAE,GAAKA,UAAUP;IAEjF,KAAK,MAAMQ,aAAaH,sBAAuB;QAC7C,MAAMI,gBAAgBX,eAAeY,IAAI,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAKJ,UAAUI,IAAI;QAC1E,IAAI,CAACH,eAAe;YAClB,MAAM,IAAII,MAAM,CAAC,UAAU,EAAEL,UAAUI,IAAI,CAAC,mBAAmB,CAAC;QAClE;QAEA,MAAME,QAAQC,KAAKC,GAAG;QACtB,MAAMC,MAAM,MAAM1B,eAAe,CAAC,GAAGM;QAErC,IAAI;YACFA,QAAQK,MAAM,CAACC,IAAI,CAAC;gBAAEC,KAAK,CAAC,gBAAgB,EAAEK,cAAcG,IAAI,EAAE;YAAC;YACnE,MAAMpB,gBAAgByB;YACtB,MAAMC,UAAUrB,QAAQsB,EAAE,CAACC,QAAQ,EAAE,CAAC,MAAMH,IAAII,aAAa,CAAE;YAC/D,MAAMZ,cAAca,IAAI,CAAC;gBAAEzB;gBAASoB;gBAAKC;YAAQ;YACjDrB,QAAQK,MAAM,CAACC,IAAI,CAAC;gBAClBC,KAAK,CAAC,gBAAgB,EAAEK,cAAcG,IAAI,CAAC,EAAE,EAAEG,KAAKC,GAAG,KAAKF,MAAM,GAAG,CAAC;YACxE;YACA,kCAAkC;YAClC,MAAMjB,QAAQ0B,MAAM,CAAC;gBACnBC,IAAIhB,UAAUgB,EAAE;gBAChBC,YAAY;gBACZR;YACF;YAEA,MAAM3B,kBAAkB2B;QAC1B,EAAE,OAAOS,KAAc;YACrB,MAAMjC,gBAAgBwB;YACtBpB,QAAQK,MAAM,CAACyB,KAAK,CAAC;gBACnBD;gBACAtB,KAAK,CAAC,wBAAwB,EAAEK,cAAcG,IAAI,EAAE;YACtD;YACAgB,QAAQC,IAAI,CAAC;QACf;IACF;AACF"}
@@ -0,0 +1,22 @@
import { DirectusOperation } from "../../../schema/operation.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/delete/operations.d.ts
/**
* Delete multiple existing operations.
* @param keys
* @returns
* @throws Will throw if keys is empty
*/
declare const deleteOperations: <Schema>(keys: DirectusOperation<Schema>["id"][]) => RestCommand<void, Schema>;
/**
* Delete an existing operation.
* @param key
* @returns
* @throws Will throw if key is empty
*/
declare const deleteOperation: <Schema>(key: DirectusOperation<Schema>["id"]) => RestCommand<void, Schema>;
//#endregion
export { deleteOperation, deleteOperations };
//# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1,65 @@
"use strict";
exports.DayParser = void 0;
var _index = require("../../../setDay.cjs");
var _Parser = require("../Parser.cjs");
// Day of week
class DayParser extends _Parser.Parser {
priority = 90;
parse(dateString, token, match) {
switch (token) {
// Tue
case "E":
case "EE":
case "EEE":
return (
match.day(dateString, {
width: "abbreviated",
context: "formatting",
}) ||
match.day(dateString, { width: "short", context: "formatting" }) ||
match.day(dateString, { width: "narrow", context: "formatting" })
);
// T
case "EEEEE":
return match.day(dateString, {
width: "narrow",
context: "formatting",
});
// Tu
case "EEEEEE":
return (
match.day(dateString, { width: "short", context: "formatting" }) ||
match.day(dateString, { width: "narrow", context: "formatting" })
);
// Tuesday
case "EEEE":
default:
return (
match.day(dateString, { width: "wide", context: "formatting" }) ||
match.day(dateString, {
width: "abbreviated",
context: "formatting",
}) ||
match.day(dateString, { width: "short", context: "formatting" }) ||
match.day(dateString, { width: "narrow", context: "formatting" })
);
}
}
validate(_date, value) {
return value >= 0 && value <= 6;
}
set(date, _flags, value, options) {
date = (0, _index.setDay)(date, value, options);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
}
exports.DayParser = DayParser;
@@ -0,0 +1,75 @@
import { getDefaultOptions } from "./_lib/defaultOptions.js";
import { constructFrom } from "./constructFrom.js";
import { differenceInCalendarDays } from "./differenceInCalendarDays.js";
import { startOfWeekYear } from "./startOfWeekYear.js";
import { toDate } from "./toDate.js";
/**
* The {@link setWeekYear} function options.
*/
/**
* @name setWeekYear
* @category Week-Numbering Year Helpers
* @summary Set the local week-numbering year to the given date.
*
* @description
* Set the local week-numbering year to the given date,
* saving the week number and the weekday number.
* The exact calculation depends on the values of
* `options.weekStartsOn` (which is the index of the first day of the week)
* and `options.firstWeekContainsDate` (which is the day of January, which is always in
* the first week of the week-numbering year)
*
* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param weekYear - The local week-numbering year of the new date
* @param options - An object with options
*
* @returns The new date with the local week-numbering year set
*
* @example
* // Set the local week-numbering year 2004 to 2 January 2010 with default options:
* const result = setWeekYear(new Date(2010, 0, 2), 2004)
* //=> Sat Jan 03 2004 00:00:00
*
* @example
* // Set the local week-numbering year 2004 to 2 January 2010,
* // if Monday is the first day of week
* // and 4 January is always in the first week of the year:
* const result = setWeekYear(new Date(2010, 0, 2), 2004, {
* weekStartsOn: 1,
* firstWeekContainsDate: 4
* })
* //=> Sat Jan 01 2005 00:00:00
*/
export function setWeekYear(date, weekYear, options) {
const defaultOptions = getDefaultOptions();
const firstWeekContainsDate =
options?.firstWeekContainsDate ??
options?.locale?.options?.firstWeekContainsDate ??
defaultOptions.firstWeekContainsDate ??
defaultOptions.locale?.options?.firstWeekContainsDate ??
1;
const diff = differenceInCalendarDays(
toDate(date, options?.in),
startOfWeekYear(date, options),
options,
);
const firstWeek = constructFrom(options?.in || date, 0);
firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);
firstWeek.setHours(0, 0, 0, 0);
const date_ = startOfWeekYear(firstWeek, options);
date_.setDate(date_.getDate() + diff);
return date_;
}
// Fallback for modularized imports:
export default setWeekYear;
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/getTranslationsByContext.ts"],"sourcesContent":["import type { Language } from '../types.js'\n\nimport { clientTranslationKeys } from '../clientKeys.js'\n\nfunction filterKeys(obj: Record<string, unknown>, parentGroupKey = '', keys: string[]) {\n const result: Record<string, unknown> = {}\n\n for (const [namespaceKey, value] of Object.entries(obj)) {\n // Skip $schema key\n if (namespaceKey === '$schema') {\n result[namespaceKey] = value\n continue\n }\n\n if (typeof value === 'object') {\n const filteredObject = filterKeys(value as Record<string, unknown>, namespaceKey, keys)\n if (Object.keys(filteredObject).length > 0) {\n result[namespaceKey] = filteredObject\n }\n } else {\n for (const key of keys) {\n const [groupKey, selector] = key.split(':')\n\n if (parentGroupKey === groupKey) {\n if (namespaceKey === selector) {\n result[selector] = value\n } else {\n const pluralKeys = ['zero', 'one', 'two', 'few', 'many', 'other']\n pluralKeys.forEach((pluralKey) => {\n if (namespaceKey === `${selector}_${pluralKey}`) {\n result[`${selector}_${pluralKey}`] = value\n }\n })\n }\n }\n }\n }\n }\n\n return result\n}\n\nfunction sortObject(obj: Record<string, unknown>) {\n const sortedObject: Record<string, unknown> = {}\n Object.keys(obj)\n .sort()\n .forEach((key) => {\n if (typeof obj[key] === 'object') {\n sortedObject[key] = sortObject(obj[key] as Record<string, unknown>)\n } else {\n sortedObject[key] = obj[key]\n }\n })\n return sortedObject\n}\n\nexport const getTranslationsByContext = (selectedLanguage: Language, context: 'api' | 'client') => {\n if (context === 'client') {\n return sortObject(filterKeys(selectedLanguage.translations, '', clientTranslationKeys))\n } else {\n return selectedLanguage.translations\n }\n}\n"],"names":["clientTranslationKeys","filterKeys","obj","parentGroupKey","keys","result","namespaceKey","value","Object","entries","filteredObject","length","key","groupKey","selector","split","pluralKeys","forEach","pluralKey","sortObject","sortedObject","sort","getTranslationsByContext","selectedLanguage","context","translations"],"mappings":"AAEA,SAASA,qBAAqB,QAAQ,mBAAkB;AAExD,SAASC,WAAWC,GAA4B,EAAEC,iBAAiB,EAAE,EAAEC,IAAc;IACnF,MAAMC,SAAkC,CAAC;IAEzC,KAAK,MAAM,CAACC,cAAcC,MAAM,IAAIC,OAAOC,OAAO,CAACP,KAAM;QACvD,mBAAmB;QACnB,IAAII,iBAAiB,WAAW;YAC9BD,MAAM,CAACC,aAAa,GAAGC;YACvB;QACF;QAEA,IAAI,OAAOA,UAAU,UAAU;YAC7B,MAAMG,iBAAiBT,WAAWM,OAAkCD,cAAcF;YAClF,IAAII,OAAOJ,IAAI,CAACM,gBAAgBC,MAAM,GAAG,GAAG;gBAC1CN,MAAM,CAACC,aAAa,GAAGI;YACzB;QACF,OAAO;YACL,KAAK,MAAME,OAAOR,KAAM;gBACtB,MAAM,CAACS,UAAUC,SAAS,GAAGF,IAAIG,KAAK,CAAC;gBAEvC,IAAIZ,mBAAmBU,UAAU;oBAC/B,IAAIP,iBAAiBQ,UAAU;wBAC7BT,MAAM,CAACS,SAAS,GAAGP;oBACrB,OAAO;wBACL,MAAMS,aAAa;4BAAC;4BAAQ;4BAAO;4BAAO;4BAAO;4BAAQ;yBAAQ;wBACjEA,WAAWC,OAAO,CAAC,CAACC;4BAClB,IAAIZ,iBAAiB,GAAGQ,SAAS,CAAC,EAAEI,WAAW,EAAE;gCAC/Cb,MAAM,CAAC,GAAGS,SAAS,CAAC,EAAEI,WAAW,CAAC,GAAGX;4BACvC;wBACF;oBACF;gBACF;YACF;QACF;IACF;IAEA,OAAOF;AACT;AAEA,SAASc,WAAWjB,GAA4B;IAC9C,MAAMkB,eAAwC,CAAC;IAC/CZ,OAAOJ,IAAI,CAACF,KACTmB,IAAI,GACJJ,OAAO,CAAC,CAACL;QACR,IAAI,OAAOV,GAAG,CAACU,IAAI,KAAK,UAAU;YAChCQ,YAAY,CAACR,IAAI,GAAGO,WAAWjB,GAAG,CAACU,IAAI;QACzC,OAAO;YACLQ,YAAY,CAACR,IAAI,GAAGV,GAAG,CAACU,IAAI;QAC9B;IACF;IACF,OAAOQ;AACT;AAEA,OAAO,MAAME,2BAA2B,CAACC,kBAA4BC;IACnE,IAAIA,YAAY,UAAU;QACxB,OAAOL,WAAWlB,WAAWsB,iBAAiBE,YAAY,EAAE,IAAIzB;IAClE,OAAO;QACL,OAAOuB,iBAAiBE,YAAY;IACtC;AACF,EAAC"}
@@ -0,0 +1,29 @@
/**
* Sanitize empty strings from the query, e.g. `?preset=`
* This is how we determine whether to clear user preferences for certain params
* Once cleared, they are no longer needed in the URL
*/export const sanitizeQuery = toSanitize => {
const sanitized = {
...toSanitize
};
Object.entries(sanitized).forEach(([key, value]) => {
if (key === 'columns' && (value === '[]' || Array.isArray(sanitized[key]) && sanitized[key].length === 0)) {
delete sanitized[key];
}
if (key === 'where' && typeof value === 'object' && value !== null && !Object.keys(value).length) {
delete sanitized[key];
}
if ((key === 'limit' || key === 'page') && typeof value === 'string') {
const parsed = parseInt(value, 10);
sanitized[key] = Number.isNaN(parsed) ? undefined : parsed;
}
if (key === 'page' && value === 0) {
delete sanitized[key];
}
if (value === '') {
delete sanitized[key];
}
});
return sanitized;
};
//# sourceMappingURL=sanitizeQuery.js.map
@@ -0,0 +1 @@
{"version":3,"file":"getStringifiedToAddress.d.ts","sourceRoot":"","sources":["../../src/email/getStringifiedToAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,eAAO,MAAM,uBAAuB,YAAa,gBAAgB,KAAG,MAAM,GAAG,SAoB5E,CAAA"}
@@ -0,0 +1,33 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { FieldLabel } from '@payloadcms/ui';
import React from 'react';
import { ResetPreferences } from '../ResetPreferences/index.js';
import { ToggleTheme } from '../ToggleTheme/index.js';
import { LanguageSelector } from './LanguageSelector.js';
const baseClass = 'payload-settings';
export const Settings = props => {
const {
className,
i18n,
languageOptions,
theme,
user
} = props;
return /*#__PURE__*/_jsxs("div", {
className: [baseClass, className].filter(Boolean).join(' '),
children: [/*#__PURE__*/_jsx("h3", {
children: i18n.t('general:payloadSettings')
}), /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__language`,
children: [/*#__PURE__*/_jsx(FieldLabel, {
htmlFor: "language-select",
label: i18n.t('general:language')
}), /*#__PURE__*/_jsx(LanguageSelector, {
languageOptions: languageOptions
})]
}), theme === 'all' && /*#__PURE__*/_jsx(ToggleTheme, {}), /*#__PURE__*/_jsx(ResetPreferences, {
user: user
})]
});
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,76 @@
// https://www.stata.com/manuals/u.pdf
// https://www.stata.com/manuals/p.pdf
Prism.languages.stata = {
'comment': [
{
pattern: /(^[ \t]*)\*.*/m,
lookbehind: true,
greedy: true
},
{
pattern: /(^|\s)\/\/.*|\/\*[\s\S]*?\*\//,
lookbehind: true,
greedy: true
}
],
'string-literal': {
pattern: /"[^"\r\n]*"|[‘`']".*?"[’`']/,
greedy: true,
inside: {
'interpolation': {
pattern: /\$\{[^{}]*\}|[‘`']\w[^’`'\r\n]*[’`']/,
inside: {
'punctuation': /^\$\{|\}$/,
'expression': {
pattern: /[\s\S]+/,
inside: null // see below
}
}
},
'string': /[\s\S]+/
}
},
'mata': {
pattern: /(^[ \t]*mata[ \t]*:)[\s\S]+?(?=^end\b)/m,
lookbehind: true,
greedy: true,
alias: 'language-mata',
inside: Prism.languages.mata
},
'java': {
pattern: /(^[ \t]*java[ \t]*:)[\s\S]+?(?=^end\b)/m,
lookbehind: true,
greedy: true,
alias: 'language-java',
inside: Prism.languages.java
},
'python': {
pattern: /(^[ \t]*python[ \t]*:)[\s\S]+?(?=^end\b)/m,
lookbehind: true,
greedy: true,
alias: 'language-python',
inside: Prism.languages.python
},
'command': {
pattern: /(^[ \t]*(?:\.[ \t]+)?(?:(?:bayes|bootstrap|by|bysort|capture|collect|fmm|fp|frame|jackknife|mfp|mi|nestreg|noisily|permute|quietly|rolling|simulate|statsby|stepwise|svy|version|xi)\b[^:\r\n]*:[ \t]*|(?:capture|noisily|quietly|version)[ \t]+)?)[a-zA-Z]\w*/m,
lookbehind: true,
greedy: true,
alias: 'keyword'
},
'variable': /\$\w+|[‘`']\w[^’`'\r\n]*[’`']/,
'keyword': /\b(?:bayes|bootstrap|by|bysort|capture|clear|collect|fmm|fp|frame|if|in|jackknife|mi[ \t]+estimate|mfp|nestreg|noisily|of|permute|quietly|rolling|simulate|sort|statsby|stepwise|svy|varlist|version|xi)\b/,
'boolean': /\b(?:off|on)\b/,
'number': /\b\d+(?:\.\d+)?\b|\B\.\d+/,
'function': /\b[a-z_]\w*(?=\()/i,
'operator': /\+\+|--|##?|[<>!=~]=?|[+\-*^&|/]/,
'punctuation': /[(){}[\],:]/
};
Prism.languages.stata['string-literal'].inside.interpolation.inside.expression.inside = Prism.languages.stata;
@@ -0,0 +1 @@
{"version":3,"file":"square-arrow-down.js","sources":["../../../src/icons/square-arrow-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareArrowDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0xMiA4djgiIC8+CiAgPHBhdGggZD0ibTggMTIgNCA0IDQtNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/square-arrow-down\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 SquareArrowDown = createLucideIcon('SquareArrowDown', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M12 8v8', key: 'napkw2' }],\n ['path', { d: 'm8 12 4 4 4-4', key: 'k98ssh' }],\n]);\n\nexport default SquareArrowDown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,10 @@
export type { Logger } from './types/Logger';
export type { LoggerProvider } from './types/LoggerProvider';
export { SeverityNumber } from './types/LogRecord';
export type { LogAttributes, LogBody, LogRecord } from './types/LogRecord';
export type { LoggerOptions } from './types/LoggerOptions';
export type { AnyValue, AnyValueMap } from './types/AnyValue';
export { NOOP_LOGGER, NoopLogger } from './NoopLogger';
import { LogsAPI } from './api/logs';
export declare const logs: LogsAPI;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,7 @@
{
"name": "dom-helpers/isDocument",
"private": true,
"main": "../cjs/isDocument.js",
"module": "../esm/isDocument.js",
"types": "../esm/isDocument.d.ts"
}
@@ -0,0 +1,10 @@
import { CloneOptions, WindowOptions } from './dom/document-cloner';
import { RenderOptions } from './render/canvas/canvas-renderer';
import { ContextOptions } from './core/context';
export declare type Options = CloneOptions & WindowOptions & RenderOptions & ContextOptions & {
backgroundColor: string | null;
foreignObjectRendering: boolean;
removeContainer?: boolean;
};
declare const html2canvas: (element: HTMLElement, options?: Partial<Options>) => Promise<HTMLCanvasElement>;
export default html2canvas;
@@ -0,0 +1,22 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { PgColumn, PgColumnBuilder } from "./common.cjs";
export type PgCidrBuilderInitial<TName extends string> = PgCidrBuilder<{
name: TName;
dataType: 'string';
columnType: 'PgCidr';
data: string;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgCidrBuilder<T extends ColumnBuilderBaseConfig<'string', 'PgCidr'>> extends PgColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class PgCidr<T extends ColumnBaseConfig<'string', 'PgCidr'>> extends PgColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
}
export declare function cidr(): PgCidrBuilderInitial<''>;
export declare function cidr<TName extends string>(name: TName): PgCidrBuilderInitial<TName>;
@@ -0,0 +1,21 @@
import Agent from './agent'
import Dispatcher from './dispatcher'
export default EnvHttpProxyAgent
declare class EnvHttpProxyAgent extends Dispatcher {
constructor(opts?: EnvHttpProxyAgent.Options)
dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
}
declare namespace EnvHttpProxyAgent {
export interface Options extends Agent.Options {
/** Overrides the value of the HTTP_PROXY environment variable */
httpProxy?: string;
/** Overrides the value of the HTTPS_PROXY environment variable */
httpsProxy?: string;
/** Overrides the value of the NO_PROXY environment variable */
noProxy?: string;
}
}
@@ -0,0 +1,6 @@
export declare const subYearsWithOptions: import("./types.js").FPFn3<
Date,
import("../subYears.js").SubYearsOptions<Date> | undefined,
number,
import("../fp.js").DateArg<Date>
>;
@@ -0,0 +1,118 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "знаци", verb: "да имаат" },
file: { unit: "бајти", verb: "да имаат" },
array: { unit: "ставки", verb: "да имаат" },
set: { unit: "ставки", verb: "да имаат" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "број";
}
case "object": {
if (Array.isArray(data)) {
return "низа";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "внес",
email: "адреса на е-пошта",
url: "URL",
emoji: "емоџи",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO датум и време",
date: "ISO датум",
time: "ISO време",
duration: "ISO времетраење",
ipv4: "IPv4 адреса",
ipv6: "IPv6 адреса",
cidrv4: "IPv4 опсег",
cidrv6: "IPv6 опсег",
base64: "base64-енкодирана низа",
base64url: "base64url-енкодирана низа",
json_string: "JSON низа",
e164: "E.164 број",
jwt: "JWT",
template_literal: "внес",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Грешен внес: се очекува ${issue.expected}, примено ${parsedType(issue.input)}`;
// return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;
return `Грешана опција: се очекува една ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да има ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементи"}`;
return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да биде ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Премногу мал: се очекува ${issue.origin} да има ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Премногу мал: се очекува ${issue.origin} да биде ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Неважечка низа: мора да започнува со "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Неважечка низа: мора да завршува со "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Неважечка низа: мора да вклучува "${_issue.includes}"`;
if (_issue.format === "regex")
return `Неважечка низа: мора да одгоара на патернот ${_issue.pattern}`;
return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Грешен број: мора да биде делив со ${issue.divisor}`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Непрепознаени клучеви" : "Непрепознаен клуч"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Грешен клуч во ${issue.origin}`;
case "invalid_union":
return "Грешен внес";
case "invalid_element":
return `Грешна вредност во ${issue.origin}`;
default:
return `Грешен внес`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,35 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link endOfDay} function options.
*/
export interface EndOfDayOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name endOfDay
* @category Day Helpers
* @summary Return the end of a day for the given date.
*
* @description
* Return the end of a day for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The end of a day
*
* @example
* // The end of a day for 2 September 2014 11:55:00:
* const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 02 2014 23:59:59.999
*/
export declare function endOfDay<
DateType extends Date,
ResultDate extends Date = DateType,
>(
date: DateArg<DateType>,
options?: EndOfDayOptions<ResultDate> | undefined,
): ResultDate;
@@ -0,0 +1,62 @@
"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 migrator_exports = {};
__export(migrator_exports, {
migrate: () => migrate
});
module.exports = __toCommonJS(migrator_exports);
var import_migrator = require("../migrator.cjs");
var import_sql = require("../sql/sql.cjs");
async function migrate(db, config) {
const migrations = (0, import_migrator.readMigrationFiles)(config);
const migrationsTable = config.migrationsTable ?? "__drizzle_migrations";
const migrationsSchema = config.migrationsSchema ?? "drizzle";
const migrationTableCreate = import_sql.sql`
CREATE TABLE IF NOT EXISTS ${import_sql.sql.identifier(migrationsSchema)}.${import_sql.sql.identifier(migrationsTable)} (
id SERIAL PRIMARY KEY,
hash text NOT NULL,
created_at bigint
)
`;
await db.session.execute(import_sql.sql`CREATE SCHEMA IF NOT EXISTS ${import_sql.sql.identifier(migrationsSchema)}`);
await db.session.execute(migrationTableCreate);
const dbMigrations = await db.session.all(
import_sql.sql`select id, hash, created_at from ${import_sql.sql.identifier(migrationsSchema)}.${import_sql.sql.identifier(migrationsTable)} order by created_at desc limit 1`
);
const lastDbMigration = dbMigrations[0];
const rowsToInsert = [];
for await (const migration of migrations) {
if (!lastDbMigration || Number(lastDbMigration.created_at) < migration.folderMillis) {
for (const stmt of migration.sql) {
await db.session.execute(import_sql.sql.raw(stmt));
}
rowsToInsert.push(
import_sql.sql`insert into ${import_sql.sql.identifier(migrationsSchema)}.${import_sql.sql.identifier(migrationsTable)} ("hash", "created_at") values(${migration.hash}, ${migration.folderMillis})`
);
}
}
for await (const rowToInsert of rowsToInsert) {
await db.session.execute(rowToInsert);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
migrate
});
//# sourceMappingURL=migrator.cjs.map
@@ -0,0 +1,187 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactErrorBoundary = {}, global.React));
})(this, (function (exports, React) { 'use strict';
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
var changedArray = function changedArray(a, b) {
if (a === void 0) {
a = [];
}
if (b === void 0) {
b = [];
}
return a.length !== b.length || a.some(function (item, index) {
return !Object.is(item, b[index]);
});
};
var initialState = {
error: null
};
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(ErrorBoundary, _React$Component);
function ErrorBoundary() {
var _this;
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
_args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
_this.state = initialState;
_this.resetErrorBoundary = function () {
var _this$props;
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
_this.props.onReset == null ? void 0 : (_this$props = _this.props).onReset.apply(_this$props, args);
_this.reset();
};
return _this;
}
ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(error) {
return {
error: error
};
};
var _proto = ErrorBoundary.prototype;
_proto.reset = function reset() {
this.setState(initialState);
};
_proto.componentDidCatch = function componentDidCatch(error, info) {
var _this$props$onError, _this$props2;
(_this$props$onError = (_this$props2 = this.props).onError) == null ? void 0 : _this$props$onError.call(_this$props2, error, info);
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
var error = this.state.error;
var resetKeys = this.props.resetKeys; // There's an edge case where if the thing that triggered the error
// happens to *also* be in the resetKeys array, we'd end up resetting
// the error boundary immediately. This would likely trigger a second
// error to be thrown.
// So we make sure that we don't check the resetKeys on the first call
// of cDU after the error is set
if (error !== null && prevState.error !== null && changedArray(prevProps.resetKeys, resetKeys)) {
var _this$props$onResetKe, _this$props3;
(_this$props$onResetKe = (_this$props3 = this.props).onResetKeysChange) == null ? void 0 : _this$props$onResetKe.call(_this$props3, prevProps.resetKeys, resetKeys);
this.reset();
}
};
_proto.render = function render() {
var error = this.state.error;
var _this$props4 = this.props,
fallbackRender = _this$props4.fallbackRender,
FallbackComponent = _this$props4.FallbackComponent,
fallback = _this$props4.fallback;
if (error !== null) {
var _props = {
error: error,
resetErrorBoundary: this.resetErrorBoundary
};
if ( /*#__PURE__*/React__namespace.isValidElement(fallback)) {
return fallback;
} else if (typeof fallbackRender === 'function') {
return fallbackRender(_props);
} else if (FallbackComponent) {
return /*#__PURE__*/React__namespace.createElement(FallbackComponent, _props);
} else {
throw new Error('react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop');
}
}
return this.props.children;
};
return ErrorBoundary;
}(React__namespace.Component);
function withErrorBoundary(Component, errorBoundaryProps) {
var Wrapped = function Wrapped(props) {
return /*#__PURE__*/React__namespace.createElement(ErrorBoundary, errorBoundaryProps, /*#__PURE__*/React__namespace.createElement(Component, props));
}; // Format for display in DevTools
var name = Component.displayName || Component.name || 'Unknown';
Wrapped.displayName = "withErrorBoundary(" + name + ")";
return Wrapped;
}
function useErrorHandler(givenError) {
var _React$useState = React__namespace.useState(null),
error = _React$useState[0],
setError = _React$useState[1];
if (givenError != null) throw givenError;
if (error != null) throw error;
return setError;
}
/*
eslint
@typescript-eslint/sort-type-union-intersection-members: "off",
@typescript-eslint/no-throw-literal: "off",
@typescript-eslint/prefer-nullish-coalescing: "off"
*/
exports.ErrorBoundary = ErrorBoundary;
exports.useErrorHandler = useErrorHandler;
exports.withErrorBoundary = withErrorBoundary;
Object.defineProperty(exports, '__esModule', { value: true });
}));
//# sourceMappingURL=react-error-boundary.umd.js.map
@@ -0,0 +1,2 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).emotionHoistNonReactStatics=t()}(this,(function(){"use strict";function e(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var t=e((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,f=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,i=r?Symbol.for("react.profiler"):60114,a=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,y=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,d=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,$=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,g=r?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case u:case p:case f:case i:case c:case l:return e;default:switch(e=e&&e.$$typeof){case s:case y:case b:case d:case a:return e;default:return t}}case n:return t}}}function P(e){return v(e)===p}t.typeOf=v,t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=s,t.ContextProvider=a,t.Element=o,t.ForwardRef=y,t.Fragment=f,t.Lazy=b,t.Memo=d,t.Portal=n,t.Profiler=i,t.StrictMode=c,t.Suspense=l,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===f||e===p||e===i||e===c||e===l||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===d||e.$$typeof===a||e.$$typeof===s||e.$$typeof===y||e.$$typeof===$||e.$$typeof===S||e.$$typeof===g)},t.isAsyncMode=function(e){return P(e)||v(e)===u},t.isConcurrentMode=P,t.isContextConsumer=function(e){return v(e)===s},t.isContextProvider=function(e){return v(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return v(e)===y},t.isFragment=function(e){return v(e)===f},t.isLazy=function(e){return v(e)===b},t.isMemo=function(e){return v(e)===d},t.isPortal=function(e){return v(e)===n},t.isProfiler=function(e){return v(e)===i},t.isStrictMode=function(e){return v(e)===c},t.isSuspense=function(e){return v(e)===l}}));e((function(e,t){}));var r=e((function(e){e.exports=t})),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},f={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function i(e){return r.isMemo(e)?f:c[e.$$typeof]||o}c[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var a=Object.defineProperty,s=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,y=Object.getPrototypeOf,l=Object.prototype;var m=function e(t,r,o){if("string"!=typeof r){if(l){var f=y(r);f&&f!==l&&e(t,f,o)}var c=s(r);u&&(c=c.concat(u(r)));for(var m=i(t),d=i(r),b=0;b<c.length;++b){var $=c[b];if(!(n[$]||o&&o[$]||d&&d[$]||m&&m[$])){var S=p(r,$);try{a(t,$,S)}catch(e){}}}}return t};return function(e,t){return m(e,t)}}));
//# sourceMappingURL=emotion-react-_isolated-hnrs.umd.min.js.map
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"index.test-d.ts"
]
}
@@ -0,0 +1,247 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
Object.defineProperty(exports, 'BreakingChangeType', {
enumerable: true,
get: function () {
return _findBreakingChanges.BreakingChangeType;
},
});
Object.defineProperty(exports, 'DangerousChangeType', {
enumerable: true,
get: function () {
return _findBreakingChanges.DangerousChangeType;
},
});
Object.defineProperty(exports, 'TypeInfo', {
enumerable: true,
get: function () {
return _TypeInfo.TypeInfo;
},
});
Object.defineProperty(exports, 'assertValidName', {
enumerable: true,
get: function () {
return _assertValidName.assertValidName;
},
});
Object.defineProperty(exports, 'astFromValue', {
enumerable: true,
get: function () {
return _astFromValue.astFromValue;
},
});
Object.defineProperty(exports, 'buildASTSchema', {
enumerable: true,
get: function () {
return _buildASTSchema.buildASTSchema;
},
});
Object.defineProperty(exports, 'buildClientSchema', {
enumerable: true,
get: function () {
return _buildClientSchema.buildClientSchema;
},
});
Object.defineProperty(exports, 'buildSchema', {
enumerable: true,
get: function () {
return _buildASTSchema.buildSchema;
},
});
Object.defineProperty(exports, 'coerceInputValue', {
enumerable: true,
get: function () {
return _coerceInputValue.coerceInputValue;
},
});
Object.defineProperty(exports, 'concatAST', {
enumerable: true,
get: function () {
return _concatAST.concatAST;
},
});
Object.defineProperty(exports, 'doTypesOverlap', {
enumerable: true,
get: function () {
return _typeComparators.doTypesOverlap;
},
});
Object.defineProperty(exports, 'extendSchema', {
enumerable: true,
get: function () {
return _extendSchema.extendSchema;
},
});
Object.defineProperty(exports, 'findBreakingChanges', {
enumerable: true,
get: function () {
return _findBreakingChanges.findBreakingChanges;
},
});
Object.defineProperty(exports, 'findDangerousChanges', {
enumerable: true,
get: function () {
return _findBreakingChanges.findDangerousChanges;
},
});
Object.defineProperty(exports, 'getIntrospectionQuery', {
enumerable: true,
get: function () {
return _getIntrospectionQuery.getIntrospectionQuery;
},
});
Object.defineProperty(exports, 'getOperationAST', {
enumerable: true,
get: function () {
return _getOperationAST.getOperationAST;
},
});
Object.defineProperty(exports, 'getOperationRootType', {
enumerable: true,
get: function () {
return _getOperationRootType.getOperationRootType;
},
});
Object.defineProperty(exports, 'introspectionFromSchema', {
enumerable: true,
get: function () {
return _introspectionFromSchema.introspectionFromSchema;
},
});
Object.defineProperty(exports, 'isEqualType', {
enumerable: true,
get: function () {
return _typeComparators.isEqualType;
},
});
Object.defineProperty(exports, 'isTypeSubTypeOf', {
enumerable: true,
get: function () {
return _typeComparators.isTypeSubTypeOf;
},
});
Object.defineProperty(exports, 'isValidNameError', {
enumerable: true,
get: function () {
return _assertValidName.isValidNameError;
},
});
Object.defineProperty(exports, 'lexicographicSortSchema', {
enumerable: true,
get: function () {
return _lexicographicSortSchema.lexicographicSortSchema;
},
});
Object.defineProperty(exports, 'printIntrospectionSchema', {
enumerable: true,
get: function () {
return _printSchema.printIntrospectionSchema;
},
});
Object.defineProperty(exports, 'printSchema', {
enumerable: true,
get: function () {
return _printSchema.printSchema;
},
});
Object.defineProperty(exports, 'printType', {
enumerable: true,
get: function () {
return _printSchema.printType;
},
});
Object.defineProperty(exports, 'resolveASTSchemaCoordinate', {
enumerable: true,
get: function () {
return _resolveSchemaCoordinate.resolveASTSchemaCoordinate;
},
});
Object.defineProperty(exports, 'resolveSchemaCoordinate', {
enumerable: true,
get: function () {
return _resolveSchemaCoordinate.resolveSchemaCoordinate;
},
});
Object.defineProperty(exports, 'separateOperations', {
enumerable: true,
get: function () {
return _separateOperations.separateOperations;
},
});
Object.defineProperty(exports, 'stripIgnoredCharacters', {
enumerable: true,
get: function () {
return _stripIgnoredCharacters.stripIgnoredCharacters;
},
});
Object.defineProperty(exports, 'typeFromAST', {
enumerable: true,
get: function () {
return _typeFromAST.typeFromAST;
},
});
Object.defineProperty(exports, 'valueFromAST', {
enumerable: true,
get: function () {
return _valueFromAST.valueFromAST;
},
});
Object.defineProperty(exports, 'valueFromASTUntyped', {
enumerable: true,
get: function () {
return _valueFromASTUntyped.valueFromASTUntyped;
},
});
Object.defineProperty(exports, 'visitWithTypeInfo', {
enumerable: true,
get: function () {
return _TypeInfo.visitWithTypeInfo;
},
});
var _getIntrospectionQuery = require('./getIntrospectionQuery.js');
var _getOperationAST = require('./getOperationAST.js');
var _getOperationRootType = require('./getOperationRootType.js');
var _introspectionFromSchema = require('./introspectionFromSchema.js');
var _buildClientSchema = require('./buildClientSchema.js');
var _buildASTSchema = require('./buildASTSchema.js');
var _extendSchema = require('./extendSchema.js');
var _lexicographicSortSchema = require('./lexicographicSortSchema.js');
var _printSchema = require('./printSchema.js');
var _typeFromAST = require('./typeFromAST.js');
var _valueFromAST = require('./valueFromAST.js');
var _valueFromASTUntyped = require('./valueFromASTUntyped.js');
var _astFromValue = require('./astFromValue.js');
var _TypeInfo = require('./TypeInfo.js');
var _coerceInputValue = require('./coerceInputValue.js');
var _concatAST = require('./concatAST.js');
var _separateOperations = require('./separateOperations.js');
var _stripIgnoredCharacters = require('./stripIgnoredCharacters.js');
var _typeComparators = require('./typeComparators.js');
var _assertValidName = require('./assertValidName.js');
var _findBreakingChanges = require('./findBreakingChanges.js');
var _resolveSchemaCoordinate = require('./resolveSchemaCoordinate.js');
@@ -0,0 +1,60 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZodMiniISODuration = exports.ZodMiniISOTime = exports.ZodMiniISODate = exports.ZodMiniISODateTime = void 0;
exports.datetime = datetime;
exports.date = date;
exports.time = time;
exports.duration = duration;
const core = __importStar(require("../core/index.cjs"));
const schemas = __importStar(require("./schemas.cjs"));
exports.ZodMiniISODateTime = core.$constructor("$ZodISODateTime", (inst, def) => {
core.$ZodISODateTime.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
function datetime(params) {
return core._isoDateTime(exports.ZodMiniISODateTime, params);
}
exports.ZodMiniISODate = core.$constructor("$ZodISODate", (inst, def) => {
core.$ZodISODate.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
function date(params) {
return core._isoDate(exports.ZodMiniISODate, params);
}
exports.ZodMiniISOTime = core.$constructor("$ZodISOTime", (inst, def) => {
core.$ZodISOTime.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
function time(params) {
return core._isoTime(exports.ZodMiniISOTime, params);
}
exports.ZodMiniISODuration = core.$constructor("$ZodISODuration", (inst, def) => {
core.$ZodISODuration.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
});
function duration(params) {
return core._isoDuration(exports.ZodMiniISODuration, params);
}
@@ -0,0 +1 @@
{"version":3,"file":"scan-eye.js","sources":["../../../src/icons/scan-eye.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ScanEye\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA3VjVhMiAyIDAgMCAxIDItMmgyIiAvPgogIDxwYXRoIGQ9Ik0xNyAzaDJhMiAyIDAgMCAxIDIgMnYyIiAvPgogIDxwYXRoIGQ9Ik0yMSAxN3YyYTIgMiAwIDAgMS0yIDJoLTIiIC8+CiAgPHBhdGggZD0iTTcgMjFINWEyIDIgMCAwIDEtMi0ydi0yIiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEiIC8+CiAgPHBhdGggZD0iTTE4Ljk0NCAxMi4zM2ExIDEgMCAwIDAgMC0uNjYgNy41IDcuNSAwIDAgMC0xMy44ODggMCAxIDEgMCAwIDAgMCAuNjYgNy41IDcuNSAwIDAgMCAxMy44ODggMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/scan-eye\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 ScanEye = createLucideIcon('ScanEye', [\n ['path', { d: 'M3 7V5a2 2 0 0 1 2-2h2', key: 'aa7l1z' }],\n ['path', { d: 'M17 3h2a2 2 0 0 1 2 2v2', key: '4qcy5o' }],\n ['path', { d: 'M21 17v2a2 2 0 0 1-2 2h-2', key: '6vwrx8' }],\n ['path', { d: 'M7 21H5a2 2 0 0 1-2-2v-2', key: 'ioqczr' }],\n ['circle', { cx: '12', cy: '12', r: '1', key: '41hilf' }],\n [\n 'path',\n {\n d: 'M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0',\n key: '11ak4c',\n },\n ],\n]);\n\nexport default ScanEye;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,30 @@
type ComponentType<T> = any;
declare const hType: any;
import { FeedbackInternalOptions, FeedbackModalIntegration } from '@sentry/core';
// replaced import from preact
import * as Hooks from 'preact/hooks';
interface FactoryParams {
h: typeof hType;
hooks: typeof Hooks;
/**
* A ref to a Canvas Element that serves as our "value" or image output.
*/
outputBuffer: HTMLCanvasElement;
/**
* A reference to the whole dialog (the parent of this component) so that we
* can show/hide it and take a clean screenshot of the webpage.
*/
dialog: ReturnType<FeedbackModalIntegration['createDialog']>;
/**
* The whole options object.
*
* Needed to set nonce and id values for editor specific styles
*/
options: FeedbackInternalOptions;
}
interface Props {
onError: (error: Error) => void;
}
export declare function ScreenshotEditorFactory({ h, hooks, outputBuffer, dialog, options, }: FactoryParams): ComponentType<Props>;
export {};
//# sourceMappingURL=ScreenshotEditor.d.ts.map

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