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

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

View File

@@ -0,0 +1,17 @@
import { constructFrom } from "../../../constructFrom.mjs";
import { Parser } from "../Parser.mjs";
import { parseAnyDigitsSigned } from "../utils.mjs";
export class TimestampSecondsParser extends Parser {
priority = 40;
parse(dateString) {
return parseAnyDigitsSigned(dateString);
}
set(date, _flags, value) {
return [constructFrom(date, value * 1000), { timestampIsSet: true }];
}
incompatibleTokens = "*";
}

View File

@@ -0,0 +1,15 @@
/**
* 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.
*
*/
export interface ListPluginProps {
/**
* When `true`, enforces strict indentation rules for list items, ensuring consistent structure.
* When `false` (default), indentation is more flexible.
*/
hasStrictIndent?: boolean;
}
export declare function ListPlugin({ hasStrictIndent }: ListPluginProps): null;

View File

@@ -0,0 +1,221 @@
#!/usr/bin/env node
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __asyncValues = (this && this.__asyncValues) || function (o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const minimist_1 = __importDefault(require("minimist"));
const fs_1 = require("fs");
const tinyglobby_1 = require("tinyglobby");
const is_glob_1 = __importDefault(require("is-glob"));
const path_1 = require("path");
const index_1 = require("./index");
const utils_1 = require("./utils");
main((0, minimist_1.default)(process.argv.slice(2), {
alias: {
help: ['h'],
input: ['i'],
output: ['o'],
},
boolean: [
'additionalProperties',
'declareExternallyReferenced',
'enableConstEnums',
'format',
'ignoreMinAndMaxItems',
'strictIndexSignatures',
'unknownAny',
'unreachableDefinitions',
],
default: index_1.DEFAULT_OPTIONS,
string: ['bannerComment', 'cwd'],
}));
function main(argv) {
return __awaiter(this, void 0, void 0, function* () {
if (argv.help) {
printHelp();
process.exit(0);
}
const argIn = argv._[0] || argv.input;
const argOut = argv._[1] || argv.output; // the output can be omitted so this can be undefined
const ISGLOB = (0, is_glob_1.default)(argIn);
const ISDIR = isDir(argIn);
if ((ISGLOB || ISDIR) && argOut && argOut.includes('.d.ts')) {
throw new ReferenceError(`You have specified a single file ${argOut} output for a multi file input ${argIn}. This feature is not yet supported, refer to issue #272 (https://github.com/bcherny/json-schema-to-typescript/issues/272)`);
}
try {
// Process input as either glob, directory, or single file
if (ISGLOB) {
yield processGlob(argIn, argOut, argv);
}
else if (ISDIR) {
yield processDir(argIn, argOut, argv);
}
else {
const result = yield processFile(argIn, argv);
outputResult(result, argOut);
}
}
catch (e) {
(0, utils_1.error)(e);
process.exit(1);
}
});
}
// check if path is an existing directory
function isDir(path) {
return (0, fs_1.existsSync)(path) && (0, fs_1.lstatSync)(path).isDirectory();
}
function processGlob(argIn, argOut, argv) {
return __awaiter(this, void 0, void 0, function* () {
const files = yield (0, tinyglobby_1.glob)(argIn, { expandDirectories: false }); // execute glob pattern match
if (files.length === 0) {
throw ReferenceError(`You passed a glob pattern "${argIn}", but there are no files that match that pattern in ${process.cwd()}`);
}
// we can do this concurrently for perf
const results = yield Promise.all(files.map((file) => __awaiter(this, void 0, void 0, function* () {
return [file, yield processFile(file, argv)];
})));
// careful to do this serially
results.forEach(([file, result]) => {
const outputPath = argOut && `${argOut}/${(0, utils_1.justName)(file)}.d.ts`;
outputResult(result, outputPath);
});
});
}
function processDir(argIn, argOut, argv) {
return __awaiter(this, void 0, void 0, function* () {
const files = getPaths(argIn);
// we can do this concurrently for perf
const results = yield Promise.all(files.map((file) => __awaiter(this, void 0, void 0, function* () {
if (!argOut) {
return [file, yield processFile(file, argv)];
}
else {
const outputPath = (0, utils_1.pathTransform)(argOut, argIn, file);
return [file, yield processFile(file, argv), outputPath];
}
})));
// careful to do this serially
results.forEach(([file, result, outputPath]) => outputResult(result, outputPath ? `${outputPath}/${(0, utils_1.justName)(file)}.d.ts` : undefined));
});
}
function outputResult(result, outputPath) {
if (!outputPath) {
process.stdout.write(result);
}
else {
if (!isDir((0, path_1.dirname)(outputPath))) {
(0, fs_1.mkdirSync)((0, path_1.dirname)(outputPath), { recursive: true });
}
return (0, fs_1.writeFileSync)(outputPath, result);
}
}
function processFile(argIn, argv) {
return __awaiter(this, void 0, void 0, function* () {
const { filename, contents } = yield readInput(argIn);
const schema = (0, utils_1.parseFileAsJSONSchema)(filename, contents);
return (0, index_1.compile)(schema, argIn, argv);
});
}
function getPaths(path, paths = []) {
if ((0, fs_1.existsSync)(path) && (0, fs_1.lstatSync)(path).isDirectory()) {
(0, fs_1.readdirSync)((0, path_1.resolve)(path)).forEach(item => getPaths((0, path_1.join)(path, item), paths));
}
else {
paths.push(path);
}
return paths;
}
function readInput(argIn) {
return __awaiter(this, void 0, void 0, function* () {
if (!argIn) {
return {
filename: null,
contents: yield readStream(process.stdin),
};
}
return {
filename: argIn,
contents: (0, fs_1.readFileSync)((0, path_1.resolve)(process.cwd(), argIn), 'utf-8'),
};
});
}
function readStream(stream) {
return __awaiter(this, void 0, void 0, function* () {
var _a, stream_1, stream_1_1;
var _b, e_1, _c, _d;
const chunks = [];
try {
for (_a = true, stream_1 = __asyncValues(stream); stream_1_1 = yield stream_1.next(), _b = stream_1_1.done, !_b; _a = true) {
_d = stream_1_1.value;
_a = false;
const chunk = _d;
chunks.push(chunk);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (!_a && !_b && (_c = stream_1.return)) yield _c.call(stream_1);
}
finally { if (e_1) throw e_1.error; }
}
return Buffer.concat(chunks).toString('utf8');
});
}
function printHelp() {
const pkg = require('../../package.json');
process.stdout.write(`
${pkg.name} ${pkg.version}
Usage: json2ts [--input, -i] [IN_FILE] [--output, -o] [OUT_FILE] [OPTIONS]
With no IN_FILE, or when IN_FILE is -, read standard input.
With no OUT_FILE and when IN_FILE is specified, create .d.ts file in the same directory.
With no OUT_FILE nor IN_FILE, write to standard output.
You can use any of the following options by adding them at the end.
Boolean values can be set to false using the 'no-' prefix.
--additionalProperties
Default value for additionalProperties, when it is not explicitly set
--cwd=XXX
Root directory for resolving $ref
--declareExternallyReferenced
Declare external schemas referenced via '$ref'?
--enableConstEnums
Prepend enums with 'const'?
--inferStringEnumKeysFromValues
Create enums from JSON enums instead of union types
--format
Format code? Set this to false to improve performance.
--maxItems
Maximum number of unioned tuples to emit when representing bounded-size
array types, before falling back to emitting unbounded arrays. Increase
this to improve precision of emitted types, decrease it to improve
performance, or set it to -1 to ignore minItems and maxItems.
--style.XXX=YYY
Prettier configuration
--unknownAny
Output unknown type instead of any type
--unreachableDefinitions
Generates code for definitions that aren't referenced by the schema
`);
}
//# sourceMappingURL=cli.js.map

View File

@@ -0,0 +1,35 @@
import type { Client } from '../client';
import type { Event, EventHint } from '../types-hoist/event';
import type { Exception } from '../types-hoist/exception';
import type { ParameterizedString } from '../types-hoist/parameterize';
import type { SeverityLevel } from '../types-hoist/severity';
import type { StackFrame } from '../types-hoist/stackframe';
import type { StackParser } from '../types-hoist/stacktrace';
/**
* Extracts stack frames from the error.stack string
*/
export declare function parseStackFrames(stackParser: StackParser, error: Error): StackFrame[];
/**
* Enhances the error message with the hostname for better Sentry error reporting.
* This allows third-party packages to still match on the original error message,
* while Sentry gets the enhanced version with context.
*
* Only used internally
* @hidden
*/
export declare function _enhanceErrorWithSentryInfo<T extends Error>(error: T): string;
/**
* Extracts stack frames from the error and builds a Sentry Exception
*/
export declare function exceptionFromError(stackParser: StackParser, error: Error): Exception;
/**
* Builds and Event from a Exception
* @hidden
*/
export declare function eventFromUnknownInput(client: Client, stackParser: StackParser, exception: unknown, hint?: EventHint): Event;
/**
* Builds and Event from a Message
* @hidden
*/
export declare function eventFromMessage(stackParser: StackParser, message: ParameterizedString, level?: SeverityLevel, hint?: EventHint, attachStacktrace?: boolean): Event;
//# sourceMappingURL=eventbuilder.d.ts.map

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { subQuarters as fn } from "../subQuarters.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const subQuartersWithOptions = convertToFP(fn, 3);
// Fallback for modularized imports:
export default subQuartersWithOptions;

View File

@@ -0,0 +1,156 @@
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { DefaultCollectionFolderView, HydrateAuthProvider } from '@payloadcms/ui';
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import { getFolderResultsComponentAndData, upsertPreferences } from '@payloadcms/ui/rsc';
import { formatAdminURL } from '@payloadcms/ui/shared';
import { redirect } from 'next/navigation.js';
import React from 'react';
/**
* Builds the entire view for collection-folder views on the server
*/
export const buildCollectionFolderView = async args => {
const {
disableBulkDelete,
disableBulkEdit,
enableRowSelections,
folderID,
initPageResult,
isInDrawer,
overrideEntityVisibility,
params,
query: queryFromArgs,
searchParams
} = args;
const {
collectionConfig,
collectionConfig: {
slug: collectionSlug
},
locale: fullLocale,
permissions,
req: {
i18n,
payload,
payload: {
config
},
query: queryFromReq,
user
},
visibleEntities
} = initPageResult;
if (!config.folders) {
throw new Error('not-found');
}
if (!permissions?.collections?.[collectionSlug]?.read || !permissions?.collections?.[config.folders.slug].read) {
throw new Error('not-found');
}
if (collectionConfig) {
if (!visibleEntities.collections.includes(collectionSlug) && !overrideEntityVisibility || !config.folders) {
throw new Error('not-found');
}
const query = queryFromArgs || queryFromReq;
/**
* @todo: find a pattern to avoid setting preferences on hard navigation, i.e. direct links, page refresh, etc.
* This will ensure that prefs are only updated when explicitly set by the user
* This could potentially be done by injecting a `sessionID` into the params and comparing it against a session cookie
*/
const collectionFolderPreferences = await upsertPreferences({
key: `${collectionSlug}-collection-folder`,
req: initPageResult.req,
value: {
sort: query?.sort
}
});
const sortPreference = collectionFolderPreferences?.sort || 'name';
const viewPreference = collectionFolderPreferences?.viewPreference || 'grid';
const {
routes: {
admin: adminRoute
}
} = config;
const {
breadcrumbs,
documents,
folderAssignedCollections,
FolderResultsComponent,
subfolders
} = await getFolderResultsComponentAndData({
browseByFolder: false,
collectionsToDisplay: [config.folders.slug, collectionSlug],
displayAs: viewPreference,
folderAssignedCollections: [collectionSlug],
folderID,
req: initPageResult.req,
sort: sortPreference
});
const resolvedFolderID = breadcrumbs[breadcrumbs.length - 1]?.id;
if (!isInDrawer && (resolvedFolderID && folderID && folderID !== resolvedFolderID || folderID && !resolvedFolderID)) {
redirect(formatAdminURL({
adminRoute,
path: `/collections/${collectionSlug}/${config.folders.slug}`
}));
}
const serverProps = {
collectionConfig,
documents,
i18n,
locale: fullLocale,
params,
payload,
permissions,
searchParams,
subfolders,
user
};
// We could support slots in the folder view in the future
// const folderViewSlots = renderFolderViewSlots({
// clientProps: {
// collectionSlug,
// hasCreatePermission,
// newDocumentURL,
// },
// collectionConfig,
// description: typeof collectionConfig.admin.description === 'function'
// ? collectionConfig.admin.description({ t: i18n.t })
// : collectionConfig.admin.description,
// payload,
// serverProps,
// })
const search = query?.search;
return {
View: /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx(HydrateAuthProvider, {
permissions: permissions
}), RenderServerComponent({
clientProps: {
// ...folderViewSlots,
allCollectionFolderSlugs: [config.folders.slug, collectionSlug],
allowCreateCollectionSlugs: [permissions?.collections?.[config.folders.slug]?.create ? config.folders.slug : null, resolvedFolderID && permissions?.collections?.[collectionSlug]?.create ? collectionSlug : null].filter(Boolean),
baseFolderPath: `/collections/${collectionSlug}/${config.folders.slug}`,
breadcrumbs,
collectionSlug,
disableBulkDelete,
disableBulkEdit,
documents,
enableRowSelections,
folderAssignedCollections,
folderFieldName: config.folders.fieldName,
folderID: resolvedFolderID || null,
FolderResultsComponent,
search,
sort: sortPreference,
subfolders,
viewPreference
},
// Component: collectionConfig?.admin?.components?.views?.Folders?.Component,
Fallback: DefaultCollectionFolderView,
importMap: payload.importMap,
serverProps
})]
})
};
}
throw new Error('not-found');
};
//# sourceMappingURL=buildView.js.map

View File

@@ -0,0 +1,12 @@
/**
* 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 * as modDev from './LexicalNodeEventPlugin.dev.mjs';
import * as modProd from './LexicalNodeEventPlugin.prod.mjs';
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
export const NodeEventPlugin = mod.NodeEventPlugin;

View File

@@ -0,0 +1 @@
{"version":3,"file":"translations.cjs","names":[],"sources":["../../../../src/rest/commands/create/translations.ts"],"sourcesContent":["import type { DirectusTranslation } from '../../../schema/translation.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreateTranslationOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusTranslation<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Create multiple new translation.\n *\n * @param items The translations to create\n * @param query Optional return data query\n *\n * @returns Returns the translation object for the created translation.\n */\nexport const createTranslations =\n\t<Schema, const TQuery extends Query<Schema, DirectusTranslation<Schema>>>(\n\t\titems: NestedPartial<DirectusTranslation<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<CreateTranslationOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/translations`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'POST',\n\t});\n\n/**\n * Create a new translation.\n *\n * @param item The translation to create\n * @param query Optional return data query\n *\n * @returns Returns the translation object for the created translation.\n */\nexport const createTranslation =\n\t<Schema, const TQuery extends Query<Schema, DirectusTranslation<Schema>>>(\n\t\titem: NestedPartial<DirectusTranslation<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<CreateTranslationOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/translations`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'POST',\n\t});\n"],"mappings":"AAkBA,MAAa,GAEX,EACA,SAEM,CACN,KAAM,gBACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,OACR,EAUW,GAEX,EACA,SAEM,CACN,KAAM,gBACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}

View File

@@ -0,0 +1,287 @@
/**
* The `timer` module exposes a global API for scheduling functions to
* be called at some future period of time. Because the timer functions are
* globals, there is no need to import `node:timers` to use the API.
*
* The timer functions within Node.js implement a similar API as the timers API
* provided by Web Browsers but use a different internal implementation that is
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/timers.js)
*/
declare module "timers" {
import { Abortable } from "node:events";
import * as promises from "node:timers/promises";
export interface TimerOptions extends Abortable {
/**
* Set to `false` to indicate that the scheduled `Timeout`
* should not require the Node.js event loop to remain active.
* @default true
*/
ref?: boolean | undefined;
}
global {
namespace NodeJS {
/**
* This object is created internally and is returned from `setImmediate()`. It
* can be passed to `clearImmediate()` in order to cancel the scheduled
* actions.
*
* By default, when an immediate is scheduled, the Node.js event loop will continue
* running as long as the immediate is active. The `Immediate` object returned by
* `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`
* functions that can be used to control this default behavior.
*/
interface Immediate extends RefCounted, Disposable {
/**
* If true, the `Immediate` object will keep the Node.js event loop active.
* @since v11.0.0
*/
hasRef(): boolean;
/**
* When called, requests that the Node.js event loop _not_ exit so long as the
* `Immediate` is active. Calling `immediate.ref()` multiple times will have no
* effect.
*
* By default, all `Immediate` objects are "ref'ed", making it normally unnecessary
* to call `immediate.ref()` unless `immediate.unref()` had been called previously.
* @since v9.7.0
* @returns a reference to `immediate`
*/
ref(): this;
/**
* When called, the active `Immediate` object will not require the Node.js event
* loop to remain active. If there is no other activity keeping the event loop
* running, the process may exit before the `Immediate` object's callback is
* invoked. Calling `immediate.unref()` multiple times will have no effect.
* @since v9.7.0
* @returns a reference to `immediate`
*/
unref(): this;
/**
* Cancels the immediate. This is similar to calling `clearImmediate()`.
* @since v20.5.0, v18.18.0
* @experimental
*/
[Symbol.dispose](): void;
_onImmediate(...args: any[]): void;
}
// Legacy interface used in Node.js v9 and prior
// TODO: remove in a future major version bump
/** @deprecated Use `NodeJS.Timeout` instead. */
interface Timer extends RefCounted {
hasRef(): boolean;
refresh(): this;
[Symbol.toPrimitive](): number;
}
/**
* This object is created internally and is returned from `setTimeout()` and
* `setInterval()`. It can be passed to either `clearTimeout()` or
* `clearInterval()` in order to cancel the scheduled actions.
*
* By default, when a timer is scheduled using either `setTimeout()` or
* `setInterval()`, the Node.js event loop will continue running as long as the
* timer is active. Each of the `Timeout` objects returned by these functions
* export both `timeout.ref()` and `timeout.unref()` functions that can be used to
* control this default behavior.
*/
interface Timeout extends RefCounted, Disposable, Timer {
/**
* Cancels the timeout.
* @since v0.9.1
* @legacy Use `clearTimeout()` instead.
* @returns a reference to `timeout`
*/
close(): this;
/**
* If true, the `Timeout` object will keep the Node.js event loop active.
* @since v11.0.0
*/
hasRef(): boolean;
/**
* When called, requests that the Node.js event loop _not_ exit so long as the
* `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
*
* By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
* to call `timeout.ref()` unless `timeout.unref()` had been called previously.
* @since v0.9.1
* @returns a reference to `timeout`
*/
ref(): this;
/**
* Sets the timer's start time to the current time, and reschedules the timer to
* call its callback at the previously specified duration adjusted to the current
* time. This is useful for refreshing a timer without allocating a new
* JavaScript object.
*
* Using this on a timer that has already called its callback will reactivate the
* timer.
* @since v10.2.0
* @returns a reference to `timeout`
*/
refresh(): this;
/**
* When called, the active `Timeout` object will not require the Node.js event loop
* to remain active. If there is no other activity keeping the event loop running,
* the process may exit before the `Timeout` object's callback is invoked. Calling
* `timeout.unref()` multiple times will have no effect.
* @since v0.9.1
* @returns a reference to `timeout`
*/
unref(): this;
/**
* Coerce a `Timeout` to a primitive. The primitive can be used to
* clear the `Timeout`. The primitive can only be used in the
* same thread where the timeout was created. Therefore, to use it
* across `worker_threads` it must first be passed to the correct
* thread. This allows enhanced compatibility with browser
* `setTimeout()` and `setInterval()` implementations.
* @since v14.9.0, v12.19.0
*/
[Symbol.toPrimitive](): number;
/**
* Cancels the timeout.
* @since v20.5.0, v18.18.0
* @experimental
*/
[Symbol.dispose](): void;
_onTimeout(...args: any[]): void;
}
}
/**
* Schedules the "immediate" execution of the `callback` after I/O events'
* callbacks.
*
* When multiple calls to `setImmediate()` are made, the `callback` functions are
* queued for execution in the order in which they are created. The entire callback
* queue is processed every event loop iteration. If an immediate timer is queued
* from inside an executing callback, that timer will not be triggered until the
* next event loop iteration.
*
* If `callback` is not a function, a `TypeError` will be thrown.
*
* This method has a custom variant for promises that is available using
* `timersPromises.setImmediate()`.
* @since v0.9.1
* @param callback The function to call at the end of this turn of
* the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
* @param args Optional arguments to pass when the `callback` is called.
* @returns for use with `clearImmediate()`
*/
function setImmediate<TArgs extends any[]>(
callback: (...args: TArgs) => void,
...args: TArgs
): NodeJS.Immediate;
// Allow a single void-accepting argument to be optional in arguments lists.
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
namespace setImmediate {
import __promisify__ = promises.setImmediate;
export { __promisify__ };
}
/**
* Schedules repeated execution of `callback` every `delay` milliseconds.
*
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
* will be set to `1`. Non-integer delays are truncated to an integer.
*
* If `callback` is not a function, a `TypeError` will be thrown.
*
* This method has a custom variant for promises that is available using
* `timersPromises.setInterval()`.
* @since v0.0.1
* @param callback The function to call when the timer elapses.
* @param delay The number of milliseconds to wait before calling the
* `callback`. **Default:** `1`.
* @param args Optional arguments to pass when the `callback` is called.
* @returns for use with `clearInterval()`
*/
function setInterval<TArgs extends any[]>(
callback: (...args: TArgs) => void,
delay?: number,
...args: TArgs
): NodeJS.Timeout;
// Allow a single void-accepting argument to be optional in arguments lists.
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
/**
* Schedules execution of a one-time `callback` after `delay` milliseconds.
*
* The `callback` will likely not be invoked in precisely `delay` milliseconds.
* Node.js makes no guarantees about the exact timing of when callbacks will fire,
* nor of their ordering. The callback will be called as close as possible to the
* time specified.
*
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
* will be set to `1`. Non-integer delays are truncated to an integer.
*
* If `callback` is not a function, a `TypeError` will be thrown.
*
* This method has a custom variant for promises that is available using
* `timersPromises.setTimeout()`.
* @since v0.0.1
* @param callback The function to call when the timer elapses.
* @param delay The number of milliseconds to wait before calling the
* `callback`. **Default:** `1`.
* @param args Optional arguments to pass when the `callback` is called.
* @returns for use with `clearTimeout()`
*/
function setTimeout<TArgs extends any[]>(
callback: (...args: TArgs) => void,
delay?: number,
...args: TArgs
): NodeJS.Timeout;
// Allow a single void-accepting argument to be optional in arguments lists.
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
namespace setTimeout {
import __promisify__ = promises.setTimeout;
export { __promisify__ };
}
/**
* Cancels an `Immediate` object created by `setImmediate()`.
* @since v0.9.1
* @param immediate An `Immediate` object as returned by `setImmediate()`.
*/
function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
/**
* Cancels a `Timeout` object created by `setInterval()`.
* @since v0.0.1
* @param timeout A `Timeout` object as returned by `setInterval()`
* or the primitive of the `Timeout` object as a string or a number.
*/
function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
/**
* Cancels a `Timeout` object created by `setTimeout()`.
* @since v0.0.1
* @param timeout A `Timeout` object as returned by `setTimeout()`
* or the primitive of the `Timeout` object as a string or a number.
*/
function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
/**
* The `queueMicrotask()` method queues a microtask to invoke `callback`. If
* `callback` throws an exception, the `process` object `'uncaughtException'`
* event will be emitted.
*
* The microtask queue is managed by V8 and may be used in a similar manner to
* the `process.nextTick()` queue, which is managed by Node.js. The
* `process.nextTick()` queue is always processed before the microtask queue
* within each turn of the Node.js event loop.
* @since v11.0.0
* @param callback Function to be queued.
*/
function queueMicrotask(callback: () => void): void;
}
import clearImmediate = globalThis.clearImmediate;
import clearInterval = globalThis.clearInterval;
import clearTimeout = globalThis.clearTimeout;
import setImmediate = globalThis.setImmediate;
import setInterval = globalThis.setInterval;
import setTimeout = globalThis.setTimeout;
export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout };
}
declare module "node:timers" {
export * from "timers";
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"reportPageLoaded.js","sources":["../../../../../src/tracing/reportPageLoaded.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport { getClient } from '@sentry/core';\n\n/**\n * Manually report the end of the page load, resulting in the SDK ending the pageload span.\n * This only works if {@link BrowserTracingOptions.enableReportPageLoaded} is set to `true`.\n * Otherwise, the pageload span will end itself based on the {@link BrowserTracingOptions.finalTimeout},\n * {@link BrowserTracingOptions.idleTimeout} and {@link BrowserTracingOptions.childSpanTimeout}.\n *\n * @param client - The client to use. If not provided, the global client will be used.\n */\nexport function reportPageLoaded(client: Client | undefined = getClient()): void {\n client?.emit('endPageloadSpan');\n}\n"],"names":["getClient"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,MAAM,GAAuBA,cAAS,EAAE,EAAQ;AACjF,EAAE,MAAM,EAAE,IAAI,CAAC,iBAAiB,CAAC;AACjC;;;;"}

View File

@@ -0,0 +1,161 @@
/**
* @since v17.0.0
*/
declare module "readline/promises" {
import { Abortable } from "node:events";
import {
CompleterResult,
Direction,
Interface as _Interface,
ReadLineOptions as _ReadLineOptions,
} from "node:readline";
/**
* Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a
* single `input` `Readable` stream and a single `output` `Writable` stream.
* The `output` stream is used to print prompts for user input that arrives on,
* and is read from, the `input` stream.
* @since v17.0.0
*/
class Interface extends _Interface {
/**
* The `rl.question()` method displays the `query` by writing it to the `output`,
* waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument.
*
* When called, `rl.question()` will resume the `input` stream if it has been
* paused.
*
* If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written.
*
* If the question is called after `rl.close()`, it returns a rejected promise.
*
* Example usage:
*
* ```js
* const answer = await rl.question('What is your favorite food? ');
* console.log(`Oh, so your favorite food is ${answer}`);
* ```
*
* Using an `AbortSignal` to cancel a question.
*
* ```js
* const signal = AbortSignal.timeout(10_000);
*
* signal.addEventListener('abort', () => {
* console.log('The food question timed out');
* }, { once: true });
*
* const answer = await rl.question('What is your favorite food? ', { signal });
* console.log(`Oh, so your favorite food is ${answer}`);
* ```
* @since v17.0.0
* @param query A statement or query to write to `output`, prepended to the prompt.
* @return A promise that is fulfilled with the user's input in response to the `query`.
*/
question(query: string): Promise<string>;
question(query: string, options: Abortable): Promise<string>;
}
/**
* @since v17.0.0
*/
class Readline {
/**
* @param stream A TTY stream.
*/
constructor(
stream: NodeJS.WritableStream,
options?: {
autoCommit?: boolean | undefined;
},
);
/**
* The `rl.clearLine()` method adds to the internal list of pending action an
* action that clears current line of the associated `stream` in a specified
* direction identified by `dir`.
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
* @since v17.0.0
* @return this
*/
clearLine(dir: Direction): this;
/**
* The `rl.clearScreenDown()` method adds to the internal list of pending action an
* action that clears the associated stream from the current position of the
* cursor down.
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
* @since v17.0.0
* @return this
*/
clearScreenDown(): this;
/**
* The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions.
* @since v17.0.0
*/
commit(): Promise<void>;
/**
* The `rl.cursorTo()` method adds to the internal list of pending action an action
* that moves cursor to the specified position in the associated `stream`.
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
* @since v17.0.0
* @return this
*/
cursorTo(x: number, y?: number): this;
/**
* The `rl.moveCursor()` method adds to the internal list of pending action an
* action that moves the cursor _relative_ to its current position in the
* associated `stream`.
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
* @since v17.0.0
* @return this
*/
moveCursor(dx: number, dy: number): this;
/**
* The `rl.rollback` methods clears the internal list of pending actions without
* sending it to the associated `stream`.
* @since v17.0.0
* @return this
*/
rollback(): this;
}
type Completer = (line: string) => CompleterResult | Promise<CompleterResult>;
interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> {
/**
* An optional function used for Tab autocompletion.
*/
completer?: Completer | undefined;
}
/**
* The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
*
* ```js
* import readlinePromises from 'node:readline/promises';
* const rl = readlinePromises.createInterface({
* input: process.stdin,
* output: process.stdout,
* });
* ```
*
* Once the `readlinePromises.Interface` instance is created, the most common case
* is to listen for the `'line'` event:
*
* ```js
* rl.on('line', (line) => {
* console.log(`Received: ${line}`);
* });
* ```
*
* If `terminal` is `true` for this instance then the `output` stream will get
* the best compatibility if it defines an `output.columns` property and emits
* a `'resize'` event on the `output` if or when the columns ever change
* (`process.stdout` does this automatically when it is a TTY).
* @since v17.0.0
*/
function createInterface(
input: NodeJS.ReadableStream,
output?: NodeJS.WritableStream,
completer?: Completer,
terminal?: boolean,
): Interface;
function createInterface(options: ReadLineOptions): Interface;
}
declare module "node:readline/promises" {
export * from "readline/promises";
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","getTranslation","React","useTranslation","baseClass","FieldDescription","props","$","className","description","marginPlacement","path","i18n","t0","replace","t1","t2","filter","Boolean","t3","join","t4","_jsx","children"],"sources":["../../../src/fields/FieldDescription/index.tsx"],"sourcesContent":["'use client'\nimport type { GenericDescriptionProps } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport './index.scss'\n\nconst baseClass = 'field-description'\n\nexport const FieldDescription: React.FC<GenericDescriptionProps> = (props) => {\n const { className, description, marginPlacement, path } = props\n\n const { i18n } = useTranslation()\n\n if (description) {\n return (\n <div\n className={[\n baseClass,\n className,\n `field-description-${path?.replace(/\\./g, '__')}`,\n marginPlacement && `${baseClass}--margin-${marginPlacement}`,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {getTranslation(description, i18n)}\n </div>\n )\n }\n\n return null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAElB,SAASC,cAAc,QAAQ;AAC/B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,gBAAA,GAAsDC,KAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACjE;IAAAQ,SAAA;IAAAC,WAAA;IAAAC,eAAA;IAAAC;EAAA,IAA0DL,KAAA;EAE1D;IAAAM;EAAA,IAAiBT,cAAA;EAAA,IAEbM,WAAA;IAMI,MAAAI,EAAA,wBAAqBF,IAAA,EAAAG,OAAA,QAAqB,OAAO;IACjD,MAAAC,EAAA,GAAAL,eAAA,IAAmB,GAAAN,SAAA,YAAwBM,eAAA,EAAiB;IAAA,IAAAM,EAAA;IAAA,IAAAT,CAAA,QAAAC,SAAA,IAAAD,CAAA,QAAAM,EAAA,IAAAN,CAAA,QAAAQ,EAAA;MAJnDC,EAAA,IAAAZ,SAAA,EAETI,SAAA,EACAK,EAAiD,EACjDE,EAA4D,EAAAE,MAAA,CAAAC,OAEpD;MAAAX,CAAA,MAAAC,SAAA;MAAAD,CAAA,MAAAM,EAAA;MAAAN,CAAA,MAAAQ,EAAA;MAAAR,CAAA,MAAAS,EAAA;IAAA;MAAAA,EAAA,GAAAT,CAAA;IAAA;IANC,MAAAY,EAAA,GAAAH,EAMD,CAAAI,IAAA,CACF;IAAA,IAAAC,EAAA;IAAA,IAAAd,CAAA,QAAAE,WAAA,IAAAF,CAAA,QAAAK,IAAA,IAAAL,CAAA,QAAAY,EAAA;MARVE,EAAA,GAAAC,IAAA,CAAC;QAAAd,SAAA,EACYW,EAOH;QAAAI,QAAA,EAEPtB,cAAA,CAAeQ,WAAA,EAAaG,IAAA;MAAA,C;;;;;;;;WAV/BS,E;;;CAgBN","ignoreList":[]}

View File

@@ -0,0 +1,99 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import type { AnyPgTable } from "../table.cjs";
import { type Equal } from "../../utils.cjs";
import { PgColumn, PgColumnBuilder } from "./common.cjs";
export type PgNumericBuilderInitial<TName extends string> = PgNumericBuilder<{
name: TName;
dataType: 'string';
columnType: 'PgNumeric';
data: string;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgNumericBuilder<T extends ColumnBuilderBaseConfig<'string', 'PgNumeric'>> extends PgColumnBuilder<T, {
precision: number | undefined;
scale: number | undefined;
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], precision?: number, scale?: number);
}
export declare class PgNumeric<T extends ColumnBaseConfig<'string', 'PgNumeric'>> extends PgColumn<T> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
constructor(table: AnyPgTable<{
name: T['tableName'];
}>, config: PgNumericBuilder<T>['config']);
mapFromDriverValue(value: unknown): string;
getSQLType(): string;
}
export type PgNumericNumberBuilderInitial<TName extends string> = PgNumericNumberBuilder<{
name: TName;
dataType: 'number';
columnType: 'PgNumericNumber';
data: number;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgNumericNumberBuilder<T extends ColumnBuilderBaseConfig<'number', 'PgNumericNumber'>> extends PgColumnBuilder<T, {
precision: number | undefined;
scale: number | undefined;
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], precision?: number, scale?: number);
}
export declare class PgNumericNumber<T extends ColumnBaseConfig<'number', 'PgNumericNumber'>> extends PgColumn<T> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
constructor(table: AnyPgTable<{
name: T['tableName'];
}>, config: PgNumericNumberBuilder<T>['config']);
mapFromDriverValue(value: unknown): number;
mapToDriverValue: StringConstructor;
getSQLType(): string;
}
export type PgNumericBigIntBuilderInitial<TName extends string> = PgNumericBigIntBuilder<{
name: TName;
dataType: 'bigint';
columnType: 'PgNumericBigInt';
data: bigint;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgNumericBigIntBuilder<T extends ColumnBuilderBaseConfig<'bigint', 'PgNumericBigInt'>> extends PgColumnBuilder<T, {
precision: number | undefined;
scale: number | undefined;
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], precision?: number, scale?: number);
}
export declare class PgNumericBigInt<T extends ColumnBaseConfig<'bigint', 'PgNumericBigInt'>> extends PgColumn<T> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
constructor(table: AnyPgTable<{
name: T['tableName'];
}>, config: PgNumericBigIntBuilder<T>['config']);
mapFromDriverValue: BigIntConstructor;
mapToDriverValue: StringConstructor;
getSQLType(): string;
}
export type PgNumericConfig<T extends 'string' | 'number' | 'bigint' = 'string' | 'number' | 'bigint'> = {
precision: number;
scale?: number;
mode?: T;
} | {
precision?: number;
scale: number;
mode?: T;
} | {
precision?: number;
scale?: number;
mode: T;
};
export declare function numeric<TMode extends 'string' | 'number' | 'bigint'>(config?: PgNumericConfig<TMode>): Equal<TMode, 'number'> extends true ? PgNumericNumberBuilderInitial<''> : Equal<TMode, 'bigint'> extends true ? PgNumericBigIntBuilderInitial<''> : PgNumericBuilderInitial<''>;
export declare function numeric<TName extends string, TMode extends 'string' | 'number' | 'bigint'>(name: TName, config?: PgNumericConfig<TMode>): Equal<TMode, 'number'> extends true ? PgNumericNumberBuilderInitial<TName> : Equal<TMode, 'bigint'> extends true ? PgNumericBigIntBuilderInitial<TName> : PgNumericBuilderInitial<TName>;
export declare const decimal: typeof numeric;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/Table/DefaultCell/fields/Select/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAgB,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAIzF,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,eAAgB,SAAQ,yBAAyB,CAAC,iBAAiB,CAAC;CAAG;AAExF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwBhD,CAAA"}

View File

@@ -0,0 +1,38 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
const RGB_REGEX = /^rgb\(\s*(-?\d+|-?\d*\.\d+(?=%))(%?)\s*,\s*(-?\d+|-?\d*\.\d+(?=%))(\2)\s*,\s*(-?\d+|-?\d*\.\d+(?=%))(\2)\s*\)$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw createGraphQLError(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (!RGB_REGEX.test(value)) {
throw createGraphQLError(`Value is not a valid RGB color: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
export const GraphQLRGB = /*#__PURE__*/ new GraphQLScalarType({
name: `RGB`,
description: `A field whose value is a CSS RGB color: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba().`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== Kind.STRING) {
throw createGraphQLError(`Can only validate strings as RGB colors but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'RGB',
type: 'string',
pattern: RGB_REGEX.source,
},
},
});

View File

@@ -0,0 +1,18 @@
export const sanitizeFilterOptionsQuery = query => {
for (const key in query) {
const value = query[key];
if ((key.toLowerCase() === 'and' || key.toLowerCase() === 'or') && Array.isArray(value)) {
for (const val of value) {
sanitizeFilterOptionsQuery(val);
}
} else if (value && typeof value === 'object' && 'in' in value && Array.isArray(value.in) && value.in.length === 0) {
{
query[key] = {
exists: false
};
}
}
}
return query;
};
//# sourceMappingURL=sanitizeFilterOptionsQuery.js.map

View File

@@ -0,0 +1,83 @@
import { defineIntegration, supportsReportingObserver, GLOBAL_OBJ, getClient, withScope, captureMessage } from '@sentry/core';
const WINDOW = GLOBAL_OBJ ;
const INTEGRATION_NAME = 'ReportingObserver';
const SETUP_CLIENTS = new WeakMap();
const _reportingObserverIntegration = ((options = {}) => {
const types = options.types || ['crash', 'deprecation', 'intervention'];
/** Handler for the reporting observer. */
function handler(reports) {
if (!SETUP_CLIENTS.has(getClient() )) {
return;
}
for (const report of reports) {
withScope(scope => {
scope.setExtra('url', report.url);
const label = `ReportingObserver [${report.type}]`;
let details = 'No details available';
if (report.body) {
// Object.keys doesn't work on ReportBody, as all properties are inherited
const plainBody
= {};
// eslint-disable-next-line guard-for-in
for (const prop in report.body) {
plainBody[prop] = report.body[prop];
}
scope.setExtra('body', plainBody);
if (report.type === 'crash') {
const body = report.body ;
// A fancy way to create a message out of crashId OR reason OR both OR fallback
details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;
} else {
const body = report.body ;
details = body.message || details;
}
}
captureMessage(`${label}: ${details}`);
});
}
}
return {
name: INTEGRATION_NAME,
setupOnce() {
if (!supportsReportingObserver()) {
return;
}
const observer = new (WINDOW ).ReportingObserver(
handler,
{
buffered: true,
types,
},
);
observer.observe();
},
setup(client) {
SETUP_CLIENTS.set(client, true);
},
};
}) ;
/**
* Reporting API integration - https://w3c.github.io/reporting/
*/
const reportingObserverIntegration = defineIntegration(_reportingObserverIntegration);
export { reportingObserverIntegration };
//# sourceMappingURL=reportingobserver.js.map

View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE, do MMMM y",
long: "do MMMM y",
medium: "do MMM y",
short: "dd.MM.y",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

View File

@@ -0,0 +1,37 @@
/**
* This is a copy of the Vercel AI integration from the node SDK.
*
* The only difference is that it does not use `@opentelemetry/instrumentation`
* because Cloudflare Workers do not support it.
*
* Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`
* and users have to manually set this to get spans.
*/
/**
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
* This integration is not enabled by default, you need to manually add it.
*
* For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
*
* You need to enable collecting spans for a specific call by setting
* `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.
*
* ```javascript
* const result = await generateText({
* model: openai('gpt-4-turbo'),
* experimental_telemetry: { isEnabled: true },
* });
* ```
*
* If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each
* function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`
* to `true`.
*
* ```javascript
* const result = await generateText({
* model: openai('gpt-4-turbo'),
* experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },
* });
*/
export declare const vercelAIIntegration: () => import("@sentry/core").Integration;
//# sourceMappingURL=vercelai.d.ts.map

View File

@@ -0,0 +1,3 @@
import type { PreferenceUpdateRequest } from '../types.js';
export declare function update(args: PreferenceUpdateRequest): Promise<any>;
//# sourceMappingURL=update.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dynamicRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicRef.ts"],"names":[],"mappings":";;;AAEA,mDAAgE;AAChE,+CAAmC;AACnC,qCAAmC;AAEnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,SAAgB,UAAU,CAAC,GAAe,EAAE,GAAW;IACrD,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC9B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,yCAAyC,CAAC,CAAA;IACzF,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3B,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;QACjB,WAAW,EAAE,CAAA;IACf,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACrC,WAAW,CAAC,KAAK,CAAC,CAAA;QAClB,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;IAED,SAAS,WAAW,CAAC,KAAY;QAC/B,+EAA+E;QAC/E,4EAA4E;QAC5E,sFAAsF;QACtF,qDAAqD;QACrD,kGAAkG;QAClG,yDAAyD;QACzD,IAAI,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7C,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,cAAc,GAAG,IAAA,qBAAW,EAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YACrE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAA;QACjE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAA;QACpC,CAAC;IACH,CAAC;IAED,SAAS,QAAQ,CAAC,QAAc,EAAE,KAAY;QAC5C,OAAO,KAAK;YACV,CAAC,CAAC,GAAG,EAAE,CACH,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;gBACb,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;gBACtB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACtB,CAAC,CAAC;YACN,CAAC,CAAC,GAAG,EAAE,CAAC,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAClC,CAAC;AACH,CAAC;AApCD,gCAoCC;AAED,kBAAe,GAAG,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_index","require","_removeTypeDuplicates","_index2","createTSUnionType","typeAnnotations","types","map","type","isTSTypeAnnotation","typeAnnotation","flattened","removeTypeDuplicates","length","tsUnionType"],"sources":["../../../src/builders/typescript/createTSUnionType.ts"],"sourcesContent":["import { tsUnionType } from \"../generated/index.ts\";\nimport removeTypeDuplicates from \"../../modifications/typescript/removeTypeDuplicates.ts\";\nimport { isTSTypeAnnotation } from \"../../validators/generated/index.ts\";\nimport type * as t from \"../../index.ts\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containing them.\n */\nexport default function createTSUnionType(\n typeAnnotations: (t.TSTypeAnnotation | t.TSType)[],\n): t.TSType {\n const types = typeAnnotations.map(type => {\n return isTSTypeAnnotation(type) ? type.typeAnnotation : type;\n });\n const flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0];\n } else {\n return tsUnionType(flattened);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAOe,SAASG,iBAAiBA,CACvCC,eAAkD,EACxC;EACV,MAAMC,KAAK,GAAGD,eAAe,CAACE,GAAG,CAACC,IAAI,IAAI;IACxC,OAAO,IAAAC,0BAAkB,EAACD,IAAI,CAAC,GAAGA,IAAI,CAACE,cAAc,GAAGF,IAAI;EAC9D,CAAC,CAAC;EACF,MAAMG,SAAS,GAAG,IAAAC,6BAAoB,EAACN,KAAK,CAAC;EAE7C,IAAIK,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAOF,SAAS,CAAC,CAAC,CAAC;EACrB,CAAC,MAAM;IACL,OAAO,IAAAG,kBAAW,EAACH,SAAS,CAAC;EAC/B;AACF","ignoreList":[]}

View File

@@ -0,0 +1,36 @@
import { DirectusPreset } from "../../../schema/preset.js";
import { NestedPartial } from "../../../types/utils.js";
import { ApplyQueryFields } from "../../../types/output.js";
import { Query } from "../../../types/query.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/update/presets.d.ts
type UpdatePresetOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusPreset<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* Update multiple existing presets.
* @param keys
* @param item
* @param query
* @returns Returns the preset objects for the updated presets.
* @throws Will throw if keys is empty
*/
declare const updatePresets: <Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(keys: DirectusPreset<Schema>["id"][], item: NestedPartial<DirectusPreset<Schema>>, query?: TQuery) => RestCommand<UpdatePresetOutput<Schema, TQuery>[], Schema>;
/**
* Update multiple presets as batch.
* @param items
* @param query
* @returns Returns the preset objects for the updated presets.
*/
declare const updatePresetsBatch: <Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(items: NestedPartial<DirectusPreset<Schema>>[], query?: TQuery) => RestCommand<UpdatePresetOutput<Schema, TQuery>[], Schema>;
/**
* Update an existing preset.
* @param key
* @param item
* @param query
* @returns Returns the preset object for the updated preset.
* @throws Will throw if key is empty
*/
declare const updatePreset: <Schema, const TQuery extends Query<Schema, DirectusPreset<Schema>>>(key: DirectusPreset<Schema>["id"], item: NestedPartial<DirectusPreset<Schema>>, query?: TQuery) => RestCommand<UpdatePresetOutput<Schema, TQuery>, Schema>;
//#endregion
export { UpdatePresetOutput, updatePreset, updatePresets, updatePresetsBatch };
//# sourceMappingURL=presets.d.ts.map

View File

@@ -0,0 +1,73 @@
'use strict'
module.exports = prettifyErrorLog
const {
LOGGER_KEYS
} = require('../constants')
const isObject = require('./is-object')
const joinLinesWithIndentation = require('./join-lines-with-indentation')
const prettifyObject = require('./prettify-object')
/**
* @typedef {object} PrettifyErrorLogParams
* @property {object} log The error log to prettify.
* @property {PrettyContext} context The context object built from parsing
* the options.
*/
/**
* Given a log object that has a `type: 'Error'` key, prettify the object and
* return the result. In other
*
* @param {PrettifyErrorLogParams} input
*
* @returns {string} A string that represents the prettified error log.
*/
function prettifyErrorLog ({ log, context }) {
const {
EOL: eol,
IDENT: ident,
errorProps: errorProperties,
messageKey
} = context
const stack = log.stack
const joinedLines = joinLinesWithIndentation({ input: stack, ident, eol })
let result = `${ident}${joinedLines}${eol}`
if (errorProperties.length > 0) {
const excludeProperties = LOGGER_KEYS.concat(messageKey, 'type', 'stack')
let propertiesToPrint
if (errorProperties[0] === '*') {
// Print all sibling properties except for the standard exclusions.
propertiesToPrint = Object.keys(log).filter(k => excludeProperties.includes(k) === false)
} else {
// Print only specified properties unless the property is a standard exclusion.
propertiesToPrint = errorProperties.filter(k => excludeProperties.includes(k) === false)
}
for (let i = 0; i < propertiesToPrint.length; i += 1) {
const key = propertiesToPrint[i]
if (key in log === false) continue
if (isObject(log[key])) {
// The nested object may have "logger" type keys but since they are not
// at the root level of the object being processed, we want to print them.
// Thus, we invoke with `excludeLoggerKeys: false`.
const prettifiedObject = prettifyObject({
log: log[key],
excludeLoggerKeys: false,
context: {
...context,
IDENT: ident + ident
}
})
result = `${result}${ident}${key}: {${eol}${prettifiedObject}${ident}}${eol}`
continue
}
result = `${result}${ident}${key}: ${log[key]}${eol}`
}
}
return result
}

View File

@@ -0,0 +1,16 @@
import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {checkStrictMode} from "../../compile/util"
const def: CodeKeywordDefinition = {
keyword: ["maxContains", "minContains"],
type: "array",
schemaType: "number",
code({keyword, parentSchema, it}: KeywordCxt) {
if (parentSchema.contains === undefined) {
checkStrictMode(it, `"${keyword}" without "contains" is ignored`)
}
},
}
export default def

View File

@@ -0,0 +1 @@
{"version":3,"file":"provider.js","names":["React","createContext","use","GroupContext","GroupProvider","children","withinGroup","_jsx","value","useGroup"],"sources":["../../../src/fields/Group/provider.tsx"],"sourcesContent":["'use client'\nimport React, { createContext, use } from 'react'\n\nexport const GroupContext = createContext(false)\n\nexport const GroupProvider: React.FC<{ children?: React.ReactNode; withinGroup?: boolean }> = ({\n children,\n withinGroup = true,\n}) => {\n return <GroupContext value={withinGroup}>{children}</GroupContext>\n}\n\nexport const useGroup = (): boolean => use(GroupContext)\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,IAASC,aAAa,EAAEC,GAAG,QAAQ;AAE1C,OAAO,MAAMC,YAAA,gBAAeF,aAAA,CAAc;AAE1C,OAAO,MAAMG,aAAA,GAAiFA,CAAC;EAC7FC,QAAQ;EACRC,WAAA,GAAc;AAAI,CACnB;EACC,oBAAOC,IAAA,CAACJ,YAAA;IAAaK,KAAA,EAAOF,WAAA;cAAcD;;AAC5C;AAEA,OAAO,MAAMI,QAAA,GAAWA,CAAA,KAAeP,GAAA,CAAIC,YAAA","ignoreList":[]}

View File

@@ -0,0 +1,300 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
*/
"use strict";
const { OriginalSource, RawSource } = require("webpack-sources");
const AsyncDependenciesBlock = require("../AsyncDependenciesBlock");
const Module = require("../Module");
const {
JAVASCRIPT_TYPE,
JAVASCRIPT_TYPES
} = require("../ModuleSourceTypeConstants");
const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = require("../ModuleTypeConstants");
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
const StaticExportsDependency = require("../dependencies/StaticExportsDependency");
const makeSerializable = require("../util/makeSerializable");
const ContainerExposedDependency = require("./ContainerExposedDependency");
/** @typedef {import("../config/defaults").WebpackOptionsNormalizedWithDefaults} WebpackOptions */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../Module").BuildCallback} BuildCallback */
/** @typedef {import("../Module").CodeGenerationContext} CodeGenerationContext */
/** @typedef {import("../Module").CodeGenerationResult} CodeGenerationResult */
/** @typedef {import("../Module").LibIdentOptions} LibIdentOptions */
/** @typedef {import("../Module").LibIdent} LibIdent */
/** @typedef {import("../Module").NeedBuildCallback} NeedBuildCallback */
/** @typedef {import("../Module").NeedBuildContext} NeedBuildContext */
/** @typedef {import("../Module").Sources} Sources */
/** @typedef {import("../Module").SourceTypes} SourceTypes */
/** @typedef {import("../RequestShortener")} RequestShortener */
/** @typedef {import("../ResolverFactory").ResolverWithOptions} ResolverWithOptions */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */
/**
* @typedef {object} ExposeOptions
* @property {string[]} import requests to exposed modules (last one is exported)
* @property {string} name custom chunk name for the exposed module
*/
/** @typedef {[string, ExposeOptions][]} ExposesList */
class ContainerEntryModule extends Module {
/**
* @param {string} name container entry name
* @param {ExposesList} exposes list of exposed modules
* @param {string} shareScope name of the share scope
*/
constructor(name, exposes, shareScope) {
super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null);
this._name = name;
this._exposes = exposes;
this._shareScope = shareScope;
}
/**
* @returns {SourceTypes} types available (do not mutate)
*/
getSourceTypes() {
return JAVASCRIPT_TYPES;
}
/**
* @returns {string} a unique identifier of the module
*/
identifier() {
return `container entry (${this._shareScope}) ${JSON.stringify(
this._exposes
)}`;
}
/**
* @param {RequestShortener} requestShortener the request shortener
* @returns {string} a user readable identifier of the module
*/
readableIdentifier(requestShortener) {
return "container entry";
}
/**
* @param {LibIdentOptions} options options
* @returns {LibIdent | null} an identifier for library inclusion
*/
libIdent(options) {
return `${this.layer ? `(${this.layer})/` : ""}webpack/container/entry/${
this._name
}`;
}
/**
* @param {NeedBuildContext} context context info
* @param {NeedBuildCallback} callback callback function, returns true, if the module needs a rebuild
* @returns {void}
*/
needBuild(context, callback) {
return callback(null, !this.buildMeta);
}
/**
* @param {WebpackOptions} options webpack options
* @param {Compilation} compilation the compilation
* @param {ResolverWithOptions} resolver the resolver
* @param {InputFileSystem} fs the file system
* @param {BuildCallback} callback callback function
* @returns {void}
*/
build(options, compilation, resolver, fs, callback) {
this.buildMeta = {};
this.buildInfo = {
strict: true,
topLevelDeclarations: new Set(["moduleMap", "get", "init"])
};
this.buildMeta.exportsType = "namespace";
this.clearDependenciesAndBlocks();
for (const [name, options] of this._exposes) {
const block = new AsyncDependenciesBlock(
{
name: options.name
},
{ name },
options.import[options.import.length - 1]
);
let idx = 0;
for (const request of options.import) {
const dep = new ContainerExposedDependency(name, request);
dep.loc = {
name,
index: idx++
};
block.addDependency(dep);
}
this.addBlock(block);
}
this.addDependency(new StaticExportsDependency(["get", "init"], false));
callback();
}
/**
* @param {CodeGenerationContext} context context for code generation
* @returns {CodeGenerationResult} result
*/
codeGeneration({ moduleGraph, chunkGraph, runtimeTemplate }) {
/** @type {Sources} */
const sources = new Map();
const runtimeRequirements = new Set([
RuntimeGlobals.definePropertyGetters,
RuntimeGlobals.hasOwnProperty,
RuntimeGlobals.exports
]);
/** @type {string[]} */
const getters = [];
for (const block of this.blocks) {
const { dependencies } = block;
const modules = dependencies.map((dependency) => {
const dep = /** @type {ContainerExposedDependency} */ (dependency);
return {
name: dep.exposedName,
module: moduleGraph.getModule(dep),
request: dep.userRequest
};
});
/** @type {string} */
let str;
if (modules.some((m) => !m.module)) {
str = runtimeTemplate.throwMissingModuleErrorBlock({
request: modules.map((m) => m.request).join(", ")
});
} else {
str = `return ${runtimeTemplate.blockPromise({
block,
message: "",
chunkGraph,
runtimeRequirements
})}.then(${runtimeTemplate.returningFunction(
runtimeTemplate.returningFunction(
`(${modules
.map(({ module, request }) =>
runtimeTemplate.moduleRaw({
module,
chunkGraph,
request,
weak: false,
runtimeRequirements
})
)
.join(", ")})`
)
)});`;
}
getters.push(
`${JSON.stringify(modules[0].name)}: ${runtimeTemplate.basicFunction(
"",
str
)}`
);
}
const source = Template.asString([
"var moduleMap = {",
Template.indent(getters.join(",\n")),
"};",
`var get = ${runtimeTemplate.basicFunction("module, getScope", [
`${RuntimeGlobals.currentRemoteGetScope} = getScope;`,
// reusing the getScope variable to avoid creating a new var (and module is also used later)
"getScope = (",
Template.indent([
`${RuntimeGlobals.hasOwnProperty}(moduleMap, module)`,
Template.indent([
"? moduleMap[module]()",
`: Promise.resolve().then(${runtimeTemplate.basicFunction(
"",
"throw new Error('Module \"' + module + '\" does not exist in container.');"
)})`
])
]),
");",
`${RuntimeGlobals.currentRemoteGetScope} = undefined;`,
"return getScope;"
])};`,
`var init = ${runtimeTemplate.basicFunction("shareScope, initScope", [
`if (!${RuntimeGlobals.shareScopeMap}) return;`,
`var name = ${JSON.stringify(this._shareScope)}`,
`var oldScope = ${RuntimeGlobals.shareScopeMap}[name];`,
'if(oldScope && oldScope !== shareScope) throw new Error("Container initialization failed as it has already been initialized with a different share scope");',
`${RuntimeGlobals.shareScopeMap}[name] = shareScope;`,
`return ${RuntimeGlobals.initializeSharing}(name, initScope);`
])};`,
"",
"// This exports getters to disallow modifications",
`${RuntimeGlobals.definePropertyGetters}(exports, {`,
Template.indent([
`get: ${runtimeTemplate.returningFunction("get")},`,
`init: ${runtimeTemplate.returningFunction("init")}`
]),
"});"
]);
sources.set(
JAVASCRIPT_TYPE,
this.useSourceMap || this.useSimpleSourceMap
? new OriginalSource(source, "webpack/container-entry")
: new RawSource(source)
);
return {
sources,
runtimeRequirements
};
}
/**
* @param {string=} type the source type for which the size should be estimated
* @returns {number} the estimated size of the module (must be non-zero)
*/
size(type) {
return 42;
}
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
const { write } = context;
write(this._name);
write(this._exposes);
write(this._shareScope);
super.serialize(context);
}
/**
* @param {ObjectDeserializerContext} context context
* @returns {ContainerEntryModule} deserialized container entry module
*/
static deserialize(context) {
const { read } = context;
const obj = new ContainerEntryModule(read(), read(), read());
obj.deserialize(context);
return obj;
}
}
makeSerializable(
ContainerEntryModule,
"webpack/lib/container/ContainerEntryModule"
);
module.exports = ContainerEntryModule;

View File

@@ -0,0 +1,5 @@
export declare const differenceInCalendarISOWeeks: import("./types.js").FPFn2<
number,
string | number | Date,
string | number | Date
>;

View File

@@ -0,0 +1,16 @@
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import './index.scss';
export const PlusIcon = () => /*#__PURE__*/_jsx("svg", {
className: "icon icon--plus",
height: "20",
viewBox: "0 0 20 20",
width: "20",
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/_jsx("path", {
className: "stroke",
d: "M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",
strokeLinecap: "square"
})
});
//# sourceMappingURL=index.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"names":["_addComments","require","addComment","node","type","content","line","addComments","value"],"sources":["../../src/comments/addComment.ts"],"sourcesContent":["import addComments from \"./addComments.ts\";\nimport type * as t from \"../index.ts\";\n\n/**\n * Add comment of certain type to a node.\n */\nexport default function addComment<T extends t.Node>(\n node: T,\n type: t.CommentTypeShorthand,\n content: string,\n line?: boolean,\n): T {\n return addComments(node, type, [\n {\n type: line ? \"CommentLine\" : \"CommentBlock\",\n value: content,\n } as t.Comment,\n ]);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMe,SAASC,UAAUA,CAChCC,IAAO,EACPC,IAA4B,EAC5BC,OAAe,EACfC,IAAc,EACX;EACH,OAAO,IAAAC,oBAAW,EAACJ,IAAI,EAAEC,IAAI,EAAE,CAC7B;IACEA,IAAI,EAAEE,IAAI,GAAG,aAAa,GAAG,cAAc;IAC3CE,KAAK,EAAEH;EACT,CAAC,CACF,CAAC;AACJ","ignoreList":[]}

View File

@@ -0,0 +1,27 @@
import { monthsInQuarter } from "./constants.mjs";
/**
* @name quartersToMonths
* @category Conversion Helpers
* @summary Convert number of quarters to months.
*
* @description
* Convert a number of quarters to a full number of months.
*
* @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 quarters - The number of quarters to be converted
*
* @returns The number of quarters converted in months
*
* @example
* // Convert 2 quarters to months
* const result = quartersToMonths(2)
* //=> 6
*/
export function quartersToMonths(quarters) {
return Math.trunc(quarters * monthsInQuarter);
}
// Fallback for modularized imports:
export default quartersToMonths;

View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const equal_1 = require("../../runtime/equal");
const error = {
message: "must be equal to one of the allowed values",
params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,
};
const def = {
keyword: "enum",
schemaType: "array",
$data: true,
error,
code(cxt) {
const { gen, data, $data, schema, schemaCode, it } = cxt;
if (!$data && schema.length === 0)
throw new Error("enum must have non-empty array");
const useLoop = schema.length >= it.opts.loopEnum;
let eql;
const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));
let valid;
if (useLoop || $data) {
valid = gen.let("valid");
cxt.block$data(valid, loopEnum);
}
else {
/* istanbul ignore if */
if (!Array.isArray(schema))
throw new Error("ajv implementation error");
const vSchema = gen.const("vSchema", schemaCode);
valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));
}
cxt.pass(valid);
function loopEnum() {
gen.assign(valid, false);
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
}
function equalCode(vSchema, i) {
const sch = schema[i];
return typeof sch === "object" && sch !== null
? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`
: (0, codegen_1._) `${data} === ${sch}`;
}
},
};
exports.default = def;
//# sourceMappingURL=enum.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"tickets-plane.js","sources":["../../../src/icons/tickets-plane.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TicketsPlane\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAuNSAxN2gxLjIyN2EyIDIgMCAwIDAgMS4zNDUtLjUyTDE4IDEyIiAvPgogIDxwYXRoIGQ9Im0xMiAxMy41IDMuNzUuNSIgLz4KICA8cGF0aCBkPSJtNC41IDggMTAuNTgtNS4wNmExIDEgMCAwIDEgMS4zNDIuNDg4TDE4LjUgOCIgLz4KICA8cGF0aCBkPSJNNiAxMFY4IiAvPgogIDxwYXRoIGQ9Ik02IDE0djEiIC8+CiAgPHBhdGggZD0iTTYgMTl2MiIgLz4KICA8cmVjdCB4PSIyIiB5PSI4IiB3aWR0aD0iMjAiIGhlaWdodD0iMTMiIHJ4PSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/tickets-plane\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 TicketsPlane = createLucideIcon('TicketsPlane', [\n ['path', { d: 'M10.5 17h1.227a2 2 0 0 0 1.345-.52L18 12', key: '16muxl' }],\n ['path', { d: 'm12 13.5 3.75.5', key: '1i9qhk' }],\n ['path', { d: 'm4.5 8 10.58-5.06a1 1 0 0 1 1.342.488L18.5 8', key: '12lg5p' }],\n ['path', { d: 'M6 10V8', key: '1y41hn' }],\n ['path', { d: 'M6 14v1', key: 'cao2tf' }],\n ['path', { d: 'M6 19v2', key: '1loha6' }],\n ['rect', { x: '2', y: '8', width: '20', height: '13', rx: '2', key: 'p3bz5l' }],\n]);\n\nexport default TicketsPlane;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7E,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,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,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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,QAAQ,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,12 @@
import type { ASTVisitor } from '../../language/visitor';
import type { ValidationContext } from '../ValidationContext';
/**
* Variables in allowed position
*
* Variable usages must be compatible with the arguments they are passed to.
*
* See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed
*/
export declare function VariablesInAllowedPositionRule(
context: ValidationContext,
): ASTVisitor;

View File

@@ -0,0 +1,312 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _async = require("../gensync-utils/async.js");
var _util = require("./util.js");
var context = require("../index.js");
var _plugin = require("./plugin.js");
var _item = require("./item.js");
var _configChain = require("./config-chain.js");
var _deepArray = require("./helpers/deep-array.js");
function _traverse() {
const data = require("@babel/traverse");
_traverse = function () {
return data;
};
return data;
}
var _caching = require("./caching.js");
var _options = require("./validation/options.js");
var _plugins = require("./validation/plugins.js");
var _configApi = require("./helpers/config-api.js");
var _partial = require("./partial.js");
var _configError = require("../errors/config-error.js");
var _default = exports.default = _gensync()(function* loadFullConfig(inputOpts) {
var _opts$assumptions;
const result = yield* (0, _partial.default)(inputOpts);
if (!result) {
return null;
}
const {
options,
context,
fileHandling
} = result;
if (fileHandling === "ignored") {
return null;
}
const optionDefaults = {};
const {
plugins,
presets
} = options;
if (!plugins || !presets) {
throw new Error("Assertion failure - plugins and presets exist");
}
const presetContext = Object.assign({}, context, {
targets: options.targets
});
const toDescriptor = item => {
const desc = (0, _item.getItemDescriptor)(item);
if (!desc) {
throw new Error("Assertion failure - must be config item");
}
return desc;
};
const presetsDescriptors = presets.map(toDescriptor);
const initialPluginsDescriptors = plugins.map(toDescriptor);
const pluginDescriptorsByPass = [[]];
const passes = [];
const externalDependencies = [];
const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) {
const presets = [];
for (let i = 0; i < rawPresets.length; i++) {
const descriptor = rawPresets[i];
if (descriptor.options !== false) {
try {
var preset = yield* loadPresetDescriptor(descriptor, presetContext);
} catch (e) {
if (e.code === "BABEL_UNKNOWN_OPTION") {
(0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e);
}
throw e;
}
externalDependencies.push(preset.externalDependencies);
if (descriptor.ownPass) {
presets.push({
preset: preset.chain,
pass: []
});
} else {
presets.unshift({
preset: preset.chain,
pass: pluginDescriptorsPass
});
}
}
}
if (presets.length > 0) {
pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass));
for (const {
preset,
pass
} of presets) {
if (!preset) return true;
pass.push(...preset.plugins);
const ignored = yield* recursePresetDescriptors(preset.presets, pass);
if (ignored) return true;
preset.options.forEach(opts => {
(0, _util.mergeOptions)(optionDefaults, opts);
});
}
}
})(presetsDescriptors, pluginDescriptorsByPass[0]);
if (ignored) return null;
const opts = optionDefaults;
(0, _util.mergeOptions)(opts, options);
const pluginContext = Object.assign({}, presetContext, {
assumptions: (_opts$assumptions = opts.assumptions) != null ? _opts$assumptions : {}
});
yield* enhanceError(context, function* loadPluginDescriptors() {
pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors);
for (const descs of pluginDescriptorsByPass) {
const pass = [];
passes.push(pass);
for (let i = 0; i < descs.length; i++) {
const descriptor = descs[i];
if (descriptor.options !== false) {
try {
var plugin = yield* loadPluginDescriptor(descriptor, pluginContext);
} catch (e) {
if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") {
(0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e);
}
throw e;
}
pass.push(plugin);
externalDependencies.push(plugin.externalDependencies);
}
}
}
})();
opts.plugins = passes[0];
opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({
plugins
}));
opts.passPerPreset = opts.presets.length > 0;
return {
options: opts,
passes: passes,
externalDependencies: (0, _deepArray.finalize)(externalDependencies)
};
});
function enhanceError(context, fn) {
return function* (arg1, arg2) {
try {
return yield* fn(arg1, arg2);
} catch (e) {
if (!e.message.startsWith("[BABEL]")) {
var _context$filename;
e.message = `[BABEL] ${(_context$filename = context.filename) != null ? _context$filename : "unknown file"}: ${e.message}`;
}
throw e;
}
};
}
const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function* ({
value,
options,
dirname,
alias
}, cache) {
if (options === false) throw new Error("Assertion failure");
options = options || {};
const externalDependencies = [];
let item = value;
if (typeof value === "function") {
const factory = (0, _async.maybeAsync)(value, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
const api = Object.assign({}, context, apiFactory(cache, externalDependencies));
try {
item = yield* factory(api, options, dirname);
} catch (e) {
if (alias) {
e.message += ` (While processing: ${JSON.stringify(alias)})`;
}
throw e;
}
}
if (!item || typeof item !== "object") {
throw new Error("Plugin/Preset did not return an object.");
}
if ((0, _async.isThenable)(item)) {
yield* [];
throw new Error(`You appear to be using a promise as a plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version. ` + `As an alternative, you can prefix the promise with "await". ` + `(While processing: ${JSON.stringify(alias)})`);
}
if (externalDependencies.length > 0 && (!cache.configured() || cache.mode() === "forever")) {
let error = `A plugin/preset has external untracked dependencies ` + `(${externalDependencies[0]}), but the cache `;
if (!cache.configured()) {
error += `has not been configured to be invalidated when the external dependencies change. `;
} else {
error += ` has been configured to never be invalidated. `;
}
error += `Plugins/presets should configure their cache to be invalidated when the external ` + `dependencies change, for example using \`api.cache.invalidate(() => ` + `statSync(filepath).mtimeMs)\` or \`api.cache.never()\`\n` + `(While processing: ${JSON.stringify(alias)})`;
throw new Error(error);
}
return {
value: item,
options,
dirname,
alias,
externalDependencies: (0, _deepArray.finalize)(externalDependencies)
};
});
const pluginDescriptorLoader = makeDescriptorLoader(_configApi.makePluginAPI);
const presetDescriptorLoader = makeDescriptorLoader(_configApi.makePresetAPI);
const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({
value,
options,
dirname,
alias,
externalDependencies
}, cache) {
const pluginObj = (0, _plugins.validatePluginObject)(value);
const plugin = Object.assign({}, pluginObj);
if (plugin.visitor) {
plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor));
}
if (plugin.inherits) {
const inheritsDescriptor = {
name: undefined,
alias: `${alias}$inherits`,
value: plugin.inherits,
options,
dirname
};
const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, run => {
return cache.invalidate(data => run(inheritsDescriptor, data));
});
plugin.pre = chainMaybeAsync(inherits.pre, plugin.pre);
plugin.post = chainMaybeAsync(inherits.post, plugin.post);
plugin.manipulateOptions = chainMaybeAsync(inherits.manipulateOptions, plugin.manipulateOptions);
plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]);
if (inherits.externalDependencies.length > 0) {
if (externalDependencies.length === 0) {
externalDependencies = inherits.externalDependencies;
} else {
externalDependencies = (0, _deepArray.finalize)([externalDependencies, inherits.externalDependencies]);
}
}
}
return new _plugin.default(plugin, options, alias, externalDependencies);
});
function* loadPluginDescriptor(descriptor, context) {
if (descriptor.value instanceof _plugin.default) {
if (descriptor.options) {
throw new Error("Passed options to an existing Plugin instance will not work.");
}
return descriptor.value;
}
return yield* instantiatePlugin(yield* pluginDescriptorLoader(descriptor, context), context);
}
const needsFilename = val => val && typeof val !== "function";
const validateIfOptionNeedsFilename = (options, descriptor) => {
if (needsFilename(options.test) || needsFilename(options.include) || needsFilename(options.exclude)) {
const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */";
throw new _configError.default([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n"));
}
};
const validatePreset = (preset, context, descriptor) => {
if (!context.filename) {
var _options$overrides;
const {
options
} = preset;
validateIfOptionNeedsFilename(options, descriptor);
(_options$overrides = options.overrides) == null || _options$overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor));
}
};
const instantiatePreset = (0, _caching.makeWeakCacheSync)(({
value,
dirname,
alias,
externalDependencies
}) => {
return {
options: (0, _options.validate)("preset", value),
alias,
dirname,
externalDependencies
};
});
function* loadPresetDescriptor(descriptor, context) {
const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context));
validatePreset(preset, context, descriptor);
return {
chain: yield* (0, _configChain.buildPresetChain)(preset, context),
externalDependencies: preset.externalDependencies
};
}
function chainMaybeAsync(a, b) {
if (!a) return b;
if (!b) return a;
return function (...args) {
const res = a.apply(this, args);
if (res && typeof res.then === "function") {
return res.then(() => b.apply(this, args));
}
return b.apply(this, args);
};
}
0 && 0;
//# sourceMappingURL=full.js.map

View File

@@ -0,0 +1,4 @@
/**
* @deprecated please use `ValueOf` instead
*/
export type DictionaryValues<Type> = Type[keyof Type];

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+BAA6C;AAApC,2GAAA,mBAAmB,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 { HttpInstrumentation } from './http';\nexport type {\n HttpCustomAttributeFunction,\n HttpInstrumentationConfig,\n HttpRequestCustomAttributeFunction,\n HttpResponseCustomAttributeFunction,\n IgnoreIncomingRequestFunction,\n IgnoreOutgoingRequestFunction,\n StartIncomingSpanCustomAttributeFunction,\n StartOutgoingSpanCustomAttributeFunction,\n} from './types';\n"]}

View File

@@ -0,0 +1,65 @@
"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 mediumint_exports = {};
__export(mediumint_exports, {
SingleStoreMediumInt: () => SingleStoreMediumInt,
SingleStoreMediumIntBuilder: () => SingleStoreMediumIntBuilder,
mediumint: () => mediumint
});
module.exports = __toCommonJS(mediumint_exports);
var import_entity = require("../../entity.cjs");
var import_utils = require("../../utils.cjs");
var import_common = require("./common.cjs");
class SingleStoreMediumIntBuilder extends import_common.SingleStoreColumnBuilderWithAutoIncrement {
static [import_entity.entityKind] = "SingleStoreMediumIntBuilder";
constructor(name, config) {
super(name, "number", "SingleStoreMediumInt");
this.config.unsigned = config ? config.unsigned : false;
}
/** @internal */
build(table) {
return new SingleStoreMediumInt(
table,
this.config
);
}
}
class SingleStoreMediumInt extends import_common.SingleStoreColumnWithAutoIncrement {
static [import_entity.entityKind] = "SingleStoreMediumInt";
getSQLType() {
return `mediumint${this.config.unsigned ? " unsigned" : ""}`;
}
mapFromDriverValue(value) {
if (typeof value === "string") {
return Number(value);
}
return value;
}
}
function mediumint(a, b) {
const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
return new SingleStoreMediumIntBuilder(name, config);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SingleStoreMediumInt,
SingleStoreMediumIntBuilder,
mediumint
});
//# sourceMappingURL=mediumint.cjs.map

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { getYear as fn } from "../getYear.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const getYear = convertToFP(fn, 1);
// Fallback for modularized imports:
export default getYear;

View File

@@ -0,0 +1,27 @@
import { growthbookIntegration as growthbookIntegration$1 } from '@sentry/core';
/**
* Sentry integration for capturing feature flag evaluations from GrowthBook.
*
* See the feature flag documentation: https://develop.sentry.dev/sdk/expected-features/#feature-flags
*
* @example
* ```
* import { GrowthBook } from '@growthbook/growthbook';
* import * as Sentry from '@sentry/browser';
*
* Sentry.init({
* dsn: '___PUBLIC_DSN___',
* integrations: [Sentry.growthbookIntegration({ growthbookClass: GrowthBook })],
* });
*
* const gb = new GrowthBook();
* gb.isOn('my-feature');
* Sentry.captureException(new Error('something went wrong'));
* ```
*/
const growthbookIntegration = (({ growthbookClass }) =>
growthbookIntegration$1({ growthbookClass })) ;
export { growthbookIntegration };
//# sourceMappingURL=integration.js.map

View File

@@ -0,0 +1,166 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.RedisInstrumentationV2_V3 = void 0;
const instrumentation_1 = require("@opentelemetry/instrumentation");
const utils_1 = require("./utils");
/** @knipignore */
const version_1 = require("../version");
const api_1 = require("@opentelemetry/api");
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const semconv_1 = require("../semconv");
const redis_common_1 = require("@opentelemetry/redis-common");
class RedisInstrumentationV2_V3 extends instrumentation_1.InstrumentationBase {
static COMPONENT = 'redis';
_semconvStability;
constructor(config = {}) {
super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config);
this._semconvStability = config.semconvStability
? config.semconvStability
: (0, instrumentation_1.semconvStabilityFromStr)('database', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
}
setConfig(config = {}) {
super.setConfig(config);
this._semconvStability = config.semconvStability
? config.semconvStability
: (0, instrumentation_1.semconvStabilityFromStr)('database', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
}
init() {
return [
new instrumentation_1.InstrumentationNodeModuleDefinition('redis', ['>=2.6.0 <4'], moduleExports => {
if ((0, instrumentation_1.isWrapped)(moduleExports.RedisClient.prototype['internal_send_command'])) {
this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command');
}
this._wrap(moduleExports.RedisClient.prototype, 'internal_send_command', this._getPatchInternalSendCommand());
if ((0, instrumentation_1.isWrapped)(moduleExports.RedisClient.prototype['create_stream'])) {
this._unwrap(moduleExports.RedisClient.prototype, 'create_stream');
}
this._wrap(moduleExports.RedisClient.prototype, 'create_stream', this._getPatchCreateStream());
if ((0, instrumentation_1.isWrapped)(moduleExports.createClient)) {
this._unwrap(moduleExports, 'createClient');
}
this._wrap(moduleExports, 'createClient', this._getPatchCreateClient());
return moduleExports;
}, moduleExports => {
if (moduleExports === undefined)
return;
this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command');
this._unwrap(moduleExports.RedisClient.prototype, 'create_stream');
this._unwrap(moduleExports, 'createClient');
}),
];
}
/**
* Patch internal_send_command(...) to trace requests
*/
_getPatchInternalSendCommand() {
const instrumentation = this;
return function internal_send_command(original) {
return function internal_send_command_trace(cmd) {
// Versions of redis (2.4+) use a single options object
// instead of named arguments
if (arguments.length !== 1 || typeof cmd !== 'object') {
// We don't know how to trace this call, so don't start/stop a span
return original.apply(this, arguments);
}
const config = instrumentation.getConfig();
const hasNoParentSpan = api_1.trace.getSpan(api_1.context.active()) === undefined;
if (config.requireParentSpan === true && hasNoParentSpan) {
return original.apply(this, arguments);
}
const dbStatementSerializer = config?.dbStatementSerializer || redis_common_1.defaultDbStatementSerializer;
const attributes = {};
if (instrumentation._semconvStability & instrumentation_1.SemconvStability.OLD) {
Object.assign(attributes, {
[semconv_1.ATTR_DB_SYSTEM]: semconv_1.DB_SYSTEM_VALUE_REDIS,
[semconv_1.ATTR_DB_STATEMENT]: dbStatementSerializer(cmd.command, cmd.args),
});
}
if (instrumentation._semconvStability & instrumentation_1.SemconvStability.STABLE) {
Object.assign(attributes, {
[semantic_conventions_1.ATTR_DB_SYSTEM_NAME]: semconv_1.DB_SYSTEM_NAME_VALUE_REDIS,
[semantic_conventions_1.ATTR_DB_OPERATION_NAME]: cmd.command,
[semantic_conventions_1.ATTR_DB_QUERY_TEXT]: dbStatementSerializer(cmd.command, cmd.args),
});
}
const span = instrumentation.tracer.startSpan(`${RedisInstrumentationV2_V3.COMPONENT}-${cmd.command}`, {
kind: api_1.SpanKind.CLIENT,
attributes,
});
// Set attributes for not explicitly typed RedisPluginClientTypes
if (this.connection_options) {
const connectionAttributes = {};
if (instrumentation._semconvStability & instrumentation_1.SemconvStability.OLD) {
Object.assign(connectionAttributes, {
[semconv_1.ATTR_NET_PEER_NAME]: this.connection_options.host,
[semconv_1.ATTR_NET_PEER_PORT]: this.connection_options.port,
});
}
if (instrumentation._semconvStability & instrumentation_1.SemconvStability.STABLE) {
Object.assign(connectionAttributes, {
[semantic_conventions_1.ATTR_SERVER_ADDRESS]: this.connection_options.host,
[semantic_conventions_1.ATTR_SERVER_PORT]: this.connection_options.port,
});
}
span.setAttributes(connectionAttributes);
}
if (this.address &&
instrumentation._semconvStability & instrumentation_1.SemconvStability.OLD) {
span.setAttribute(semconv_1.ATTR_DB_CONNECTION_STRING, `redis://${this.address}`);
}
const originalCallback = arguments[0].callback;
if (originalCallback) {
const originalContext = api_1.context.active();
arguments[0].callback = function callback(err, reply) {
if (config?.responseHook) {
const responseHook = config.responseHook;
(0, instrumentation_1.safeExecuteInTheMiddle)(() => {
responseHook(span, cmd.command, cmd.args, reply);
}, err => {
if (err) {
instrumentation._diag.error('Error executing responseHook', err);
}
}, true);
}
(0, utils_1.endSpan)(span, err);
return api_1.context.with(originalContext, originalCallback, this, ...arguments);
};
}
try {
// Span will be ended in callback
return original.apply(this, arguments);
}
catch (rethrow) {
(0, utils_1.endSpan)(span, rethrow);
throw rethrow; // rethrow after ending span
}
};
};
}
_getPatchCreateClient() {
return function createClient(original) {
return (0, utils_1.getTracedCreateClient)(original);
};
}
_getPatchCreateStream() {
return function createReadStream(original) {
return (0, utils_1.getTracedCreateStreamTrace)(original);
};
}
}
exports.RedisInstrumentationV2_V3 = RedisInstrumentationV2_V3;
//# sourceMappingURL=instrumentation.js.map

View File

@@ -0,0 +1,43 @@
import { ValidationError } from '../errors/index.js';
export const ensureUsernameOrEmail = ({ authOptions: { disableLocalStrategy, loginWithUsername }, collectionSlug, data, operation, originalDoc, req })=>{
// neither username or email are required
// and neither are provided
// so we need to manually validate
if (!disableLocalStrategy && loginWithUsername && !loginWithUsername.requireEmail && !loginWithUsername.requireUsername) {
let missingFields = false;
if (operation === 'create' && !data.email && !data.username) {
missingFields = true;
} else if (operation === 'update') {
// prevent clearing both email and username
if ('email' in data && !data.email && 'username' in data && !data.username) {
missingFields = true;
}
// prevent clearing email if no username
if ('email' in data && !data.email && !originalDoc.username && !data?.username) {
missingFields = true;
}
// prevent clearing username if no email
if ('username' in data && !data.username && !originalDoc.email && !data?.email) {
missingFields = true;
}
}
if (missingFields) {
throw new ValidationError({
collection: collectionSlug,
errors: [
{
message: 'Username or email is required',
path: 'username'
},
{
message: 'Username or email is required',
path: 'email'
}
]
}, req.t);
}
}
return;
};
//# sourceMappingURL=ensureUsernameOrEmail.js.map

View File

@@ -0,0 +1,32 @@
"use strict";
exports.isYesterday = isYesterday;
var _index = require("./constructNow.js");
var _index2 = require("./isSameDay.js");
var _index3 = require("./subDays.js");
/**
* @name isYesterday
* @category Day Helpers
* @summary Is the given date yesterday?
* @pure false
*
* @description
* Is the given date yesterday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
*
* @returns The date is yesterday
*
* @example
* // If today is 6 October 2014, is 5 October 14:00:00 yesterday?
* const result = isYesterday(new Date(2014, 9, 5, 14, 0))
* //=> true
*/
function isYesterday(date) {
return (0, _index2.isSameDay)(
date,
(0, _index3.subDays)((0, _index.constructNow)(date), 1),
);
}

View File

@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
"use strict";var t=require("lexical");function e(){return t.$getRoot().getTextContent()}function n(t,n=!0){if(t)return!1;let r=e();return n&&(r=r.trim()),""===r}function r(e){if(!n(e,!1))return!1;const r=t.$getRoot().getChildren(),o=r.length;if(o>1)return!1;for(let e=0;e<o;e++){const n=r[e];if(t.$isDecoratorNode(n))return!1;if(t.$isElementNode(n)){if(!t.$isParagraphNode(n))return!1;if(0!==n.__indent)return!1;const r=n.getChildren(),o=r.length;for(let n=0;n<o;n++){const n=r[e];if(!t.$isTextNode(n))return!1}}}return!0}function o(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}exports.$canShowPlaceholder=r,exports.$canShowPlaceholderCurry=function(t){return()=>r(t)},exports.$findTextIntersectionFromCharacters=function(e,n){let r=e.getFirstChild(),o=0;t:for(;null!==r;){if(t.$isElementNode(r)){const t=r.getFirstChild();if(null!==t){r=t;continue}}else if(t.$isTextNode(r)){const t=r.getTextContentSize();if(o+t>n)return{node:r,offset:n-o};o+=t}const e=r.getNextSibling();if(null!==e){r=e;continue}let i=r.getParent();for(;null!==i;){const t=i.getNextSibling();if(null!==t){r=t;continue t}i=i.getParent()}break}return null},exports.$isRootTextContentEmpty=n,exports.$isRootTextContentEmptyCurry=function(t,e){return()=>n(t,e)},exports.$rootTextContent=e,exports.registerLexicalTextEntity=function(e,n,r,i){const s=t=>t instanceof r,l=e=>{const n=t.$createTextNode(e.getTextContent());n.setFormat(e.getFormat()),e.replace(n)};return[e.registerNodeTransform(t.TextNode,(e=>{if(!e.isSimpleText())return;let r,u=e.getPreviousSibling(),c=e.getTextContent(),f=e;if(t.$isTextNode(u)){const t=u.getTextContent(),r=n(t+c);if(s(u)){if(null===r||0!==(t=>t.getLatest().__mode)(u))return void l(u);{const n=r.end-t.length;if(n>0){const r=t+c.slice(0,n);if(u.select(),u.setTextContent(r),n===c.length)e.remove();else{const t=c.slice(n);e.setTextContent(t)}return}}}else if(null===r||r.start<t.length)return}let d=0;for(;;){r=n(c);let e,a=null===r?"":c.slice(r.end);if(c=a,""===a){const e=f.getNextSibling();if(t.$isTextNode(e)){a=f.getTextContent()+e.getTextContent();const t=n(a);if(null===t)return void(s(e)?l(e):e.markDirty());if(0!==t.start)return}}if(null===r)return;if(0===r.start&&t.$isTextNode(u)&&u.isTextEntity()){d+=r.end;continue}0===r.start?[e,f]=f.splitText(r.end):[,e,f]=f.splitText(r.start+d,r.end+d),void 0===e&&o(165,"nodeToReplace");const x=i(e);if(x.setFormat(e.getFormat()),e.replace(x),null==f)return;d=0,u=x}})),e.registerNodeTransform(r,(e=>{const r=e.getTextContent(),o=n(r);if(null===o||0!==o.start)return void l(e);if(r.length>o.end)return void e.splitText(o.end);const i=e.getPreviousSibling();t.$isTextNode(i)&&i.isTextEntity()&&(l(i),l(e));const u=e.getNextSibling();t.$isTextNode(u)&&u.isTextEntity()&&(l(u),s(e)&&l(e))}))]};

View File

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

View File

@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { differenceInHours as fn } from "../differenceInHours.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const differenceInHoursWithOptions = convertToFP(fn, 3);
// Fallback for modularized imports:
export default differenceInHoursWithOptions;

View File

@@ -0,0 +1,2 @@
export declare const isValidID: (value: number | string, type: "number" | "ObjectID" | "text") => boolean;
//# sourceMappingURL=isValidID.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cloud-off.js","sources":["../../../src/icons/cloud-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CloudOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMiAyIDIwIDIwIiAvPgogIDxwYXRoIGQ9Ik01Ljc4MiA1Ljc4MkE3IDcgMCAwIDAgOSAxOWg4LjVhNC41IDQuNSAwIDAgMCAxLjMwNy0uMTkzIiAvPgogIDxwYXRoIGQ9Ik0yMS41MzIgMTYuNUE0LjUgNC41IDAgMCAwIDE3LjUgMTBoLTEuNzlBNy4wMDggNy4wMDggMCAwIDAgMTAgNS4wNyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/cloud-off\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 CloudOff = createLucideIcon('CloudOff', [\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193', key: 'yfwify' }],\n [\n 'path',\n { d: 'M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07', key: 'jlfiyv' },\n ],\n]);\n\nexport default CloudOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,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,CAA4D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzF,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC3F,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/fastify/v3/constants.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,iBAAiB,eAAsE,CAAC;AAMrG,eAAO,MAAM,gBAAgB,aAU3B,CAAC"}

View File

@@ -0,0 +1,141 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const Dependency = require("../Dependency");
const RuntimeGlobals = require("../RuntimeGlobals");
const makeSerializable = require("../util/makeSerializable");
const ModuleDependency = require("./ModuleDependency");
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
/** @typedef {import("../AsyncDependenciesBlock")} AsyncDependenciesBlock */
/** @typedef {import("../Dependency").ReferencedExports} ReferencedExports */
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */
/** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
/** @typedef {import("../Entrypoint")} Entrypoint */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {import("../util/Hash")} Hash */
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
/**
* @typedef {object} WorkerDependencyOptions
* @property {string=} publicPath public path for the worker
* @property {boolean=} needNewUrl true when need generate `new URL(...)`, otherwise false
*/
class WorkerDependency extends ModuleDependency {
/**
* @param {string} request request
* @param {Range} range range
* @param {WorkerDependencyOptions} workerDependencyOptions options
*/
constructor(request, range, workerDependencyOptions) {
super(request);
this.range = range;
// If options are updated, don't forget to update the hash and serialization functions
/** @type {WorkerDependencyOptions} */
this.options = workerDependencyOptions;
/** Cache the hash */
/** @type {undefined | string} */
this._hashUpdate = undefined;
}
/**
* Returns list of exports referenced by this dependency
* @param {ModuleGraph} moduleGraph module graph
* @param {RuntimeSpec} runtime the runtime for which the module is analysed
* @returns {ReferencedExports} referenced exports
*/
getReferencedExports(moduleGraph, runtime) {
return Dependency.NO_EXPORTS_REFERENCED;
}
get type() {
return "new Worker()";
}
get category() {
return "worker";
}
/**
* Update the hash
* @param {Hash} hash hash to be updated
* @param {UpdateHashContext} context context
* @returns {void}
*/
updateHash(hash, context) {
if (this._hashUpdate === undefined) {
this._hashUpdate = JSON.stringify(this.options);
}
hash.update(this._hashUpdate);
}
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
const { write } = context;
write(this.options);
super.serialize(context);
}
/**
* @param {ObjectDeserializerContext} context context
*/
deserialize(context) {
const { read } = context;
this.options = read();
super.deserialize(context);
}
}
WorkerDependency.Template = class WorkerDependencyTemplate extends (
ModuleDependency.Template
) {
/**
* @param {Dependency} dependency the dependency for which the template should be applied
* @param {ReplaceSource} source the current replace source which can be modified
* @param {DependencyTemplateContext} templateContext the context object
* @returns {void}
*/
apply(dependency, source, templateContext) {
const { chunkGraph, moduleGraph, runtimeRequirements } = templateContext;
const dep = /** @type {WorkerDependency} */ (dependency);
const block = /** @type {AsyncDependenciesBlock} */ (
moduleGraph.getParentBlock(dependency)
);
const entrypoint = /** @type {Entrypoint} */ (
chunkGraph.getBlockChunkGroup(block)
);
const chunk = entrypoint.getEntrypointChunk();
// We use the workerPublicPath option if provided, else we fallback to the RuntimeGlobal publicPath
const workerImportBaseUrl = dep.options.publicPath
? `"${dep.options.publicPath}"`
: RuntimeGlobals.publicPath;
runtimeRequirements.add(RuntimeGlobals.publicPath);
runtimeRequirements.add(RuntimeGlobals.baseURI);
runtimeRequirements.add(RuntimeGlobals.getChunkScriptFilename);
const workerImportStr = `/* worker import */ ${workerImportBaseUrl} + ${
RuntimeGlobals.getChunkScriptFilename
}(${JSON.stringify(chunk.id)}), ${RuntimeGlobals.baseURI}`;
source.replace(
dep.range[0],
dep.range[1] - 1,
dep.options.needNewUrl ? `new URL(${workerImportStr})` : workerImportStr
);
}
};
makeSerializable(WorkerDependency, "webpack/lib/dependencies/WorkerDependency");
module.exports = WorkerDependency;

View File

@@ -0,0 +1,14 @@
export declare function assertType<Type>(_value: Type): void;
export declare namespace assertType {
type Equal<T, U> =
Exclude<T, U> extends never
? Exclude<U, T> extends never
? true
: false
: false;
}
export declare function resetDefaultOptions(): void;
export declare function generateOffset(originalDate: Date): string;
export declare function fakeDate(date: number | Date): {
fakeNow: (date: number | Date) => void;
};

View File

@@ -0,0 +1,3 @@
import type { BinaryLike } from 'crypto';
export declare const oneWayHash: (data: BinaryLike, secret: string) => string;
//# sourceMappingURL=oneWayHash.d.ts.map

View File

@@ -0,0 +1,29 @@
/**
* @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 Paintbrush = createLucideIcon("Paintbrush", [
["path", { d: "m14.622 17.897-10.68-2.913", key: "vj2p1u" }],
[
"path",
{
d: "M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",
key: "18tc5c"
}
],
[
"path",
{
d: "M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",
key: "ytzfxy"
}
]
]);
export { Paintbrush as default };
//# sourceMappingURL=paintbrush.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"shield-half.js","sources":["../../../src/icons/shield-half.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ShieldHalf\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTNjMCA1LTMuNSA3LjUtNy42NiA4Ljk1YTEgMSAwIDAgMS0uNjctLjAxQzcuNSAyMC41IDQgMTggNCAxM1Y2YTEgMSAwIDAgMSAxLTFjMiAwIDQuNS0xLjIgNi4yNC0yLjcyYTEuMTcgMS4xNyAwIDAgMSAxLjUyIDBDMTQuNTEgMy44MSAxNyA1IDE5IDVhMSAxIDAgMCAxIDEgMXoiIC8+CiAgPHBhdGggZD0iTTEyIDIyVjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/shield-half\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 ShieldHalf = createLucideIcon('ShieldHalf', [\n [\n 'path',\n {\n d: 'M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z',\n key: 'oel41y',\n },\n ],\n ['path', { d: 'M12 22V2', key: 'zs6s6o' }],\n]);\n\nexport default ShieldHalf;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAChD,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,6 @@
export declare const differenceInWeeksWithOptions: import("./types.js").FPFn3<
number,
import("../differenceInWeeks.js").DifferenceInWeeksOptions | undefined,
string | number | Date,
string | number | Date
>;

View File

@@ -0,0 +1 @@
{"version":3,"file":"random.js","names":[],"sources":["../../../../src/rest/commands/utils/random.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\n\n/**\n * Returns a random string of given length.\n * @param length The length of the generated string\n * @returns Generated string\n */\nexport const randomString =\n\t<Schema>(length?: number): RestCommand<string, Schema> =>\n\t() => ({\n\t\tmethod: 'GET',\n\t\tpath: `/utils/random/string`,\n\t\tparams: length !== undefined ? { length } : {},\n\t});\n"],"mappings":"AAOA,MAAa,EACH,QACF,CACN,OAAQ,MACR,KAAM,uBACN,OAAQ,IAAW,IAAA,GAAyB,EAAE,CAAf,CAAE,SAAQ,CACzC"}

View File

@@ -0,0 +1,23 @@
/**
* @name minutesToHours
* @category Conversion Helpers
* @summary Convert minutes to hours.
*
* @description
* Convert a number of minutes to a full number of hours.
*
* @param minutes - The number of minutes to be converted
*
* @returns The number of minutes converted in hours
*
* @example
* // Convert 140 minutes to hours:
* const result = minutesToHours(120)
* //=> 2
*
* @example
* // It uses floor rounding:
* const result = minutesToHours(179)
* //=> 2
*/
export declare function minutesToHours(minutes: number): number;

View File

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

View File

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

View File

@@ -0,0 +1,23 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.cjs";
export type SingleStoreTimeBuilderInitial<TName extends string> = SingleStoreTimeBuilder<{
name: TName;
dataType: 'string';
columnType: 'SingleStoreTime';
data: string;
driverParam: string | number;
enumValues: undefined;
generated: undefined;
}>;
export declare class SingleStoreTimeBuilder<T extends ColumnBuilderBaseConfig<'string', 'SingleStoreTime'>> extends SingleStoreColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class SingleStoreTime<T extends ColumnBaseConfig<'string', 'SingleStoreTime'>> extends SingleStoreColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
}
export declare function time(): SingleStoreTimeBuilderInitial<''>;
export declare function time<TName extends string>(name: TName): SingleStoreTimeBuilderInitial<TName>;

View File

@@ -0,0 +1,40 @@
import type { DocumentNode } from '../language/ast';
import type {
GraphQLSchemaNormalizedConfig,
GraphQLSchemaValidationOptions,
} from '../type/schema';
import { GraphQLSchema } from '../type/schema';
interface Options extends GraphQLSchemaValidationOptions {
/**
* Set to true to assume the SDL is valid.
*
* Default: false
*/
assumeValidSDL?: boolean;
}
/**
* Produces a new schema given an existing schema and a document which may
* contain GraphQL type extensions and definitions. The original schema will
* remain unaltered.
*
* Because a schema represents a graph of references, a schema cannot be
* extended without effectively making an entire copy. We do not know until it's
* too late if subgraphs remain unchanged.
*
* This algorithm copies the provided schema, applying extensions while
* producing the copy. The original schema remains unaltered.
*/
export declare function extendSchema(
schema: GraphQLSchema,
documentAST: DocumentNode,
options?: Options,
): GraphQLSchema;
/**
* @internal
*/
export declare function extendSchemaImpl(
schemaConfig: GraphQLSchemaNormalizedConfig,
documentAST: DocumentNode,
options?: Options,
): GraphQLSchemaNormalizedConfig;
export {};

View File

@@ -0,0 +1,36 @@
import { Breadcrumb, XhrBreadcrumbData } from '@sentry/core';
import { NetworkMetaWarning, XhrHint } from '@sentry-internal/browser-utils';
import { ReplayContainer, ReplayNetworkOptions } from '../../types';
/**
* Capture an XHR breadcrumb to a replay.
* This adds additional data (where appropriate).
*/
export declare function captureXhrBreadcrumbToReplay(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>, options: ReplayNetworkOptions & {
replay: ReplayContainer;
}): Promise<void>;
/**
* Enrich a breadcrumb with additional data.
* This has to be sync & mutate the given breadcrumb,
* as the breadcrumb is afterwards consumed by other handlers.
*/
export declare function enrichXhrBreadcrumb(breadcrumb: Breadcrumb & {
data: XhrBreadcrumbData;
}, hint: Partial<XhrHint>): void;
/**
* Get the string representation of the XHR response.
* Based on MDN, these are the possible types of the response:
* string
* ArrayBuffer
* Blob
* Document
* POJO
*
* Exported only for tests.
*/
export declare function _parseXhrResponse(body: XMLHttpRequest['response'], responseType: XMLHttpRequest['responseType']): [
string | undefined,
NetworkMetaWarning?
];
//# sourceMappingURL=xhrUtils.d.ts.map

View File

@@ -0,0 +1,33 @@
var baseIteratee = require('./_baseIteratee'),
baseSum = require('./_baseSum');
/**
* This method is like `_.sum` except that it accepts `iteratee` which is
* invoked for each element in `array` to generate the value to be summed.
* The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Math
* @param {Array} array The array to iterate over.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the sum.
* @example
*
* var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
*
* _.sumBy(objects, function(o) { return o.n; });
* // => 20
*
* // The `_.property` iteratee shorthand.
* _.sumBy(objects, 'n');
* // => 20
*/
function sumBy(array, iteratee) {
return (array && array.length)
? baseSum(array, baseIteratee(iteratee, 2))
: 0;
}
module.exports = sumBy;

View File

@@ -0,0 +1,45 @@
import type { RequestEventData } from '../types-hoist/request';
import type { WorkerLocation } from './misc';
import type { SpanAttributes } from './span';
/**
* Context data passed by the user when starting a transaction, to be used by the tracesSampler method.
*/
export interface CustomSamplingContext {
[key: string]: any;
}
/**
* Auxiliary data for various sampling mechanisms in the Sentry SDK.
*/
export interface SamplingContext extends CustomSamplingContext {
/**
* Sampling decision from the parent transaction, if any.
*/
parentSampled?: boolean;
/**
* Sample rate that is coming from an incoming trace (if there is one).
*/
parentSampleRate?: number;
/**
* Object representing the URL of the current page or worker script. Passed by default when using the `BrowserTracing`
* integration.
*/
location?: WorkerLocation;
/**
* Object representing the incoming request to a node server in a normalized format.
*/
normalizedRequest?: RequestEventData;
/** The name of the span being sampled. */
name: string;
/** Initial attributes that have been passed to the span being sampled. */
attributes?: SpanAttributes;
}
/**
* Auxiliary data passed to the `tracesSampler` function.
*/
export interface TracesSamplerSamplingContext extends SamplingContext {
/**
* Returns a sample rate value that matches the sampling decision from the incoming trace, or falls back to the provided `fallbackSampleRate`.
*/
inheritOrSampleWith: (fallbackSampleRate: number) => number;
}
//# sourceMappingURL=samplingcontext.d.ts.map

View File

@@ -0,0 +1,138 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern =
/^(\d+)(-?(е|я|га|і|ы|ае|ая|яя|шы|гі|ці|ты|мы))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((да )?н\.?\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 matchMonthPatterns = {
narrow: /^[слкмчжв]/i,
abbreviated:
/^(студз|лют|сак|крас|ма[йя]|чэрв|ліп|жн|вер|кастр|ліст|снеж)\.?/i,
wide: /^(студзен[ья]|лют(ы|ага)|сакавіка?|красавіка?|ма[йя]|чэрвен[ья]|ліпен[ья]|жні(вень|ўня)|верас(ень|ня)|кастрычніка?|лістапада?|снеж(ань|ня))/i,
};
const parseMonthPatterns = {
narrow: [
/^с/i,
/^л/i,
/^с/i,
/^к/i,
/^м/i,
/^ч/i,
/^л/i,
/^ж/i,
/^в/i,
/^к/i,
/^л/i,
/^с/i,
],
any: [
/^ст/i,
/^лю/i,
/^са/i,
/^кр/i,
/^ма/i,
/^ч/i,
/^ліп/i,
/^ж/i,
/^в/i,
/^ка/i,
/^ліс/i,
/^сн/i,
],
};
const matchDayPatterns = {
narrow: /^[нпасч]/i,
short: /^(нд|ня|пн|па|аў|ат|ср|се|чц|ча|пт|пя|сб|су)\.?/i,
abbreviated: /^(нядз?|ндз|пнд|пан|аўт|срд|сер|чцв|чац|птн|пят|суб).?/i,
wide: /^(нядзел[яі]|панядзел(ак|ка)|аўтор(ак|ка)|серад[аы]|чацв(ер|ярга)|пятніц[аы]|субот[аы])/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^а/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н/i, /^п[ан]/i, /^а/i, /^с[ер]/i, /^ч/i, /^п[ят]/i, /^с[уб]/i],
};
const matchDayPeriodPatterns = {
narrow: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
abbreviated: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
wide: /^([дп]п|поўнач|поўдзень|раніц[аы]|дзень|дня|вечара?|ночы?)/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: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1,18 @@
/**
* @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 Link2Off = createLucideIcon("Link2Off", [
["path", { d: "M9 17H7A5 5 0 0 1 7 7", key: "10o201" }],
["path", { d: "M15 7h2a5 5 0 0 1 4 8", key: "1d3206" }],
["line", { x1: "8", x2: "12", y1: "12", y2: "12", key: "rvw6j4" }],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { Link2Off as default };
//# sourceMappingURL=link-2-off.js.map

View File

@@ -0,0 +1,43 @@
import type { FieldState, Validate } from 'payload';
export type Options = {
disableFormData?: boolean;
hasRows?: boolean;
/**
* If `path` is provided to this hook, it will be used outright. This is useful when calling this hook directly within a custom component.
* Otherwise, the field will attempt to get the path from the `FieldPathContext` via the `useFieldPath` hook.
* If still not found, the `potentiallyStalePath` arg will be used. See the note below about why this is important.
*/
path?: string;
/**
* Custom server components receive a static `path` prop at render-time, leading to temporarily stale paths when re-ordering rows in form state.
* This is because when manipulating rows, field paths change in form state, but the prop remains the same until the component is re-rendered on the server.
* This causes the component to temporarily point to the wrong field in form state until the server responds with a freshly rendered component.
* To prevent this, fields are wrapped with a `FieldPathContext` which is guaranteed to be up-to-date.
* The `path` prop that Payload's default fields receive, then, are sent into this hook as the `potentiallyStalePath` arg.
* This ensures that:
* 1. Custom components that use this hook directly will still respect the `path` prop as top priority.
* 2. Custom server components that blindly spread their props into default Payload fields still prefer the dynamic path from context.
* 3. Components that render default Payload fields directly do not require a `FieldPathProvider`, e.g. the email field in the account view.
*/
potentiallyStalePath?: string;
/**
* Client-side validation function fired when the form is submitted.
*/
validate?: Validate;
};
export type FieldType<T> = {
disabled: boolean;
formInitializing: boolean;
formProcessing: boolean;
formSubmitted: boolean;
initialValue?: T;
path: string;
/**
* @deprecated - readOnly is no longer returned from useField. Remove this in 4.0.
*/
readOnly?: boolean;
setValue: (val: unknown, disableModifyingForm?: boolean) => void;
showError: boolean;
value: T;
} & Pick<FieldState, 'blocksFilterOptions' | 'customComponents' | 'errorMessage' | 'errorPaths' | 'filterOptions' | 'rows' | 'selectFilterOptions' | 'valid'>;
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,30 @@
import { formatDistance } from "./zh-TW/_lib/formatDistance.mjs";
import { formatLong } from "./zh-TW/_lib/formatLong.mjs";
import { formatRelative } from "./zh-TW/_lib/formatRelative.mjs";
import { localize } from "./zh-TW/_lib/localize.mjs";
import { match } from "./zh-TW/_lib/match.mjs";
/**
* @category Locales
* @summary Chinese Traditional locale.
* @language Chinese Traditional
* @iso-639-2 zho
* @author tonypai [@tpai](https://github.com/tpai)
* @author Jack Hsu [@jackhsu978](https://github.com/jackhsu978)
* @author Terrence Lam [@skyuplam](https://github.com/skyuplam)
*/
export const zhTW = {
code: "zh-TW",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default zhTW;

View File

@@ -0,0 +1,23 @@
import type { PrismaClient } from '@prisma/client/extension';
import { entityKind } from "../../entity.cjs";
import type { Logger } from "../../logger.cjs";
import { PgDatabase } from "../../pg-core/index.cjs";
import type { DrizzleConfig } from "../../utils.cjs";
import type { PrismaPgQueryResultHKT } from "./session.cjs";
export declare class PrismaPgDatabase extends PgDatabase<PrismaPgQueryResultHKT, Record<string, never>> {
static readonly [entityKind]: string;
constructor(client: PrismaClient, logger: Logger | undefined);
}
export type PrismaPgConfig = Omit<DrizzleConfig, 'schema'>;
export declare function drizzle(config?: PrismaPgConfig): (client: any) => {
$extends: {
extArgs: {
result: {};
model: {};
query: {};
client: {
$drizzle: () => PrismaPgDatabase;
};
};
};
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"stackStrategy.d.ts","sourceRoot":"","sources":["../../../src/asyncContext/stackStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,UAAU,KAAK;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,eAAe,CAAQ;gBAEZ,KAAK,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,EAAE,KAAK;IAoBxD;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC;IA6BrD;;OAEG;IACI,SAAS,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,SAAS;IAInD;;OAEG;IACI,QAAQ,IAAI,KAAK;IAIxB;;OAEG;IACI,iBAAiB,IAAI,KAAK;IAIjC;;OAEG;IACI,WAAW,IAAI,KAAK;IAI3B;;OAEG;IACH,OAAO,CAAC,UAAU;IAUlB;;OAEG;IACH,OAAO,CAAC,SAAS;CAIlB;AA+BD;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,oBAAoB,CAWnE"}

View File

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

View File

@@ -0,0 +1,8 @@
import type { ClientCollectionConfig } from 'payload';
import React from 'react';
export declare function ListCreateNewButton({ collectionConfig, hasCreatePermission, newDocumentURL, }: {
collectionConfig: ClientCollectionConfig;
hasCreatePermission: boolean;
newDocumentURL: string;
}): React.JSX.Element;
//# sourceMappingURL=ListCreateNewDocButton.d.ts.map

View File

@@ -0,0 +1,11 @@
'use strict'
const debug = (
typeof process === 'object' &&
process.env &&
process.env.NODE_DEBUG &&
/\bsemver\b/i.test(process.env.NODE_DEBUG)
) ? (...args) => console.error('SEMVER', ...args)
: () => {}
module.exports = debug

View File

@@ -0,0 +1 @@
{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GACnB,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1B,UAAS,WAAgB,KACxB,OAQF,CAAA"}

View File

@@ -0,0 +1,461 @@
/**
* default settings
*
* @author Zongmin Lei<leizongmin@gmail.com>
*/
var FilterCSS = require("cssfilter").FilterCSS;
var getDefaultCSSWhiteList = require("cssfilter").getDefaultWhiteList;
var _ = require("./util");
function getDefaultWhiteList() {
return {
a: ["target", "href", "title"],
abbr: ["title"],
address: [],
area: ["shape", "coords", "href", "alt"],
article: [],
aside: [],
audio: [
"autoplay",
"controls",
"crossorigin",
"loop",
"muted",
"preload",
"src",
],
b: [],
bdi: ["dir"],
bdo: ["dir"],
big: [],
blockquote: ["cite"],
br: [],
caption: [],
center: [],
cite: [],
code: [],
col: ["align", "valign", "span", "width"],
colgroup: ["align", "valign", "span", "width"],
dd: [],
del: ["datetime"],
details: ["open"],
div: [],
dl: [],
dt: [],
em: [],
figcaption: [],
figure: [],
font: ["color", "size", "face"],
footer: [],
h1: [],
h2: [],
h3: [],
h4: [],
h5: [],
h6: [],
header: [],
hr: [],
i: [],
img: ["src", "alt", "title", "width", "height", "loading"],
ins: ["datetime"],
kbd: [],
li: [],
mark: [],
nav: [],
ol: [],
p: [],
pre: [],
s: [],
section: [],
small: [],
span: [],
sub: [],
summary: [],
sup: [],
strong: [],
strike: [],
table: ["width", "border", "align", "valign"],
tbody: ["align", "valign"],
td: ["width", "rowspan", "colspan", "align", "valign"],
tfoot: ["align", "valign"],
th: ["width", "rowspan", "colspan", "align", "valign"],
thead: ["align", "valign"],
tr: ["rowspan", "align", "valign"],
tt: [],
u: [],
ul: [],
video: [
"autoplay",
"controls",
"crossorigin",
"loop",
"muted",
"playsinline",
"poster",
"preload",
"src",
"height",
"width",
],
};
}
var defaultCSSFilter = new FilterCSS();
/**
* default onTag function
*
* @param {String} tag
* @param {String} html
* @param {Object} options
* @return {String}
*/
function onTag(tag, html, options) {
// do nothing
}
/**
* default onIgnoreTag function
*
* @param {String} tag
* @param {String} html
* @param {Object} options
* @return {String}
*/
function onIgnoreTag(tag, html, options) {
// do nothing
}
/**
* default onTagAttr function
*
* @param {String} tag
* @param {String} name
* @param {String} value
* @return {String}
*/
function onTagAttr(tag, name, value) {
// do nothing
}
/**
* default onIgnoreTagAttr function
*
* @param {String} tag
* @param {String} name
* @param {String} value
* @return {String}
*/
function onIgnoreTagAttr(tag, name, value) {
// do nothing
}
/**
* default escapeHtml function
*
* @param {String} html
*/
function escapeHtml(html) {
return html.replace(REGEXP_LT, "&lt;").replace(REGEXP_GT, "&gt;");
}
/**
* default safeAttrValue function
*
* @param {String} tag
* @param {String} name
* @param {String} value
* @param {Object} cssFilter
* @return {String}
*/
function safeAttrValue(tag, name, value, cssFilter) {
// unescape attribute value firstly
value = friendlyAttrValue(value);
if (name === "href" || name === "src") {
// filter `href` and `src` attribute
// only allow the value that starts with `http://` | `https://` | `mailto:` | `/` | `#`
value = _.trim(value);
if (value === "#") return "#";
if (
!(
value.substr(0, 7) === "http://" ||
value.substr(0, 8) === "https://" ||
value.substr(0, 7) === "mailto:" ||
value.substr(0, 4) === "tel:" ||
value.substr(0, 11) === "data:image/" ||
value.substr(0, 6) === "ftp://" ||
value.substr(0, 2) === "./" ||
value.substr(0, 3) === "../" ||
value[0] === "#" ||
value[0] === "/"
)
) {
return "";
}
} else if (name === "background") {
// filter `background` attribute (maybe no use)
// `javascript:`
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
return "";
}
} else if (name === "style") {
// `expression()`
REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;
if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) {
return "";
}
// `url()`
REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;
if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
return "";
}
}
if (cssFilter !== false) {
cssFilter = cssFilter || defaultCSSFilter;
value = cssFilter.process(value);
}
}
// escape `<>"` before returns
value = escapeAttrValue(value);
return value;
}
// RegExp list
var REGEXP_LT = /</g;
var REGEXP_GT = />/g;
var REGEXP_QUOTE = /"/g;
var REGEXP_QUOTE_2 = /&quot;/g;
var REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;
var REGEXP_ATTR_VALUE_COLON = /&colon;?/gim;
var REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;
// var REGEXP_DEFAULT_ON_TAG_ATTR_3 = /\/\*|\*\//gm;
var REGEXP_DEFAULT_ON_TAG_ATTR_4 =
/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi;
// var REGEXP_DEFAULT_ON_TAG_ATTR_5 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:/gi;
// var REGEXP_DEFAULT_ON_TAG_ATTR_6 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:\s*image\//gi;
var REGEXP_DEFAULT_ON_TAG_ATTR_7 =
/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;
var REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\s*r\s*l\s*\(.*/gi;
/**
* escape double quote
*
* @param {String} str
* @return {String} str
*/
function escapeQuote(str) {
return str.replace(REGEXP_QUOTE, "&quot;");
}
/**
* unescape double quote
*
* @param {String} str
* @return {String} str
*/
function unescapeQuote(str) {
return str.replace(REGEXP_QUOTE_2, '"');
}
/**
* escape html entities
*
* @param {String} str
* @return {String}
*/
function escapeHtmlEntities(str) {
return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str, code) {
return code[0] === "x" || code[0] === "X"
? String.fromCharCode(parseInt(code.substr(1), 16))
: String.fromCharCode(parseInt(code, 10));
});
}
/**
* escape html5 new danger entities
*
* @param {String} str
* @return {String}
*/
function escapeDangerHtml5Entities(str) {
return str
.replace(REGEXP_ATTR_VALUE_COLON, ":")
.replace(REGEXP_ATTR_VALUE_NEWLINE, " ");
}
/**
* clear nonprintable characters
*
* @param {String} str
* @return {String}
*/
function clearNonPrintableCharacter(str) {
var str2 = "";
for (var i = 0, len = str.length; i < len; i++) {
str2 += str.charCodeAt(i) < 32 ? " " : str.charAt(i);
}
return _.trim(str2);
}
/**
* get friendly attribute value
*
* @param {String} str
* @return {String}
*/
function friendlyAttrValue(str) {
str = unescapeQuote(str);
str = escapeHtmlEntities(str);
str = escapeDangerHtml5Entities(str);
str = clearNonPrintableCharacter(str);
return str;
}
/**
* unescape attribute value
*
* @param {String} str
* @return {String}
*/
function escapeAttrValue(str) {
str = escapeQuote(str);
str = escapeHtml(str);
return str;
}
/**
* `onIgnoreTag` function for removing all the tags that are not in whitelist
*/
function onIgnoreTagStripAll() {
return "";
}
/**
* remove tag body
* specify a `tags` list, if the tag is not in the `tags` list then process by the specify function (optional)
*
* @param {array} tags
* @param {function} next
*/
function StripTagBody(tags, next) {
if (typeof next !== "function") {
next = function () {};
}
var isRemoveAllTag = !Array.isArray(tags);
function isRemoveTag(tag) {
if (isRemoveAllTag) return true;
return _.indexOf(tags, tag) !== -1;
}
var removeList = [];
var posStart = false;
return {
onIgnoreTag: function (tag, html, options) {
if (isRemoveTag(tag)) {
if (options.isClosing) {
var ret = "[/removed]";
var end = options.position + ret.length;
removeList.push([
posStart !== false ? posStart : options.position,
end,
]);
posStart = false;
return ret;
} else {
if (!posStart) {
posStart = options.position;
}
return "[removed]";
}
} else {
return next(tag, html, options);
}
},
remove: function (html) {
var rethtml = "";
var lastPos = 0;
_.forEach(removeList, function (pos) {
rethtml += html.slice(lastPos, pos[0]);
lastPos = pos[1];
});
rethtml += html.slice(lastPos);
return rethtml;
},
};
}
/**
* remove html comments
*
* @param {String} html
* @return {String}
*/
function stripCommentTag(html) {
var retHtml = "";
var lastPos = 0;
while (lastPos < html.length) {
var i = html.indexOf("<!--", lastPos);
if (i === -1) {
retHtml += html.slice(lastPos);
break;
}
retHtml += html.slice(lastPos, i);
var j = html.indexOf("-->", i);
if (j === -1) {
break;
}
lastPos = j + 3;
}
return retHtml;
}
/**
* remove invisible characters
*
* @param {String} html
* @return {String}
*/
function stripBlankChar(html) {
var chars = html.split("");
chars = chars.filter(function (char) {
var c = char.charCodeAt(0);
if (c === 127) return false;
if (c <= 31) {
if (c === 10 || c === 13) return true;
return false;
}
return true;
});
return chars.join("");
}
exports.whiteList = getDefaultWhiteList();
exports.getDefaultWhiteList = getDefaultWhiteList;
exports.onTag = onTag;
exports.onIgnoreTag = onIgnoreTag;
exports.onTagAttr = onTagAttr;
exports.onIgnoreTagAttr = onIgnoreTagAttr;
exports.safeAttrValue = safeAttrValue;
exports.escapeHtml = escapeHtml;
exports.escapeQuote = escapeQuote;
exports.unescapeQuote = unescapeQuote;
exports.escapeHtmlEntities = escapeHtmlEntities;
exports.escapeDangerHtml5Entities = escapeDangerHtml5Entities;
exports.clearNonPrintableCharacter = clearNonPrintableCharacter;
exports.friendlyAttrValue = friendlyAttrValue;
exports.escapeAttrValue = escapeAttrValue;
exports.onIgnoreTagStripAll = onIgnoreTagStripAll;
exports.StripTagBody = StripTagBody;
exports.stripCommentTag = stripCommentTag;
exports.stripBlankChar = stripBlankChar;
exports.attributeWrapSign = '"';
exports.cssFilter = defaultCSSFilter;
exports.getDefaultCSSWhiteList = getDefaultCSSWhiteList;

View File

@@ -0,0 +1,62 @@
{
"name": "@opentelemetry/instrumentation-undici",
"version": "0.21.0",
"description": "OpenTelemetry instrumentation for `undici` http client and Node.js fetch()",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib.git",
"directory": "packages/instrumentation-undici"
},
"scripts": {
"clean": "rimraf build/*",
"compile": "tsc -p .",
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/instrumentation-undici",
"prepublishOnly": "npm run compile",
"tdd": "npm run test -- --watch-extensions ts --watch",
"test": "nyc --no-clean mocha test/**/*.test.ts",
"test-all-versions": "tav",
"version:update": "node ../../scripts/version-update.js",
"watch": "tsc -w"
},
"keywords": [
"opentelemetry",
"fetch",
"undici",
"nodejs",
"tracing",
"instrumentation"
],
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": "^18.19.0 || >=20.6.0"
},
"files": [
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts"
],
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/sdk-metrics": "^2.0.0",
"@opentelemetry/sdk-trace-base": "^2.0.0",
"@opentelemetry/sdk-trace-node": "^2.0.0",
"undici": "6.21.3"
},
"peerDependencies": {
"@opentelemetry/api": "^1.7.0"
},
"dependencies": {
"@opentelemetry/core": "^2.0.0",
"@opentelemetry/instrumentation": "^0.211.0",
"@opentelemetry/semantic-conventions": "^1.24.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-undici#readme",
"sideEffects": false,
"gitHead": "7a5f3c0a09b6a2d32c712b2962b95137c906a016"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"allRequired.js","sourceRoot":"","sources":["../../src/definitions/allRequired.ts"],"names":[],"mappings":";;AAEA,SAAwB,MAAM;IAC5B,OAAO;QACL,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,SAAS;QACrB,KAAK,CAAC,MAAe,EAAE,YAAY;YACjC,IAAI,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAA;YACxB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;YACrD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAA;YACtC,OAAO,EAAC,QAAQ,EAAC,CAAA;QACnB,CAAC;QACD,YAAY,EAAE,CAAC,YAAY,CAAC;KAC7B,CAAA;AACH,CAAC;AAbD,yBAaC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"fold-vertical.js","sources":["../../../src/icons/fold-vertical.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FoldVertical\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMjJ2LTYiIC8+CiAgPHBhdGggZD0iTTEyIDhWMiIgLz4KICA8cGF0aCBkPSJNNCAxMkgyIiAvPgogIDxwYXRoIGQ9Ik0xMCAxMkg4IiAvPgogIDxwYXRoIGQ9Ik0xNiAxMmgtMiIgLz4KICA8cGF0aCBkPSJNMjIgMTJoLTIiIC8+CiAgPHBhdGggZD0ibTE1IDE5LTMtMy0zIDMiIC8+CiAgPHBhdGggZD0ibTE1IDUtMyAzLTMtMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/fold-vertical\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 FoldVertical = createLucideIcon('FoldVertical', [\n ['path', { d: 'M12 22v-6', key: '6o8u61' }],\n ['path', { d: 'M12 8V2', key: '1wkif3' }],\n ['path', { d: 'M4 12H2', key: 'rhcxmi' }],\n ['path', { d: 'M10 12H8', key: 's88cx1' }],\n ['path', { d: 'M16 12h-2', key: '10asgb' }],\n ['path', { d: 'M22 12h-2', key: '14jgyd' }],\n ['path', { d: 'm15 19-3-3-3 3', key: 'e37ymu' }],\n ['path', { d: 'm15 5-3 3-3-3', key: '19d6lf' }],\n]);\n\nexport default FoldVertical;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAkB,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,CAC/C,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;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,YAAY,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC"}

View File

@@ -0,0 +1,17 @@
import types from './dist/types.js'
export const binaryOptions = types.binaryOptions
export const boolOptions = types.boolOptions
export const intOptions = types.intOptions
export const nullOptions = types.nullOptions
export const strOptions = types.strOptions
export const Schema = types.Schema
export const Alias = types.Alias
export const Collection = types.Collection
export const Merge = types.Merge
export const Node = types.Node
export const Pair = types.Pair
export const Scalar = types.Scalar
export const YAMLMap = types.YAMLMap
export const YAMLSeq = types.YAMLSeq

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/uploads/parseRangeHeader.ts"],"sourcesContent":["import parseRange from 'range-parser'\n\nexport type ByteRange = {\n end: number\n start: number\n}\n\nexport type ParseRangeResult =\n | { range: ByteRange; type: 'partial' }\n | { range: null; type: 'full' }\n | { range: null; type: 'invalid' }\n\n/**\n * Parses HTTP Range header according to RFC 7233\n *\n * @returns Result object indicating whether to serve full file, partial content, or invalid range\n */\nexport function parseRangeHeader({\n fileSize,\n rangeHeader,\n}: {\n fileSize: number\n rangeHeader: null | string\n}): ParseRangeResult {\n // No Range header - serve full file\n if (!rangeHeader) {\n return { type: 'full', range: null }\n }\n\n const result = parseRange(fileSize, rangeHeader)\n\n // Invalid range syntax or unsatisfiable range\n if (result === -1 || result === -2) {\n return { type: 'invalid', range: null }\n }\n\n // Must be bytes range type\n if (result.type !== 'bytes' || result.length === 0) {\n return { type: 'invalid', range: null }\n }\n\n // Multi-range requests: use first range only (standard simplification)\n const range = result[0]\n\n if (!range) {\n return { type: 'invalid', range: null }\n }\n\n return {\n type: 'partial',\n range: {\n end: range.end,\n start: range.start,\n },\n }\n}\n"],"names":["parseRange","parseRangeHeader","fileSize","rangeHeader","type","range","result","length","end","start"],"mappings":"AAAA,OAAOA,gBAAgB,eAAc;AAYrC;;;;CAIC,GACD,OAAO,SAASC,iBAAiB,EAC/BC,QAAQ,EACRC,WAAW,EAIZ;IACC,oCAAoC;IACpC,IAAI,CAACA,aAAa;QAChB,OAAO;YAAEC,MAAM;YAAQC,OAAO;QAAK;IACrC;IAEA,MAAMC,SAASN,WAAWE,UAAUC;IAEpC,8CAA8C;IAC9C,IAAIG,WAAW,CAAC,KAAKA,WAAW,CAAC,GAAG;QAClC,OAAO;YAAEF,MAAM;YAAWC,OAAO;QAAK;IACxC;IAEA,2BAA2B;IAC3B,IAAIC,OAAOF,IAAI,KAAK,WAAWE,OAAOC,MAAM,KAAK,GAAG;QAClD,OAAO;YAAEH,MAAM;YAAWC,OAAO;QAAK;IACxC;IAEA,uEAAuE;IACvE,MAAMA,QAAQC,MAAM,CAAC,EAAE;IAEvB,IAAI,CAACD,OAAO;QACV,OAAO;YAAED,MAAM;YAAWC,OAAO;QAAK;IACxC;IAEA,OAAO;QACLD,MAAM;QACNC,OAAO;YACLG,KAAKH,MAAMG,GAAG;YACdC,OAAOJ,MAAMI,KAAK;QACpB;IACF;AACF"}

View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.cjs");
const dateFormats = {
full: "EEEE, d 'de' MMMM 'de' y",
long: "d 'de' MMMM 'de' y",
medium: "d 'de' MMM 'de' y",
short: "dd/MM/y",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'às' {{time}}",
long: "{{date}} 'às' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

View File

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

View File

@@ -0,0 +1,137 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const randomSafeContext = require('./randomSafeContext.js');
const worldwide = require('./worldwide.js');
const ONE_SECOND_IN_MS = 1000;
/**
* A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}
* for accessing a high-resolution monotonic clock.
*/
/**
* Returns a timestamp in seconds since the UNIX epoch using the Date API.
*/
function dateTimestampInSeconds() {
return randomSafeContext.safeDateNow() / ONE_SECOND_IN_MS;
}
/**
* Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not
* support the API.
*
* Wrapping the native API works around differences in behavior from different browsers.
*/
function createUnixTimestampInSecondsFunc() {
const { performance } = worldwide.GLOBAL_OBJ ;
// Some browser and environments don't have a performance or timeOrigin, so we fallback to
// using Date.now() to compute the starting time.
if (!performance?.now || !performance.timeOrigin) {
return dateTimestampInSeconds;
}
const timeOrigin = performance.timeOrigin;
// performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current
// wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.
//
// TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the
// wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and
// correct for this.
// See: https://github.com/getsentry/sentry-javascript/issues/2590
// See: https://github.com/mdn/content/issues/4713
// See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6
return () => {
return (timeOrigin + randomSafeContext.withRandomSafeContext(() => performance.now())) / ONE_SECOND_IN_MS;
};
}
let _cachedTimestampInSeconds;
/**
* Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the
* availability of the Performance API.
*
* BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is
* asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The
* skew can grow to arbitrary amounts like days, weeks or months.
* See https://github.com/getsentry/sentry-javascript/issues/2590.
*/
function timestampInSeconds() {
// We store this in a closure so that we don't have to create a new function every time this is called.
const func = _cachedTimestampInSeconds ?? (_cachedTimestampInSeconds = createUnixTimestampInSecondsFunc());
return func();
}
/**
* Cached result of getBrowserTimeOrigin.
*/
let cachedTimeOrigin = null;
/**
* Gets the time origin and the mode used to determine it.
*
* Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or
* performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin
* data as reliable if they are within a reasonable threshold of the current time.
*
* TODO: move to `@sentry/browser-utils` package.
*/
function getBrowserTimeOrigin() {
const { performance } = worldwide.GLOBAL_OBJ ;
if (!performance?.now) {
return undefined;
}
const threshold = 300000; // 5 minutes in milliseconds
const performanceNow = randomSafeContext.withRandomSafeContext(() => performance.now());
const dateNow = randomSafeContext.safeDateNow();
const timeOrigin = performance.timeOrigin;
if (typeof timeOrigin === 'number') {
const timeOriginDelta = Math.abs(timeOrigin + performanceNow - dateNow);
if (timeOriginDelta < threshold) {
return timeOrigin;
}
}
// TODO: Remove all code related to `performance.timing.navigationStart` once we drop support for Safari 14.
// `performance.timeSince` is available in Safari 15.
// see: https://caniuse.com/mdn-api_performance_timeorigin
// While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin
// is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.
// Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always
// a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the
// Date API.
// eslint-disable-next-line deprecation/deprecation
const navigationStart = performance.timing?.navigationStart;
if (typeof navigationStart === 'number') {
const navigationStartDelta = Math.abs(navigationStart + performanceNow - dateNow);
if (navigationStartDelta < threshold) {
return navigationStart;
}
}
// Either both timeOrigin and navigationStart are skewed or neither is available, fallback to subtracting
// `performance.now()` from `Date.now()`.
return dateNow - performanceNow;
}
/**
* The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
* performance API is available.
*/
function browserPerformanceTimeOrigin() {
if (cachedTimeOrigin === null) {
cachedTimeOrigin = getBrowserTimeOrigin();
}
return cachedTimeOrigin;
}
exports.browserPerformanceTimeOrigin = browserPerformanceTimeOrigin;
exports.dateTimestampInSeconds = dateTimestampInSeconds;
exports.timestampInSeconds = timestampInSeconds;
//# sourceMappingURL=time.js.map

View File

@@ -0,0 +1,40 @@
import type { CollectionSlug, Data, ListQuery } from 'payload';
import type { useSelection } from '../../providers/Selection/index.js';
import type { UseDocumentDrawer } from '../DocumentDrawer/types.js';
import type { Option } from '../ReactSelect/index.js';
export type ListDrawerContextProps = {
readonly allowCreate?: boolean;
readonly createNewDrawerSlug?: string;
readonly DocumentDrawerToggler?: ReturnType<UseDocumentDrawer>[1];
readonly drawerSlug?: string;
readonly enabledCollections?: CollectionSlug[];
readonly onBulkSelect?: (selected: ReturnType<typeof useSelection>['selected']) => void;
readonly onQueryChange?: (query: ListQuery) => void;
readonly onSelect?: (args: {
collectionSlug: CollectionSlug;
doc: Data;
/**
* @deprecated
* The `docID` property is deprecated and will be removed in the next major version of Payload.
* Use `doc.id` instead.
*/
docID: string;
}) => void;
readonly selectedOption?: Option<CollectionSlug>;
readonly setSelectedOption?: (option: Option<CollectionSlug>) => void;
};
export type ListDrawerContextType = {
readonly isInDrawer: boolean;
/**
* When called, will either refresh the list view with its currently selected collection.
* If an collection slug is provided, will use that instead of the currently selected one.
*/
readonly refresh: (collectionSlug?: CollectionSlug) => Promise<void>;
} & ListDrawerContextProps;
export declare const ListDrawerContext: import("react").Context<ListDrawerContextType>;
export declare const ListDrawerContextProvider: React.FC<{
children: React.ReactNode;
refresh: ListDrawerContextType['refresh'];
} & ListDrawerContextProps>;
export declare const useListDrawerContext: () => ListDrawerContextType;
//# sourceMappingURL=Provider.d.ts.map

View File

@@ -0,0 +1,33 @@
"use strict";
exports.subMonths = subMonths;
var _index = require("./addMonths.cjs");
/**
* The subMonths function options.
*/
/**
* @name subMonths
* @category Month Helpers
* @summary Subtract the specified number of months from the given date.
*
* @description
* Subtract the specified number of months from the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @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 amount - The amount of months to be subtracted.
* @param options - An object with options
*
* @returns The new date with the months subtracted
*
* @example
* // Subtract 5 months from 1 February 2015:
* const result = subMonths(new Date(2015, 1, 1), 5)
* //=> Mon Sep 01 2014 00:00:00
*/
function subMonths(date, amount, options) {
return (0, _index.addMonths)(date, -amount, options);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"sdk-info.js","sourceRoot":"","sources":["../../../../src/platform/browser/sdk-info.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2CAAwC;AACxC,8EAK6C;AAC7C,2CAA0D;AAE1D,0CAA0C;AAC7B,QAAA,QAAQ,GAAG;IACtB,CAAC,8CAAuB,CAAC,EAAE,eAAe;IAC1C,CAAC,mCAAyB,CAAC,EAAE,SAAS;IACtC,CAAC,kDAA2B,CAAC,EAAE,yDAAkC;IACjE,CAAC,iDAA0B,CAAC,EAAE,iBAAO;CACtC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { VERSION } from '../../version';\nimport {\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { ATTR_PROCESS_RUNTIME_NAME } from '../../semconv';\n\n/** Constants describing the SDK in use */\nexport const SDK_INFO = {\n [ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',\n [ATTR_PROCESS_RUNTIME_NAME]: 'browser',\n [ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,\n [ATTR_TELEMETRY_SDK_VERSION]: VERSION,\n};\n"]}

View File

@@ -0,0 +1,25 @@
var arrayPush = require('./_arrayPush'),
getPrototype = require('./_getPrototype'),
getSymbols = require('./_getSymbols'),
stubArray = require('./stubArray');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;

View File

@@ -0,0 +1 @@
export type MarkRequired<Type, Keys extends keyof Type> = Type extends Type ? Type & Required<Pick<Type, Keys>> : never;

View File

@@ -0,0 +1,444 @@
'use strict'
const { Writable } = require('node:stream')
const assert = require('node:assert')
const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require('./constants')
const {
isValidStatusCode,
isValidOpcode,
websocketMessageReceived,
utf8Decode,
isControlFrame,
isTextBinaryFrame,
isContinuationFrame
} = require('./util')
const { failWebsocketConnection } = require('./connection')
const { WebsocketFrameSend } = require('./frame')
const { PerMessageDeflate } = require('./permessage-deflate')
// This code was influenced by ws released under the MIT license.
// Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
// Copyright (c) 2013 Arnout Kazemier and contributors
// Copyright (c) 2016 Luigi Pinca and contributors
class ByteParser extends Writable {
#buffers = []
#fragmentsBytes = 0
#byteOffset = 0
#loop = false
#state = parserStates.INFO
#info = {}
#fragments = []
/** @type {Map<string, PerMessageDeflate>} */
#extensions
/** @type {import('./websocket').Handler} */
#handler
constructor (handler, extensions) {
super()
this.#handler = handler
this.#extensions = extensions == null ? new Map() : extensions
if (this.#extensions.has('permessage-deflate')) {
this.#extensions.set('permessage-deflate', new PerMessageDeflate(extensions))
}
}
/**
* @param {Buffer} chunk
* @param {() => void} callback
*/
_write (chunk, _, callback) {
this.#buffers.push(chunk)
this.#byteOffset += chunk.length
this.#loop = true
this.run(callback)
}
/**
* Runs whenever a new chunk is received.
* Callback is called whenever there are no more chunks buffering,
* or not enough bytes are buffered to parse.
*/
run (callback) {
while (this.#loop) {
if (this.#state === parserStates.INFO) {
// If there aren't enough bytes to parse the payload length, etc.
if (this.#byteOffset < 2) {
return callback()
}
const buffer = this.consume(2)
const fin = (buffer[0] & 0x80) !== 0
const opcode = buffer[0] & 0x0F
const masked = (buffer[1] & 0x80) === 0x80
const fragmented = !fin && opcode !== opcodes.CONTINUATION
const payloadLength = buffer[1] & 0x7F
const rsv1 = buffer[0] & 0x40
const rsv2 = buffer[0] & 0x20
const rsv3 = buffer[0] & 0x10
if (!isValidOpcode(opcode)) {
failWebsocketConnection(this.#handler, 1002, 'Invalid opcode received')
return callback()
}
if (masked) {
failWebsocketConnection(this.#handler, 1002, 'Frame cannot be masked')
return callback()
}
// MUST be 0 unless an extension is negotiated that defines meanings
// for non-zero values. If a nonzero value is received and none of
// the negotiated extensions defines the meaning of such a nonzero
// value, the receiving endpoint MUST _Fail the WebSocket
// Connection_.
// This document allocates the RSV1 bit of the WebSocket header for
// PMCEs and calls the bit the "Per-Message Compressed" bit. On a
// WebSocket connection where a PMCE is in use, this bit indicates
// whether a message is compressed or not.
if (rsv1 !== 0 && !this.#extensions.has('permessage-deflate')) {
failWebsocketConnection(this.#handler, 1002, 'Expected RSV1 to be clear.')
return
}
if (rsv2 !== 0 || rsv3 !== 0) {
failWebsocketConnection(this.#handler, 1002, 'RSV1, RSV2, RSV3 must be clear')
return
}
if (fragmented && !isTextBinaryFrame(opcode)) {
// Only text and binary frames can be fragmented
failWebsocketConnection(this.#handler, 1002, 'Invalid frame type was fragmented.')
return
}
// If we are already parsing a text/binary frame and do not receive either
// a continuation frame or close frame, fail the connection.
if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) {
failWebsocketConnection(this.#handler, 1002, 'Expected continuation frame')
return
}
if (this.#info.fragmented && fragmented) {
// A fragmented frame can't be fragmented itself
failWebsocketConnection(this.#handler, 1002, 'Fragmented frame exceeded 125 bytes.')
return
}
// "All control frames MUST have a payload length of 125 bytes or less
// and MUST NOT be fragmented."
if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) {
failWebsocketConnection(this.#handler, 1002, 'Control frame either too large or fragmented')
return
}
if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {
failWebsocketConnection(this.#handler, 1002, 'Unexpected continuation frame')
return
}
if (payloadLength <= 125) {
this.#info.payloadLength = payloadLength
this.#state = parserStates.READ_DATA
} else if (payloadLength === 126) {
this.#state = parserStates.PAYLOADLENGTH_16
} else if (payloadLength === 127) {
this.#state = parserStates.PAYLOADLENGTH_64
}
if (isTextBinaryFrame(opcode)) {
this.#info.binaryType = opcode
this.#info.compressed = rsv1 !== 0
}
this.#info.opcode = opcode
this.#info.masked = masked
this.#info.fin = fin
this.#info.fragmented = fragmented
} else if (this.#state === parserStates.PAYLOADLENGTH_16) {
if (this.#byteOffset < 2) {
return callback()
}
const buffer = this.consume(2)
this.#info.payloadLength = buffer.readUInt16BE(0)
this.#state = parserStates.READ_DATA
} else if (this.#state === parserStates.PAYLOADLENGTH_64) {
if (this.#byteOffset < 8) {
return callback()
}
const buffer = this.consume(8)
const upper = buffer.readUInt32BE(0)
// 2^31 is the maximum bytes an arraybuffer can contain
// on 32-bit systems. Although, on 64-bit systems, this is
// 2^53-1 bytes.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
// https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
// https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
if (upper > 2 ** 31 - 1) {
failWebsocketConnection(this.#handler, 1009, 'Received payload length > 2^31 bytes.')
return
}
const lower = buffer.readUInt32BE(4)
this.#info.payloadLength = (upper << 8) + lower
this.#state = parserStates.READ_DATA
} else if (this.#state === parserStates.READ_DATA) {
if (this.#byteOffset < this.#info.payloadLength) {
return callback()
}
const body = this.consume(this.#info.payloadLength)
if (isControlFrame(this.#info.opcode)) {
this.#loop = this.parseControlFrame(body)
this.#state = parserStates.INFO
} else {
if (!this.#info.compressed) {
this.writeFragments(body)
// If the frame is not fragmented, a message has been received.
// If the frame is fragmented, it will terminate with a fin bit set
// and an opcode of 0 (continuation), therefore we handle that when
// parsing continuation frames, not here.
if (!this.#info.fragmented && this.#info.fin) {
websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments())
}
this.#state = parserStates.INFO
} else {
this.#extensions.get('permessage-deflate').decompress(body, this.#info.fin, (error, data) => {
if (error) {
failWebsocketConnection(this.#handler, 1007, error.message)
return
}
this.writeFragments(data)
if (!this.#info.fin) {
this.#state = parserStates.INFO
this.#loop = true
this.run(callback)
return
}
websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments())
this.#loop = true
this.#state = parserStates.INFO
this.run(callback)
})
this.#loop = false
break
}
}
}
}
}
/**
* Take n bytes from the buffered Buffers
* @param {number} n
* @returns {Buffer}
*/
consume (n) {
if (n > this.#byteOffset) {
throw new Error('Called consume() before buffers satiated.')
} else if (n === 0) {
return emptyBuffer
}
this.#byteOffset -= n
const first = this.#buffers[0]
if (first.length > n) {
// replace with remaining buffer
this.#buffers[0] = first.subarray(n, first.length)
return first.subarray(0, n)
} else if (first.length === n) {
// prefect match
return this.#buffers.shift()
} else {
let offset = 0
// If Buffer.allocUnsafe is used, extra copies will be made because the offset is non-zero.
const buffer = Buffer.allocUnsafeSlow(n)
while (offset !== n) {
const next = this.#buffers[0]
const length = next.length
if (length + offset === n) {
buffer.set(this.#buffers.shift(), offset)
break
} else if (length + offset > n) {
buffer.set(next.subarray(0, n - offset), offset)
this.#buffers[0] = next.subarray(n - offset)
break
} else {
buffer.set(this.#buffers.shift(), offset)
offset += length
}
}
return buffer
}
}
writeFragments (fragment) {
this.#fragmentsBytes += fragment.length
this.#fragments.push(fragment)
}
consumeFragments () {
const fragments = this.#fragments
if (fragments.length === 1) {
// single fragment
this.#fragmentsBytes = 0
return fragments.shift()
}
let offset = 0
// If Buffer.allocUnsafe is used, extra copies will be made because the offset is non-zero.
const output = Buffer.allocUnsafeSlow(this.#fragmentsBytes)
for (let i = 0; i < fragments.length; ++i) {
const buffer = fragments[i]
output.set(buffer, offset)
offset += buffer.length
}
this.#fragments = []
this.#fragmentsBytes = 0
return output
}
parseCloseBody (data) {
assert(data.length !== 1)
// https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
/** @type {number|undefined} */
let code
if (data.length >= 2) {
// _The WebSocket Connection Close Code_ is
// defined as the status code (Section 7.4) contained in the first Close
// control frame received by the application
code = data.readUInt16BE(0)
}
if (code !== undefined && !isValidStatusCode(code)) {
return { code: 1002, reason: 'Invalid status code', error: true }
}
// https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
/** @type {Buffer} */
let reason = data.subarray(2)
// Remove BOM
if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
reason = reason.subarray(3)
}
try {
reason = utf8Decode(reason)
} catch {
return { code: 1007, reason: 'Invalid UTF-8', error: true }
}
return { code, reason, error: false }
}
/**
* Parses control frames.
* @param {Buffer} body
*/
parseControlFrame (body) {
const { opcode, payloadLength } = this.#info
if (opcode === opcodes.CLOSE) {
if (payloadLength === 1) {
failWebsocketConnection(this.#handler, 1002, 'Received close frame with a 1-byte body.')
return false
}
this.#info.closeInfo = this.parseCloseBody(body)
if (this.#info.closeInfo.error) {
const { code, reason } = this.#info.closeInfo
failWebsocketConnection(this.#handler, code, reason)
return false
}
// Upon receiving such a frame, the other peer sends a
// Close frame in response, if it hasn't already sent one.
if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
// If an endpoint receives a Close frame and did not previously send a
// Close frame, the endpoint MUST send a Close frame in response. (When
// sending a Close frame in response, the endpoint typically echos the
// status code it received.)
let body = emptyBuffer
if (this.#info.closeInfo.code) {
body = Buffer.allocUnsafe(2)
body.writeUInt16BE(this.#info.closeInfo.code, 0)
}
const closeFrame = new WebsocketFrameSend(body)
this.#handler.socket.write(closeFrame.createFrame(opcodes.CLOSE))
this.#handler.closeState.add(sentCloseFrameState.SENT)
}
// Upon either sending or receiving a Close control frame, it is said
// that _The WebSocket Closing Handshake is Started_ and that the
// WebSocket connection is in the CLOSING state.
this.#handler.readyState = states.CLOSING
this.#handler.closeState.add(sentCloseFrameState.RECEIVED)
return false
} else if (opcode === opcodes.PING) {
// Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
// response, unless it already received a Close frame.
// A Pong frame sent in response to a Ping frame must have identical
// "Application data"
if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
const frame = new WebsocketFrameSend(body)
this.#handler.socket.write(frame.createFrame(opcodes.PONG))
this.#handler.onPing(body)
}
} else if (opcode === opcodes.PONG) {
// A Pong frame MAY be sent unsolicited. This serves as a
// unidirectional heartbeat. A response to an unsolicited Pong frame is
// not expected.
this.#handler.onPong(body)
}
return true
}
get closingInfo () {
return this.#info.closeInfo
}
}
module.exports = {
ByteParser
}

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