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 @@
{"version":3,"sources":["../../src/mysql2/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}

View File

@@ -0,0 +1,30 @@
import { formatDistance } from "./sv/_lib/formatDistance.mjs";
import { formatLong } from "./sv/_lib/formatLong.mjs";
import { formatRelative } from "./sv/_lib/formatRelative.mjs";
import { localize } from "./sv/_lib/localize.mjs";
import { match } from "./sv/_lib/match.mjs";
/**
* @category Locales
* @summary Swedish locale.
* @language Swedish
* @iso-639-2 swe
* @author Johannes Ulén [@ejulen](https://github.com/ejulen)
* @author Alexander Nanberg [@alexandernanberg](https://github.com/alexandernanberg)
* @author Henrik Andersson [@limelights](https://github.com/limelights)
*/
export const sv = {
code: "sv",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default sv;

View File

@@ -0,0 +1 @@
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/locked-documents/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAIhD,eAAO,MAAM,6BAA6B,6BAA6B,CAAA;AAEvE,eAAO,MAAM,4BAA4B,WAAY,MAAM,KAAG,gBAAgB,GAAG,IAmEhF,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_checkPrivateRedeclaration","require","_classPrivateMethodInitSpec","obj","privateSet","checkPrivateRedeclaration","add"],"sources":["../../src/helpers/classPrivateMethodInitSpec.ts"],"sourcesContent":["/* @minVersion 7.14.1 */\n\nimport checkPrivateRedeclaration from \"./checkPrivateRedeclaration.ts\";\n\nexport default function _classPrivateMethodInitSpec(\n obj: object,\n privateSet: WeakSet<object>,\n) {\n checkPrivateRedeclaration(obj, privateSet);\n privateSet.add(obj);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,0BAAA,GAAAC,OAAA;AAEe,SAASC,2BAA2BA,CACjDC,GAAW,EACXC,UAA2B,EAC3B;EACA,IAAAC,kCAAyB,EAACF,GAAG,EAAEC,UAAU,CAAC;EAC1CA,UAAU,CAACE,GAAG,CAACH,GAAG,CAAC;AACrB","ignoreList":[]}

View File

@@ -0,0 +1,34 @@
var ListCache = require('./_ListCache'),
Map = require('./_Map'),
MapCache = require('./_MapCache');
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
module.exports = stackSet;

View File

@@ -0,0 +1,92 @@
import type { FormatDistanceOptions } from "./formatDistance.js";
/**
* The {@link formatDistanceToNow} function options.
*/
export interface FormatDistanceToNowOptions extends FormatDistanceOptions {}
/**
* @name formatDistanceToNow
* @category Common Helpers
* @summary Return the distance between the given date and now in words.
* @pure false
*
* @description
* Return the distance between the given date and now in words.
*
* | Distance to now | Result |
* |-------------------------------------------------------------------|---------------------|
* | 0 ... 30 secs | less than a minute |
* | 30 secs ... 1 min 30 secs | 1 minute |
* | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |
* | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |
* | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |
* | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |
* | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |
* | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |
* | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |
* | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |
* | 1 yr ... 1 yr 3 months | about 1 year |
* | 1 yr 3 months ... 1 yr 9 month s | over 1 year |
* | 1 yr 9 months ... 2 yrs | almost 2 years |
* | N yrs ... N yrs 3 months | about N years |
* | N yrs 3 months ... N yrs 9 months | over N years |
* | N yrs 9 months ... N+1 yrs | almost N+1 years |
*
* With `options.includeSeconds == true`:
* | Distance to now | Result |
* |---------------------|----------------------|
* | 0 secs ... 5 secs | less than 5 seconds |
* | 5 secs ... 10 secs | less than 10 seconds |
* | 10 secs ... 20 secs | less than 20 seconds |
* | 20 secs ... 40 secs | half a minute |
* | 40 secs ... 60 secs | less than a minute |
* | 60 secs ... 90 secs | 1 minute |
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
* @param options - The object with options
*
* @returns The distance in words
*
* @throws `date` must not be Invalid Date
* @throws `options.locale` must contain `formatDistance` property
*
* @example
* // If today is 1 January 2015, what is the distance to 2 July 2014?
* const result = formatDistanceToNow(
* new Date(2014, 6, 2)
* )
* //=> '6 months'
*
* @example
* // If now is 1 January 2015 00:00:00,
* // what is the distance to 1 January 2015 00:00:15, including seconds?
* const result = formatDistanceToNow(
* new Date(2015, 0, 1, 0, 0, 15),
* {includeSeconds: true}
* )
* //=> 'less than 20 seconds'
*
* @example
* // If today is 1 January 2015,
* // what is the distance to 1 January 2016, with a suffix?
* const result = formatDistanceToNow(
* new Date(2016, 0, 1),
* {addSuffix: true}
* )
* //=> 'in about 1 year'
*
* @example
* // If today is 1 January 2015,
* // what is the distance to 1 August 2016 in Esperanto?
* const eoLocale = require('date-fns/locale/eo')
* const result = formatDistanceToNow(
* new Date(2016, 7, 1),
* {locale: eoLocale}
* )
* //=> 'pli ol 1 jaro'
*/
export declare function formatDistanceToNow<DateType extends Date>(
date: DateType | number | string,
options?: FormatDistanceToNowOptions,
): string;

View File

@@ -0,0 +1,146 @@
import type { MySqlColumn } from "../columns/index.cjs";
import type { MySqlTable, MySqlTableWithColumns } from "../table.cjs";
import type { SelectedFields as SelectedFieldsBase, SelectedFieldsFlat as SelectedFieldsFlatBase, SelectedFieldsOrdered as SelectedFieldsOrderedBase } from "../../operations.cjs";
import type { TypedQueryBuilder } from "../../query-builders/query-builder.cjs";
import type { AppendToNullabilityMap, AppendToResult, BuildSubquerySelection, GetSelectTableName, JoinNullability, JoinType, MapColumnsToTableAlias, SelectMode, SelectResult, SetOperator } from "../../query-builders/select.types.cjs";
import type { ColumnsSelection, Placeholder, SQL, View } from "../../sql/sql.cjs";
import type { Subquery } from "../../subquery.cjs";
import type { Table, UpdateTableConfig } from "../../table.cjs";
import type { Assume, ValidateShape } from "../../utils.cjs";
import type { MySqlPreparedQueryConfig, PreparedQueryHKTBase, PreparedQueryKind } from "../session.cjs";
import type { MySqlViewBase } from "../view-base.cjs";
import type { MySqlViewWithSelection } from "../view.cjs";
import type { IndexConfig, MySqlSelectBase, MySqlSelectQueryBuilderBase } from "./select.cjs";
export type MySqlJoinType = Exclude<JoinType, 'full'>;
export interface MySqlSelectJoinConfig {
on: SQL | undefined;
table: MySqlTable | Subquery | MySqlViewBase | SQL;
alias: string | undefined;
joinType: MySqlJoinType;
lateral?: boolean;
useIndex?: string[];
forceIndex?: string[];
ignoreIndex?: string[];
}
export type BuildAliasTable<TTable extends MySqlTable | View, TAlias extends string> = TTable extends Table ? MySqlTableWithColumns<UpdateTableConfig<TTable['_']['config'], {
name: TAlias;
columns: MapColumnsToTableAlias<TTable['_']['columns'], TAlias, 'mysql'>;
}>> : TTable extends View ? MySqlViewWithSelection<TAlias, TTable['_']['existing'], MapColumnsToTableAlias<TTable['_']['selectedFields'], TAlias, 'mysql'>> : never;
export interface MySqlSelectConfig {
withList?: Subquery[];
fields: Record<string, unknown>;
fieldsFlat?: SelectedFieldsOrdered;
where?: SQL;
having?: SQL;
table: MySqlTable | Subquery | MySqlViewBase | SQL;
limit?: number | Placeholder;
offset?: number | Placeholder;
joins?: MySqlSelectJoinConfig[];
orderBy?: (MySqlColumn | SQL | SQL.Aliased)[];
groupBy?: (MySqlColumn | SQL | SQL.Aliased)[];
lockingClause?: {
strength: LockStrength;
config: LockConfig;
};
distinct?: boolean;
setOperators: {
rightSelect: TypedQueryBuilder<any, any>;
type: SetOperator;
isAll: boolean;
orderBy?: (MySqlColumn | SQL | SQL.Aliased)[];
limit?: number | Placeholder;
offset?: number | Placeholder;
}[];
useIndex?: string[];
forceIndex?: string[];
ignoreIndex?: string[];
}
export type MySqlJoin<T extends AnyMySqlSelectQueryBuilder, TDynamic extends boolean, TJoinType extends MySqlJoinType, TJoinedTable extends MySqlTable | Subquery | MySqlViewBase | SQL, TJoinedName extends GetSelectTableName<TJoinedTable> = GetSelectTableName<TJoinedTable>> = T extends any ? MySqlSelectWithout<MySqlSelectKind<T['_']['hkt'], T['_']['tableName'], AppendToResult<T['_']['tableName'], T['_']['selection'], TJoinedName, TJoinedTable extends MySqlTable ? TJoinedTable['_']['columns'] : TJoinedTable extends Subquery | View ? Assume<TJoinedTable['_']['selectedFields'], SelectedFields> : never, T['_']['selectMode']>, T['_']['selectMode'] extends 'partial' ? T['_']['selectMode'] : 'multiple', T['_']['preparedQueryHKT'], AppendToNullabilityMap<T['_']['nullabilityMap'], TJoinedName, TJoinType>, TDynamic, T['_']['excludedMethods']>, TDynamic, T['_']['excludedMethods']> : never;
export type MySqlJoinFn<T extends AnyMySqlSelectQueryBuilder, TDynamic extends boolean, TJoinType extends MySqlJoinType, TIsLateral extends boolean> = <TJoinedTable extends (TIsLateral extends true ? Subquery | SQL : MySqlTable | Subquery | MySqlViewBase | SQL), TJoinedName extends GetSelectTableName<TJoinedTable> = GetSelectTableName<TJoinedTable>>(table: TJoinedTable, on: ((aliases: T['_']['selection']) => SQL | undefined) | SQL | undefined, onIndex?: (TJoinedTable extends MySqlTable ? IndexConfig : 'Index hint configuration is allowed only for MySqlTable and not for subqueries or views') | undefined) => MySqlJoin<T, TDynamic, TJoinType, TJoinedTable, TJoinedName>;
export type MySqlCrossJoinFn<T extends AnyMySqlSelectQueryBuilder, TDynamic extends boolean, TIsLateral extends boolean> = <TJoinedTable extends (TIsLateral extends true ? Subquery | SQL : MySqlTable | Subquery | MySqlViewBase | SQL), TJoinedName extends GetSelectTableName<TJoinedTable> = GetSelectTableName<TJoinedTable>>(table: TJoinedTable, onIndex?: (TJoinedTable extends MySqlTable ? IndexConfig : 'Index hint configuration is allowed only for MySqlTable and not for subqueries or views') | undefined) => MySqlJoin<T, TDynamic, 'cross', TJoinedTable, TJoinedName>;
export type SelectedFieldsFlat = SelectedFieldsFlatBase<MySqlColumn>;
export type SelectedFields = SelectedFieldsBase<MySqlColumn, MySqlTable>;
export type SelectedFieldsOrdered = SelectedFieldsOrderedBase<MySqlColumn>;
export type LockStrength = 'update' | 'share';
export type LockConfig = {
noWait: true;
skipLocked?: undefined;
} | {
noWait?: undefined;
skipLocked: true;
} | {
noWait?: undefined;
skipLocked?: undefined;
};
export interface MySqlSelectHKTBase {
tableName: string | undefined;
selection: unknown;
selectMode: SelectMode;
preparedQueryHKT: unknown;
nullabilityMap: unknown;
dynamic: boolean;
excludedMethods: string;
result: unknown;
selectedFields: unknown;
_type: unknown;
}
export type MySqlSelectKind<T extends MySqlSelectHKTBase, TTableName extends string | undefined, TSelection extends ColumnsSelection, TSelectMode extends SelectMode, TPreparedQueryHKT extends PreparedQueryHKTBase, TNullabilityMap extends Record<string, JoinNullability>, TDynamic extends boolean, TExcludedMethods extends string, TResult = SelectResult<TSelection, TSelectMode, TNullabilityMap>[], TSelectedFields = BuildSubquerySelection<TSelection, TNullabilityMap>> = (T & {
tableName: TTableName;
selection: TSelection;
selectMode: TSelectMode;
preparedQueryHKT: TPreparedQueryHKT;
nullabilityMap: TNullabilityMap;
dynamic: TDynamic;
excludedMethods: TExcludedMethods;
result: TResult;
selectedFields: TSelectedFields;
})['_type'];
export interface MySqlSelectQueryBuilderHKT extends MySqlSelectHKTBase {
_type: MySqlSelectQueryBuilderBase<MySqlSelectQueryBuilderHKT, this['tableName'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['preparedQueryHKT'], PreparedQueryHKTBase>, Assume<this['nullabilityMap'], Record<string, JoinNullability>>, this['dynamic'], this['excludedMethods'], Assume<this['result'], any[]>, Assume<this['selectedFields'], ColumnsSelection>>;
}
export interface MySqlSelectHKT extends MySqlSelectHKTBase {
_type: MySqlSelectBase<this['tableName'], Assume<this['selection'], ColumnsSelection>, this['selectMode'], Assume<this['preparedQueryHKT'], PreparedQueryHKTBase>, Assume<this['nullabilityMap'], Record<string, JoinNullability>>, this['dynamic'], this['excludedMethods'], Assume<this['result'], any[]>, Assume<this['selectedFields'], ColumnsSelection>>;
}
export type MySqlSetOperatorExcludedMethods = 'where' | 'having' | 'groupBy' | 'session' | 'leftJoin' | 'rightJoin' | 'innerJoin' | 'for';
export type MySqlSelectWithout<T extends AnyMySqlSelectQueryBuilder, TDynamic extends boolean, K extends keyof T & string, TResetExcluded extends boolean = false> = TDynamic extends true ? T : Omit<MySqlSelectKind<T['_']['hkt'], T['_']['tableName'], T['_']['selection'], T['_']['selectMode'], T['_']['preparedQueryHKT'], T['_']['nullabilityMap'], TDynamic, TResetExcluded extends true ? K : T['_']['excludedMethods'] | K, T['_']['result'], T['_']['selectedFields']>, TResetExcluded extends true ? K : T['_']['excludedMethods'] | K>;
export type MySqlSelectPrepare<T extends AnyMySqlSelect> = PreparedQueryKind<T['_']['preparedQueryHKT'], MySqlPreparedQueryConfig & {
execute: T['_']['result'];
iterator: T['_']['result'][number];
}, true>;
export type MySqlSelectDynamic<T extends AnyMySqlSelectQueryBuilder> = MySqlSelectKind<T['_']['hkt'], T['_']['tableName'], T['_']['selection'], T['_']['selectMode'], T['_']['preparedQueryHKT'], T['_']['nullabilityMap'], true, never, T['_']['result'], T['_']['selectedFields']>;
export type CreateMySqlSelectFromBuilderMode<TBuilderMode extends 'db' | 'qb', TTableName extends string | undefined, TSelection extends ColumnsSelection, TSelectMode extends SelectMode, TPreparedQueryHKT extends PreparedQueryHKTBase> = TBuilderMode extends 'db' ? MySqlSelectBase<TTableName, TSelection, TSelectMode, TPreparedQueryHKT> : MySqlSelectQueryBuilderBase<MySqlSelectQueryBuilderHKT, TTableName, TSelection, TSelectMode, TPreparedQueryHKT>;
export type MySqlSelectQueryBuilder<THKT extends MySqlSelectHKTBase = MySqlSelectQueryBuilderHKT, TTableName extends string | undefined = string | undefined, TSelection extends ColumnsSelection = ColumnsSelection, TSelectMode extends SelectMode = SelectMode, TPreparedQueryHKT extends PreparedQueryHKTBase = PreparedQueryHKTBase, TNullabilityMap extends Record<string, JoinNullability> = Record<string, JoinNullability>, TResult extends any[] = unknown[], TSelectedFields extends ColumnsSelection = ColumnsSelection> = MySqlSelectQueryBuilderBase<THKT, TTableName, TSelection, TSelectMode, TPreparedQueryHKT, TNullabilityMap, true, never, TResult, TSelectedFields>;
export type AnyMySqlSelectQueryBuilder = MySqlSelectQueryBuilderBase<any, any, any, any, any, any, any, any, any>;
export type AnyMySqlSetOperatorInterface = MySqlSetOperatorInterface<any, any, any, any, any, any, any, any, any>;
export interface MySqlSetOperatorInterface<TTableName extends string | undefined, TSelection extends ColumnsSelection, TSelectMode extends SelectMode, TPreparedQueryHKT extends PreparedQueryHKTBase = PreparedQueryHKTBase, TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}, TDynamic extends boolean = false, TExcludedMethods extends string = never, TResult extends any[] = SelectResult<TSelection, TSelectMode, TNullabilityMap>[], TSelectedFields extends ColumnsSelection = BuildSubquerySelection<TSelection, TNullabilityMap>> {
_: {
readonly hkt: MySqlSelectHKT;
readonly tableName: TTableName;
readonly selection: TSelection;
readonly selectMode: TSelectMode;
readonly preparedQueryHKT: TPreparedQueryHKT;
readonly nullabilityMap: TNullabilityMap;
readonly dynamic: TDynamic;
readonly excludedMethods: TExcludedMethods;
readonly result: TResult;
readonly selectedFields: TSelectedFields;
};
}
export type MySqlSetOperatorWithResult<TResult extends any[]> = MySqlSetOperatorInterface<any, any, any, any, any, any, any, TResult, any>;
export type MySqlSelect<TTableName extends string | undefined = string | undefined, TSelection extends ColumnsSelection = Record<string, any>, TSelectMode extends SelectMode = SelectMode, TNullabilityMap extends Record<string, JoinNullability> = Record<string, JoinNullability>> = MySqlSelectBase<TTableName, TSelection, TSelectMode, PreparedQueryHKTBase, TNullabilityMap, true, never>;
export type AnyMySqlSelect = MySqlSelectBase<any, any, any, any, any, any, any, any>;
export type MySqlSetOperator<TTableName extends string | undefined = string | undefined, TSelection extends ColumnsSelection = Record<string, any>, TSelectMode extends SelectMode = SelectMode, TPreparedQueryHKT extends PreparedQueryHKTBase = PreparedQueryHKTBase, TNullabilityMap extends Record<string, JoinNullability> = Record<string, JoinNullability>> = MySqlSelectBase<TTableName, TSelection, TSelectMode, TPreparedQueryHKT, TNullabilityMap, true, MySqlSetOperatorExcludedMethods>;
export type SetOperatorRightSelect<TValue extends MySqlSetOperatorWithResult<TResult>, TResult extends any[]> = TValue extends MySqlSetOperatorInterface<any, any, any, any, any, any, any, infer TValueResult, any> ? ValidateShape<TValueResult[number], TResult[number], TypedQueryBuilder<any, TValueResult>> : TValue;
export type SetOperatorRestSelect<TValue extends readonly MySqlSetOperatorWithResult<TResult>[], TResult extends any[]> = TValue extends [infer First, ...infer Rest] ? First extends MySqlSetOperatorInterface<any, any, any, any, any, any, any, infer TValueResult, any> ? Rest extends AnyMySqlSetOperatorInterface[] ? [
ValidateShape<TValueResult[number], TResult[number], TypedQueryBuilder<any, TValueResult>>,
...SetOperatorRestSelect<Rest, TResult>
] : ValidateShape<TValueResult[number], TResult[number], TypedQueryBuilder<any, TValueResult>[]> : never : TValue;
export type MySqlCreateSetOperatorFn = <TTableName extends string | undefined, TSelection extends ColumnsSelection, TSelectMode extends SelectMode, TValue extends MySqlSetOperatorWithResult<TResult>, TRest extends MySqlSetOperatorWithResult<TResult>[], TPreparedQueryHKT extends PreparedQueryHKTBase = PreparedQueryHKTBase, TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}, TDynamic extends boolean = false, TExcludedMethods extends string = never, TResult extends any[] = SelectResult<TSelection, TSelectMode, TNullabilityMap>[], TSelectedFields extends ColumnsSelection = BuildSubquerySelection<TSelection, TNullabilityMap>>(leftSelect: MySqlSetOperatorInterface<TTableName, TSelection, TSelectMode, TPreparedQueryHKT, TNullabilityMap, TDynamic, TExcludedMethods, TResult, TSelectedFields>, rightSelect: SetOperatorRightSelect<TValue, TResult>, ...restSelects: SetOperatorRestSelect<TRest, TResult>) => MySqlSelectWithout<MySqlSelectBase<TTableName, TSelection, TSelectMode, TPreparedQueryHKT, TNullabilityMap, TDynamic, TExcludedMethods, TResult, TSelectedFields>, false, MySqlSetOperatorExcludedMethods, true>;
export type GetMySqlSetOperators = {
union: MySqlCreateSetOperatorFn;
intersect: MySqlCreateSetOperatorFn;
except: MySqlCreateSetOperatorFn;
unionAll: MySqlCreateSetOperatorFn;
intersectAll: MySqlCreateSetOperatorFn;
exceptAll: MySqlCreateSetOperatorFn;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"alert-triangle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"names":["auxiliaryComment","message","blacklist","breakConfig","experimental","externalHelpers","extra","jsxPragma","loose","metadataUsedHelpers","modules","nonStandard","optional","sourceMapName","stage","whitelist","resolveModuleSource","version","metadata","sourceMapTarget"],"sources":["../../../src/config/validation/removed.ts"],"sourcesContent":["export default {\n auxiliaryComment: {\n message: \"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`\",\n },\n blacklist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n breakConfig: {\n message: \"This is not a necessary option in Babel 6\",\n },\n experimental: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n externalHelpers: {\n message:\n \"Use the `external-helpers` plugin instead. \" +\n \"Check out http://babeljs.io/docs/plugins/external-helpers/\",\n },\n extra: {\n message: \"\",\n },\n jsxPragma: {\n message:\n \"use the `pragma` option in the `react-jsx` plugin. \" +\n \"Check out http://babeljs.io/docs/plugins/transform-react-jsx/\",\n },\n loose: {\n message:\n \"Specify the `loose` option for the relevant plugin you are using \" +\n \"or use a preset that sets the option.\",\n },\n metadataUsedHelpers: {\n message: \"Not required anymore as this is enabled by default\",\n },\n modules: {\n message:\n \"Use the corresponding module transform plugin in the `plugins` option. \" +\n \"Check out http://babeljs.io/docs/plugins/#modules\",\n },\n nonStandard: {\n message:\n \"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. \" +\n \"Also check out the react preset http://babeljs.io/docs/plugins/preset-react/\",\n },\n optional: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n sourceMapName: {\n message:\n \"The `sourceMapName` option has been removed because it makes more sense for the \" +\n \"tooling that calls Babel to assign `map.file` themselves.\",\n },\n stage: {\n message:\n \"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets\",\n },\n whitelist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n\n resolveModuleSource: {\n version: 6,\n message: \"Use `babel-plugin-module-resolver@3`'s 'resolvePath' options\",\n },\n metadata: {\n version: 6,\n message:\n \"Generated plugin metadata is always included in the output result\",\n },\n sourceMapTarget: {\n version: 6,\n message:\n \"The `sourceMapTarget` option has been removed because it makes more sense for the tooling \" +\n \"that calls Babel to assign `map.file` themselves.\",\n },\n} as Record<string, { version?: number; message: string }>;\n"],"mappings":";;;;;;iCAAe;EACbA,gBAAgB,EAAE;IAChBC,OAAO,EAAE;EACX,CAAC;EACDC,SAAS,EAAE;IACTD,OAAO,EAAE;EACX,CAAC;EACDE,WAAW,EAAE;IACXF,OAAO,EAAE;EACX,CAAC;EACDG,YAAY,EAAE;IACZH,OAAO,EAAE;EACX,CAAC;EACDI,eAAe,EAAE;IACfJ,OAAO,EACL,6CAA6C,GAC7C;EACJ,CAAC;EACDK,KAAK,EAAE;IACLL,OAAO,EAAE;EACX,CAAC;EACDM,SAAS,EAAE;IACTN,OAAO,EACL,qDAAqD,GACrD;EACJ,CAAC;EACDO,KAAK,EAAE;IACLP,OAAO,EACL,mEAAmE,GACnE;EACJ,CAAC;EACDQ,mBAAmB,EAAE;IACnBR,OAAO,EAAE;EACX,CAAC;EACDS,OAAO,EAAE;IACPT,OAAO,EACL,yEAAyE,GACzE;EACJ,CAAC;EACDU,WAAW,EAAE;IACXV,OAAO,EACL,8EAA8E,GAC9E;EACJ,CAAC;EACDW,QAAQ,EAAE;IACRX,OAAO,EAAE;EACX,CAAC;EACDY,aAAa,EAAE;IACbZ,OAAO,EACL,kFAAkF,GAClF;EACJ,CAAC;EACDa,KAAK,EAAE;IACLb,OAAO,EACL;EACJ,CAAC;EACDc,SAAS,EAAE;IACTd,OAAO,EAAE;EACX,CAAC;EAEDe,mBAAmB,EAAE;IACnBC,OAAO,EAAE,CAAC;IACVhB,OAAO,EAAE;EACX,CAAC;EACDiB,QAAQ,EAAE;IACRD,OAAO,EAAE,CAAC;IACVhB,OAAO,EACL;EACJ,CAAC;EACDkB,eAAe,EAAE;IACfF,OAAO,EAAE,CAAC;IACVhB,OAAO,EACL,4FAA4F,GAC5F;EACJ;AACF,CAAC;AAAA","ignoreList":[]}

View File

@@ -0,0 +1,140 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(پ|د)/i,
abbreviated: /^(پ-ز|د.ز)/i,
wide: /^(پێش زاین| دوای زاین)/i,
};
const parseEraPatterns = {
any: [/^د/g, /^پ/g],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^م[1234]چ/i,
wide: /^(یەکەم|دووەم|سێیەم| چوارەم) (چارەگی)? quarter/i,
};
const parseQuarterPatterns = {
wide: [/چارەگی یەکەم/, /چارەگی دووەم/, /چارەگی سيیەم/, /چارەگی چوارەم/],
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: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const matchDayPeriodPatterns = {
narrow: /^(پ|د|ن-ش|ن| (بەیانی|دوای نیوەڕۆ|ئێوارە|شەو))/i,
abbreviated: /^(پ-ن|د-ن|نیوە شەو|نیوەڕۆ|بەیانی|دوای نیوەڕۆ|ئێوارە|شەو)/,
wide: /^(پێش نیوەڕۆ|دوای نیوەڕۆ|نیوەڕۆ|نیوە شەو|لەبەیانیدا|لەدواینیوەڕۆدا|لە ئێوارەدا|لە شەودا)/,
any: /^(پ|د|بەیانی|نیوەڕۆ|ئێوارە|شەو)/,
};
const parseDayPeriodPatterns = {
any: {
am: /^د/i,
pm: /^پ/i,
midnight: /^ن-ش/i,
noon: /^ن/i,
morning: /بەیانی/i,
afternoon: /دواینیوەڕۆ/i,
evening: /ئێوارە/i,
night: /شەو/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,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\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]}

View File

@@ -0,0 +1,23 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
export const Error = () => {
return /*#__PURE__*/_jsxs("svg", {
fill: "none",
height: "26",
viewBox: "0 0 26 26",
width: "26",
xmlns: "http://www.w3.org/2000/svg",
children: [/*#__PURE__*/_jsx("path", {
d: "M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",
fill: "var(--theme-error-500)"
}), /*#__PURE__*/_jsx("path", {
d: "M15.4001 10.5996L10.6001 15.3996M10.6001 10.5996L15.4001 15.3996",
stroke: "var(--theme-error-50)",
strokeLinecap: "round",
strokeLinejoin: "round"
})]
});
};
//# sourceMappingURL=Error.js.map

View File

@@ -0,0 +1,113 @@
'use strict';
const fill = require('fill-range');
const stringify = require('./stringify');
const utils = require('./utils');
const append = (queue = '', stash = '', enclose = false) => {
const result = [];
queue = [].concat(queue);
stash = [].concat(stash);
if (!stash.length) return queue;
if (!queue.length) {
return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
}
for (const item of queue) {
if (Array.isArray(item)) {
for (const value of item) {
result.push(append(value, stash, enclose));
}
} else {
for (let ele of stash) {
if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
}
}
}
return utils.flatten(result);
};
const expand = (ast, options = {}) => {
const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
const walk = (node, parent = {}) => {
node.queue = [];
let p = parent;
let q = parent.queue;
while (p.type !== 'brace' && p.type !== 'root' && p.parent) {
p = p.parent;
q = p.queue;
}
if (node.invalid || node.dollar) {
q.push(append(q.pop(), stringify(node, options)));
return;
}
if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) {
q.push(append(q.pop(), ['{}']));
return;
}
if (node.nodes && node.ranges > 0) {
const args = utils.reduce(node.nodes);
if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
}
let range = fill(...args, options);
if (range.length === 0) {
range = stringify(node, options);
}
q.push(append(q.pop(), range));
node.nodes = [];
return;
}
const enclose = utils.encloseBrace(node);
let queue = node.queue;
let block = node;
while (block.type !== 'brace' && block.type !== 'root' && block.parent) {
block = block.parent;
queue = block.queue;
}
for (let i = 0; i < node.nodes.length; i++) {
const child = node.nodes[i];
if (child.type === 'comma' && node.type === 'brace') {
if (i === 1) queue.push('');
queue.push('');
continue;
}
if (child.type === 'close') {
q.push(append(q.pop(), queue, enclose));
continue;
}
if (child.value && child.type !== 'open') {
queue.push(append(queue.pop(), child.value));
continue;
}
if (child.nodes) {
walk(child, node);
}
}
return queue;
};
return utils.flatten(walk(ast));
};
module.exports = expand;

View File

@@ -0,0 +1,5 @@
import { IImage } from './interface.mjs';
declare const JP2: IImage;
export { JP2 };

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CircleHelp = createLucideIcon("CircleHelp", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
["path", { d: "M12 17h.01", key: "p32p05" }]
]);
export { CircleHelp as default };
//# sourceMappingURL=circle-help.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"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","2":"C L M G N O P"},C:{"2":"0 1 2 3 4 5 6 7 8 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 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 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB 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","194":"5B WC 6B XC 7B 8B 9B AC BC"},E:{"2":"J bB K D E F A B C L M G 6C bC 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID"},F:{"1":"0 1 2 3 4 5 6 7 8 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"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 zB 0B JD KD LD MD PC xC ND QC"},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:{"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:{"2":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"2":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"2":"6D 7D"}},B:4,C:"Orientation Sensor",D:true};

View File

@@ -0,0 +1,31 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.OLElementContainer = void 0;
var element_container_1 = require("../element-container");
var OLElementContainer = /** @class */ (function (_super) {
__extends(OLElementContainer, _super);
function OLElementContainer(context, element) {
var _this = _super.call(this, context, element) || this;
_this.start = element.start;
_this.reversed = typeof element.reversed === 'boolean' && element.reversed === true;
return _this;
}
return OLElementContainer;
}(element_container_1.ElementContainer));
exports.OLElementContainer = OLElementContainer;
//# sourceMappingURL=ol-element-container.js.map

View File

@@ -0,0 +1,135 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^ke-(\d+)?/i;
const parseOrdinalNumberPattern = /petama|\d+/i;
const matchEraPatterns = {
narrow: /^(sm|m)/i,
abbreviated: /^(s\.?\s?m\.?|m\.?)/i,
wide: /^(sebelum masihi|masihi)/i,
};
const parseEraPatterns = {
any: [/^s/i, /^(m)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^S[1234]/i,
wide: /Suku (pertama|kedua|ketiga|keempat)/i,
};
const parseQuarterPatterns = {
any: [/pertama|1/i, /kedua|2/i, /ketiga|3/i, /keempat|4/i],
};
const matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mac|apr|mei|jun|jul|ogo|sep|okt|nov|dis)/i,
wide: /^(januari|februari|mac|april|mei|jun|julai|ogos|september|oktober|november|disember)/i,
};
const parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^o/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ja/i,
/^f/i,
/^ma/i,
/^ap/i,
/^me/i,
/^jun/i,
/^jul/i,
/^og/i,
/^s/i,
/^ok/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[aisrkj]/i,
short: /^(ahd|isn|sel|rab|kha|jum|sab)/i,
abbreviated: /^(ahd|isn|sel|rab|kha|jum|sab)/i,
wide: /^(ahad|isnin|selasa|rabu|khamis|jumaat|sabtu)/i,
};
const parseDayPatterns = {
narrow: [/^a/i, /^i/i, /^s/i, /^r/i, /^k/i, /^j/i, /^s/i],
any: [/^a/i, /^i/i, /^se/i, /^r/i, /^k/i, /^j/i, /^sa/i],
};
const matchDayPeriodPatterns = {
narrow: /^(am|pm|tengah malam|tengah hari|pagi|petang|malam)/i,
any: /^([ap]\.?\s?m\.?|tengah malam|tengah hari|pagi|petang|malam)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^pm/i,
midnight: /^tengah m/i,
noon: /^tengah h/i,
morning: /pa/i,
afternoon: /tengah h/i,
evening: /pe/i,
night: /m/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../../src/elements/FolderView/Cell/index.client.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAoB,MAAM,OAAO,CAAA;AAKxC,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;IACrC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,qBAAqB,yFAO/B,KAAK,sBA6FP,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"more-vertical.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1,151 @@
# selderee
![lint status badge](https://github.com/mxxii/selderee/workflows/lint/badge.svg)
![test status badge](https://github.com/mxxii/selderee/workflows/test/badge.svg)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/mxxii/selderee/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/dw/selderee?color=informational&logo=npm)](https://www.npmjs.com/package/selderee)
**Sel**ectors **de**cision t**ree** - pick matching selectors, fast.
----
## What is it for
The problem statement: there are multiple CSS selectors with attached handlers, and a HTML DOM to process. For each HTML Element a matching handler has to be found and applied.
The naive approach is to walk through the DOM and test each and every selector against each Element. This means *O(n\*m)* complexity.
It is pretty clear though that if we have selectors that share something in common then we can reduce the number of checks.
The main `selderee` package offers the selectors tree structure. Runnable decision functions for specific DOM implementations are built via plugins.
## Limitations
- Pseudo-classes and pseudo-elements are not supported by the underlying library [parseley](https://github.com/mxxii/parseley) (yet?);
- General siblings (`~`), descendants (` `) and same column combinators (`||`) are also not supported.
## `selderee` vs `css-select`
[css-select](https://github.com/fb55/css-select) - a CSS selector compiler & engine.
| Feature | `selderee` | `css-select` |
| ------------------------------------- | :--------: | :----------: |
| Support for `htmlparser2` DOM AST | plugin | + |
| "Compiles" into a function | + | + |
| Pick selector(s) for a given Element | + | |
| Query Element(s) for a given selector | | + |
## Packages
| Package | Version | Folder | Changelog |
| --------- | --------- | --------- | --------- |
| [selderee](https://www.npmjs.com/package/selderee) | [![npm](https://img.shields.io/npm/v/selderee?logo=npm)](https://www.npmjs.com/package/selderee) | [/packages/selderee](https://github.com/mxxii/selderee/tree/main/packages/selderee/) | [changelog](https://github.com/mxxii/selderee/blob/main/packages/selderee/CHANGELOG.md) |
| [@selderee/plugin-htmlparser2](https://www.npmjs.com/package/@selderee/plugin-htmlparser2) | [![npm](https://img.shields.io/npm/v/@selderee/plugin-htmlparser2?logo=npm)](https://www.npmjs.com/package/@selderee/plugin-htmlparser2) | [/packages/plugin-htmlparser2](https://github.com/mxxii/selderee/tree/main/packages/plugin-htmlparser2/) | [changelog](https://github.com/mxxii/selderee/blob/main/packages/plugin-htmlparser2/CHANGELOG.md) |
## Install
```shell
> npm i selderee @selderee/plugin-htmlparser2
```
## Documentation
- [API](https://github.com/mxxii/selderee/blob/main/docs/index.md)
## Usage example
```js
const htmlparser2 = require('htmlparser2');
const util = require('util');
const { DecisionTree, Treeify } = require('selderee');
const { hp2Builder } = require('@selderee/plugin-htmlparser2');
const selectorValuePairs = [
['p', 'A'],
['p.foo[bar]', 'B'],
['p[class~=foo]', 'C'],
['div.foo', 'D'],
['div > p.foo', 'E'],
['div > p', 'F'],
['#baz', 'G']
];
// Make a tree structure from all given selectors.
const selectorsDecisionTree = new DecisionTree(selectorValuePairs);
// `treeify` builder produces a string output for testing and debug purposes.
// `treeify` expects string values attached to each selector.
const prettyTree = selectorsDecisionTree.build(Treeify.treeify);
console.log(prettyTree);
const html = /*html*/`<html><body>
<div><p class="foo qux">second</p></div>
</body></html>`;
const dom = htmlparser2.parseDocument(html);
const element = dom.children[0].children[0].children[1].children[0];
// `hp2Builder` produces a picker that can pick values
// from the selectors tree.
const picker = selectorsDecisionTree.build(hp2Builder);
// Get all matches
const allMatches = picker.pickAll(element);
console.log(util.inspect(allMatches, { breakLength: 70, depth: null }));
// or get the value from the most specific match.
const bestMatch = picker.pick1(element);
console.log(`Best matched value: ${bestMatch}`);
```
<details><summary>Example output</summary>
```text
├─◻ Tag name
│ ╟─◇ = p
│ ║ ┠─▣ Attr value: class
│ ║ ┃ ╙─◈ ~= "foo"
│ ║ ┃ ┠─◨ Attr presence: bar
│ ║ ┃ ┃ ┖─◁ #1 [0,2,1] B
│ ║ ┃ ┠─◁ #2 [0,1,1] C
│ ║ ┃ ┖─◉ Push element: >
│ ║ ┃ └─◻ Tag name
│ ║ ┃ ╙─◇ = div
│ ║ ┃ ┖─◁ #4 [0,1,2] E
│ ║ ┠─◁ #0 [0,0,1] A
│ ║ ┖─◉ Push element: >
│ ║ └─◻ Tag name
│ ║ ╙─◇ = div
│ ║ ┖─◁ #5 [0,0,2] F
│ ╙─◇ = div
│ ┖─▣ Attr value: class
│ ╙─◈ ~= "foo"
│ ┖─◁ #3 [0,1,1] D
└─▣ Attr value: id
╙─◈ = "baz"
┖─◁ #6 [1,0,0] G
[ { index: 2, value: 'C', specificity: [ 0, 1, 1 ] },
{ index: 4, value: 'E', specificity: [ 0, 1, 2 ] },
{ index: 0, value: 'A', specificity: [ 0, 0, 1 ] },
{ index: 5, value: 'F', specificity: [ 0, 0, 2 ] } ]
Best matched value: E
```
*Some gotcha: you may notice the check for `#baz` has to be performed every time the decision tree is called. If it happens to be `p#baz` or `div#baz` or even `.foo#baz` - it would be much better to write it like this. Deeper, narrower tree means less checks on average. (in case of `.foo#baz` the class check might finally outweigh the tag name check and rebalance the tree.)*
</details>
## Development
Targeting Node.js version >=14.
Monorepo uses NPM v7 workspaces (make sure v7 is installed when used with Node.js v14.)

View File

@@ -0,0 +1,10 @@
import fs from 'fs';
import { printSchema } from 'graphql';
import { configToSchema } from '../index.js';
export function generateSchema(config) {
const outputFile = process.env.PAYLOAD_GRAPHQL_SCHEMA_PATH || config.graphQL.schemaOutputFile;
const { schema } = configToSchema(config);
fs.writeFileSync(outputFile, printSchema(schema));
}
//# sourceMappingURL=generateSchema.js.map

View File

@@ -0,0 +1,13 @@
import type { ClientCollectionConfig } from 'payload';
import React from 'react';
import './index.scss';
type Props = {
readonly collectionConfig: ClientCollectionConfig;
};
export declare function ActionsBar({ collectionConfig }: Props): React.JSX.Element;
type ActionsProps = {
readonly className?: string;
};
export declare function Actions({ className }: ActionsProps): React.JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,2 @@
import "./use-isomorphic-layout-effect.cjs.js";
export { _default as default } from "./use-isomorphic-layout-effect.cjs.default.js";

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/createGlobal.ts"],"sourcesContent":["import type { CreateGlobalArgs } from 'payload'\n\nimport toSnakeCase from 'to-snake-case'\n\nimport type { DrizzleAdapter } from './types.js'\n\nimport { upsertRow } from './upsertRow/index.js'\nimport { getTransaction } from './utilities/getTransaction.js'\n\nexport async function createGlobal<T extends Record<string, unknown>>(\n this: DrizzleAdapter,\n { slug, data, req, returning }: CreateGlobalArgs,\n): Promise<T> {\n const globalConfig = this.payload.globals.config.find((config) => config.slug === slug)\n\n const tableName = this.tableNameMap.get(toSnakeCase(globalConfig.slug))\n\n data.createdAt = new Date().toISOString()\n\n const db = await getTransaction(this, req)\n\n const result = await upsertRow<{ globalType: string } & T>({\n adapter: this,\n data,\n db,\n fields: globalConfig.flattenedFields,\n globalSlug: slug,\n ignoreResult: returning === false,\n operation: 'create',\n req,\n tableName,\n })\n\n if (returning === false) {\n return null\n }\n\n result.globalType = slug\n\n return result\n}\n"],"names":["toSnakeCase","upsertRow","getTransaction","createGlobal","slug","data","req","returning","globalConfig","payload","globals","config","find","tableName","tableNameMap","get","createdAt","Date","toISOString","db","result","adapter","fields","flattenedFields","globalSlug","ignoreResult","operation","globalType"],"mappings":"AAEA,OAAOA,iBAAiB,gBAAe;AAIvC,SAASC,SAAS,QAAQ,uBAAsB;AAChD,SAASC,cAAc,QAAQ,gCAA+B;AAE9D,OAAO,eAAeC,aAEpB,EAAEC,IAAI,EAAEC,IAAI,EAAEC,GAAG,EAAEC,SAAS,EAAoB;IAEhD,MAAMC,eAAe,IAAI,CAACC,OAAO,CAACC,OAAO,CAACC,MAAM,CAACC,IAAI,CAAC,CAACD,SAAWA,OAAOP,IAAI,KAAKA;IAElF,MAAMS,YAAY,IAAI,CAACC,YAAY,CAACC,GAAG,CAACf,YAAYQ,aAAaJ,IAAI;IAErEC,KAAKW,SAAS,GAAG,IAAIC,OAAOC,WAAW;IAEvC,MAAMC,KAAK,MAAMjB,eAAe,IAAI,EAAEI;IAEtC,MAAMc,SAAS,MAAMnB,UAAsC;QACzDoB,SAAS,IAAI;QACbhB;QACAc;QACAG,QAAQd,aAAae,eAAe;QACpCC,YAAYpB;QACZqB,cAAclB,cAAc;QAC5BmB,WAAW;QACXpB;QACAO;IACF;IAEA,IAAIN,cAAc,OAAO;QACvB,OAAO;IACT;IAEAa,OAAOO,UAAU,GAAGvB;IAEpB,OAAOgB;AACT"}

View File

@@ -0,0 +1,25 @@
{
"title": "WatchIgnorePluginOptions",
"type": "object",
"additionalProperties": false,
"properties": {
"paths": {
"description": "A list of RegExps or absolute paths to directories or files that should be ignored.",
"type": "array",
"items": {
"description": "RegExp or absolute path to directories or files that should be ignored.",
"anyOf": [
{
"instanceof": "RegExp",
"tsType": "RegExp"
},
{
"type": "string"
}
]
},
"minItems": 1
}
},
"required": ["paths"]
}

View File

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

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 y",
long: "d 'de' MMMM y",
medium: "d 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}} 'a les' {{time}}",
long: "{{date}} 'a les' {{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,169 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["BC", "AD"],
abbreviated: ["BC", "AD"],
wide: ["기원전", "서기"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1분기", "2분기", "3분기", "4분기"],
};
const monthValues = {
narrow: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
abbreviated: [
"1월",
"2월",
"3월",
"4월",
"5월",
"6월",
"7월",
"8월",
"9월",
"10월",
"11월",
"12월",
],
wide: [
"1월",
"2월",
"3월",
"4월",
"5월",
"6월",
"7월",
"8월",
"9월",
"10월",
"11월",
"12월",
],
};
const dayValues = {
narrow: ["일", "월", "화", "수", "목", "금", "토"],
short: ["일", "월", "화", "수", "목", "금", "토"],
abbreviated: ["일", "월", "화", "수", "목", "금", "토"],
wide: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"],
};
const dayPeriodValues = {
narrow: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
abbreviated: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
wide: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
abbreviated: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
wide: {
am: "오전",
pm: "오후",
midnight: "자정",
noon: "정오",
morning: "아침",
afternoon: "오후",
evening: "저녁",
night: "밤",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = String(options?.unit);
switch (unit) {
case "minute":
case "second":
return String(number);
case "date":
return number + "일";
default:
return number + "번째";
}
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1 @@
!function(e){var n={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},r={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},t={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n,number:r,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:r,punctuation:/[{}()\[\];:,]/};t.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:t}},t.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:t}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:t}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:t}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:t}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:t.interpolation}},rest:t}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:t.interpolation,comment:t.comment,punctuation:/[{},]/}},func:t.func,string:t.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:t.interpolation,punctuation:/[{}()\[\];:.]/}}(Prism);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/postgres-js/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gCAAc,wBAAd;AACA,gCAAc,yBADd;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/mysql-core/alias.ts"],"sourcesContent":["import { TableAliasProxyHandler } from '~/alias.ts';\nimport type { BuildAliasTable } from './query-builders/select.types.ts';\nimport type { MySqlTable } from './table.ts';\nimport type { MySqlViewBase } from './view-base.ts';\n\nexport function alias<TTable extends MySqlTable | MySqlViewBase, TAlias extends string>(\n\ttable: TTable,\n\talias: TAlias,\n): BuildAliasTable<TTable, TAlias> {\n\treturn new Proxy(table, new TableAliasProxyHandler(alias, false)) as any;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuC;AAKhC,SAAS,MACf,OACAA,QACkC;AAClC,SAAO,IAAI,MAAM,OAAO,IAAI,oCAAuBA,QAAO,KAAK,CAAC;AACjE;","names":["alias"]}

View File

@@ -0,0 +1,23 @@
/**
* @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 Signpost = createLucideIcon("Signpost", [
["path", { d: "M12 13v8", key: "1l5pq0" }],
["path", { d: "M12 3v3", key: "1n5kay" }],
[
"path",
{
d: "M18 6a2 2 0 0 1 1.387.56l2.307 2.22a1 1 0 0 1 0 1.44l-2.307 2.22A2 2 0 0 1 18 13H6a2 2 0 0 1-1.387-.56l-2.306-2.22a1 1 0 0 1 0-1.44l2.306-2.22A2 2 0 0 1 6 6z",
key: "gqqp9m"
}
]
]);
export { Signpost as default };
//# sourceMappingURL=signpost.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"gitlab.js","sources":["../../../src/icons/gitlab.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Gitlab\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjIgMTMuMjktMy4zMy0xMGEuNDIuNDIgMCAwIDAtLjE0LS4xOC4zOC4zOCAwIDAgMC0uMjItLjExLjM5LjM5IDAgMCAwLS4yMy4wNy40Mi40MiAwIDAgMC0uMTQuMThsLTIuMjYgNi42N0g4LjMyTDYuMSAzLjI2YS40Mi40MiAwIDAgMC0uMS0uMTguMzguMzggMCAwIDAtLjI2LS4wOC4zOS4zOSAwIDAgMC0uMjMuMDcuNDIuNDIgMCAwIDAtLjE0LjE4TDIgMTMuMjlhLjc0Ljc0IDAgMCAwIC4yNy44M0wxMiAyMWw5LjY5LTYuODhhLjcxLjcxIDAgMCAwIC4zMS0uODNaIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/gitlab\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 * @deprecated Brand icons have been deprecated and are due to be removed, please refer to https://github.com/lucide-icons/lucide/issues/670. We recommend using https://simpleicons.org/?q=gitlab instead. This icon will be removed in v1.0\n */\nconst Gitlab = createLucideIcon('Gitlab', [\n [\n 'path',\n {\n d: 'm22 13.29-3.33-10a.42.42 0 0 0-.14-.18.38.38 0 0 0-.22-.11.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18l-2.26 6.67H8.32L6.1 3.26a.42.42 0 0 0-.1-.18.38.38 0 0 0-.26-.08.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18L2 13.29a.74.74 0 0 0 .27.83L12 21l9.69-6.88a.71.71 0 0 0 .31-.83Z',\n key: '148pdi',\n },\n ],\n]);\n\nexport default Gitlab;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _iterableToArray;
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
return Array.from(iter);
}
}
//# sourceMappingURL=iterableToArray.js.map

View File

@@ -0,0 +1,29 @@
[![NPM](https://img.shields.io/npm/v/@faceless-ui/window-info)](https://www.npmjs.com/@faceless-ui/window-info)
![Bundle Size](https://img.shields.io/bundlephobia/minzip/@faceless-ui/window-info?label=zipped)
# React Window Info
Read the full documentation [here](https://facelessui.com/docs/window-info).
## Installation
```bash
$ npm i @faceless-ui/window-info
$ # or
$ yarn add @faceless-ui/window-info
```
## Development
To develop this module locally, spin up the [demo app](./demo/App.demo.js):
```bash
$ git clone git@github.com:faceless-ui/window-info.git
$ yarn
$ yarn dev
$ open http://localhost:3000
```
## License
[MIT](https://github.com/faceless-ui/window-info/blob/master/LICENSE) Copyright (c) Faceless UI

View File

@@ -0,0 +1,240 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const react = require('@sentry/react');
const parameterization = require('./parameterization.js');
const INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME = 'incomplete-app-router-transaction';
/**
* This mutable keeps track of what router navigation instrumentation mechanism we are using.
*
* The default one is 'router-patch' which is a way of instrumenting that worked up until Next.js 15.3.0 was released.
* For this method we took the global router instance and simply monkey patched all the router methods like push(), replace(), and so on.
* This worked because Next.js itself called the router methods for things like the <Link /> component.
* Vercel decided that it is not good to call these public API methods from within the framework so they switched to an internal system that completely bypasses our monkey patching. This happened in 15.3.0.
*
* We raised with Vercel that this breaks our SDK so together with them we came up with an API for `instrumentation-client.ts` called `onRouterTransitionStart` that is called whenever a navigation is kicked off.
*
* Now we have the problem of version compatibility.
* For older Next.js versions we cannot use the new hook so we need to always patch the router.
* For newer Next.js versions we cannot know whether the user actually registered our handler for the `onRouterTransitionStart` hook, so we need to wait until it was called at least once before switching the instrumentation mechanism.
* The problem is, that the user may still have registered a hook and then call a patched router method.
* First, the monkey patched router method will be called, starting a navigation span, then the hook will also called.
* We need to handle this case and not create two separate navigation spans but instead update the current navigation span and then switch to the new instrumentation mode.
* This is all denoted by this `navigationRoutingMode` variable.
*/
let navigationRoutingMode = 'router-patch';
const currentRouterPatchingNavigationSpanRef = { current: undefined };
/** Instruments the Next.js app router for pageloads. */
function appRouterInstrumentPageLoad(client) {
const parameterizedPathname = parameterization.maybeParameterizeRoute(react.WINDOW.location.pathname);
const origin = core.browserPerformanceTimeOrigin();
react.startBrowserTracingPageLoadSpan(client, {
name: parameterizedPathname ?? react.WINDOW.location.pathname,
// pageload should always start at timeOrigin (and needs to be in s, not ms)
startTime: origin ? origin / 1000 : undefined,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.nextjs.app_router_instrumentation',
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: parameterizedPathname ? 'route' : 'url',
},
});
}
// Yes, yes, I know we shouldn't depend on these internals. But that's where we are at. We write the ugly code, so you don't have to.
const GLOBAL_OBJ_WITH_NEXT_ROUTER = core.GLOBAL_OBJ
;
const globalWithInjectedBasePath = core.GLOBAL_OBJ
;
/*
* The routing instrumentation needs to handle a few cases:
* - Router operations:
* - router.push() (either explicitly called or implicitly through <Link /> tags)
* - router.replace() (either explicitly called or implicitly through <Link replace /> tags)
* - router.back()
* - router.forward()
* - Browser operations:
* - native Browser-back / popstate event (implicitly called by router.back())
* - native Browser-forward / popstate event (implicitly called by router.forward())
*/
/** Instruments the Next.js app router for navigation. */
function appRouterInstrumentNavigation(client) {
routerTransitionHandler = (href, navigationType) => {
const basePath = process.env._sentryBasePath ?? globalWithInjectedBasePath._sentryBasePath;
const normalizedHref = basePath && !href.startsWith(basePath) ? `${basePath}${href}` : href;
const unparameterizedPathname = new URL(normalizedHref, react.WINDOW.location.href).pathname;
const parameterizedPathname = parameterization.maybeParameterizeRoute(unparameterizedPathname);
const pathname = parameterizedPathname ?? unparameterizedPathname;
if (navigationRoutingMode === 'router-patch') {
navigationRoutingMode = 'transition-start-hook';
}
const currentNavigationSpan = currentRouterPatchingNavigationSpanRef.current;
if (currentNavigationSpan) {
currentNavigationSpan.updateName(pathname);
currentNavigationSpan.setAttributes({
'navigation.type': `router.${navigationType}`,
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: parameterizedPathname ? 'route' : 'url',
});
currentRouterPatchingNavigationSpanRef.current = undefined;
} else {
react.startBrowserTracingNavigationSpan(client, {
name: pathname,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.nextjs.app_router_instrumentation',
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: parameterizedPathname ? 'route' : 'url',
'navigation.type': `router.${navigationType}`,
},
});
}
};
react.WINDOW.addEventListener('popstate', () => {
const parameterizedPathname = parameterization.maybeParameterizeRoute(react.WINDOW.location.pathname);
if (currentRouterPatchingNavigationSpanRef.current?.isRecording()) {
currentRouterPatchingNavigationSpanRef.current.updateName(parameterizedPathname ?? react.WINDOW.location.pathname);
currentRouterPatchingNavigationSpanRef.current.setAttribute(
core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
parameterizedPathname ? 'route' : 'url',
);
} else {
currentRouterPatchingNavigationSpanRef.current = react.startBrowserTracingNavigationSpan(client, {
name: parameterizedPathname ?? react.WINDOW.location.pathname,
attributes: {
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.nextjs.app_router_instrumentation',
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: parameterizedPathname ? 'route' : 'url',
'navigation.type': 'browser.popstate',
},
});
}
});
let routerPatched = false;
let triesToFindRouter = 0;
const MAX_TRIES_TO_FIND_ROUTER = 500;
const ROUTER_AVAILABILITY_CHECK_INTERVAL_MS = 20;
const checkForRouterAvailabilityInterval = setInterval(() => {
triesToFindRouter++;
const router = GLOBAL_OBJ_WITH_NEXT_ROUTER?.next?.router ?? GLOBAL_OBJ_WITH_NEXT_ROUTER?.nd?.router;
if (routerPatched || triesToFindRouter > MAX_TRIES_TO_FIND_ROUTER) {
clearInterval(checkForRouterAvailabilityInterval);
} else if (router) {
clearInterval(checkForRouterAvailabilityInterval);
routerPatched = true;
patchRouter(client, router, currentRouterPatchingNavigationSpanRef);
// If the router at any point gets overridden - patch again
(['nd', 'next'] ).forEach(globalValueName => {
const globalValue = GLOBAL_OBJ_WITH_NEXT_ROUTER[globalValueName];
if (globalValue) {
GLOBAL_OBJ_WITH_NEXT_ROUTER[globalValueName] = new Proxy(globalValue, {
set(target, p, newValue) {
if (p === 'router' && typeof newValue === 'object' && newValue !== null) {
patchRouter(client, newValue, currentRouterPatchingNavigationSpanRef);
}
// @ts-expect-error we cannot possibly type this
target[p] = newValue;
return true;
},
});
}
});
}
}, ROUTER_AVAILABILITY_CHECK_INTERVAL_MS);
}
function transactionNameifyRouterArgument(target) {
try {
// We provide an arbitrary base because we only care about the pathname and it makes URL parsing more resilient.
return new URL(target, 'http://example.com/').pathname;
} catch {
return '/';
}
}
const patchedRouters = new WeakSet();
function patchRouter(client, router, currentNavigationSpanRef) {
if (patchedRouters.has(router)) {
return;
}
patchedRouters.add(router);
(['back', 'forward', 'push', 'replace'] ).forEach(routerFunctionName => {
if (router?.[routerFunctionName]) {
// @ts-expect-error Weird type error related to not knowing how to associate return values with the individual functions - we can just ignore
router[routerFunctionName] = new Proxy(router[routerFunctionName], {
apply(target, thisArg, argArray) {
if (navigationRoutingMode !== 'router-patch') {
return target.apply(thisArg, argArray);
}
let transactionName = INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME;
const transactionAttributes = {
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.nextjs.app_router_instrumentation',
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
};
const href = argArray[0];
const basePath = process.env._sentryBasePath ?? globalWithInjectedBasePath._sentryBasePath;
const normalizedHref =
basePath && typeof href === 'string' && !href.startsWith(basePath) ? `${basePath}${href}` : href;
if (routerFunctionName === 'push') {
transactionName = transactionNameifyRouterArgument(normalizedHref);
transactionAttributes['navigation.type'] = 'router.push';
} else if (routerFunctionName === 'replace') {
transactionName = transactionNameifyRouterArgument(normalizedHref);
transactionAttributes['navigation.type'] = 'router.replace';
} else if (routerFunctionName === 'back') {
transactionAttributes['navigation.type'] = 'router.back';
} else if (routerFunctionName === 'forward') {
transactionAttributes['navigation.type'] = 'router.forward';
}
const parameterizedPathname = parameterization.maybeParameterizeRoute(transactionName);
currentNavigationSpanRef.current = react.startBrowserTracingNavigationSpan(client, {
name: parameterizedPathname ?? transactionName,
attributes: {
...transactionAttributes,
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: parameterizedPathname ? 'route' : 'url',
},
});
return target.apply(thisArg, argArray);
},
});
}
});
}
let routerTransitionHandler = undefined;
/**
* A handler for Next.js' `onRouterTransitionStart` hook in `instrumentation-client.ts` to record navigation spans in Sentry.
*/
function captureRouterTransitionStart(href, navigationType) {
if (routerTransitionHandler) {
routerTransitionHandler(href, navigationType);
}
}
exports.INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME = INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME;
exports.appRouterInstrumentNavigation = appRouterInstrumentNavigation;
exports.appRouterInstrumentPageLoad = appRouterInstrumentPageLoad;
exports.captureRouterTransitionStart = captureRouterTransitionStart;
//# sourceMappingURL=appRouterRoutingInstrumentation.js.map

View File

@@ -0,0 +1,36 @@
"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 primary_key_exports = {};
__export(primary_key_exports, {
PrimaryKey: () => PrimaryKey
});
module.exports = __toCommonJS(primary_key_exports);
var import_entity = require("./entity.cjs");
class PrimaryKey {
constructor(table, columns) {
this.table = table;
this.columns = columns;
}
static [import_entity.entityKind] = "PrimaryKey";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PrimaryKey
});
//# sourceMappingURL=primary-key.cjs.map

View File

@@ -0,0 +1,353 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { DefaultListView, HydrateAuthProvider, ListQueryProvider } from '@payloadcms/ui';
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import { getColumns, renderFilters, renderTable, upsertPreferences } from '@payloadcms/ui/rsc';
import { notFound } from 'next/navigation.js';
import { appendUploadSelectFields, combineWhereConstraints, formatAdminURL, isNumber, mergeListSearchAndWhere, transformColumnsToPreferences, transformColumnsToSearchParams } from 'payload/shared';
import React, { Fragment } from 'react';
import { getDocumentPermissions } from '../Document/getDocumentPermissions.js';
import { enrichDocsWithVersionStatus } from './enrichDocsWithVersionStatus.js';
import { handleGroupBy } from './handleGroupBy.js';
import { renderListViewSlots } from './renderListViewSlots.js';
import { resolveAllFilterOptions } from './resolveAllFilterOptions.js';
import { transformColumnsToSelect } from './transformColumnsToSelect.js';
/**
* This function is responsible for rendering
* the list view on the server for both:
* - default list view
* - list view within drawers
*
* @internal
*/
export const renderListView = async args => {
const {
clientConfig,
ComponentOverride,
customCellProps,
disableBulkDelete,
disableBulkEdit,
disableQueryPresets,
drawerSlug,
enableRowSelections,
initPageResult,
overrideEntityVisibility,
params,
query: queryFromArgs,
searchParams,
trash,
viewType
} = args;
const {
collectionConfig,
collectionConfig: {
slug: collectionSlug
},
locale: fullLocale,
permissions,
req,
req: {
i18n,
payload,
payload: {
config
},
query: queryFromReq,
user
},
visibleEntities
} = initPageResult;
const {
routes: {
admin: adminRoute
}
} = config;
if (!collectionConfig || !permissions?.collections?.[collectionSlug]?.read || !visibleEntities.collections.includes(collectionSlug) && !overrideEntityVisibility) {
throw new Error('not-found');
}
const query = queryFromArgs || queryFromReq;
const columnsFromQuery = transformColumnsToPreferences(query?.columns);
query.queryByGroup = query?.queryByGroup && typeof query.queryByGroup === 'string' ? JSON.parse(query.queryByGroup) : query?.queryByGroup;
const collectionPreferences = await upsertPreferences({
key: `collection-${collectionSlug}`,
req,
value: {
columns: columnsFromQuery,
groupBy: query?.groupBy,
limit: isNumber(query?.limit) ? Number(query.limit) : undefined,
preset: query?.preset,
sort: query?.sort
}
});
let queryPreset;
let queryPresetPermissions;
if (collectionPreferences?.preset) {
try {
queryPreset = await payload.findByID({
id: collectionPreferences?.preset,
collection: 'payload-query-presets',
depth: 0,
overrideAccess: false,
user
});
if (queryPreset) {
queryPresetPermissions = (await getDocumentPermissions({
id: queryPreset.id,
collectionConfig: req.payload.collections['payload-query-presets'].config,
data: queryPreset,
req
}))?.docPermissions;
}
} catch (err) {
req.payload.logger.error(`Error fetching query preset or preset permissions: ${err}`);
}
}
query.preset = queryPreset?.id;
if (queryPreset?.where && !query.where) {
query.where = queryPreset.where;
}
query.groupBy = query.groupBy ?? queryPreset?.groupBy ?? collectionPreferences?.groupBy;
const columnPreference = query.columns ? transformColumnsToPreferences(query.columns) : queryPreset?.columns ?? collectionPreferences?.columns;
query.columns = transformColumnsToSearchParams(columnPreference);
query.page = isNumber(query?.page) ? Number(query.page) : 0;
query.limit = collectionPreferences?.limit || collectionConfig.admin.pagination.defaultLimit;
query.sort = collectionPreferences?.sort || (typeof collectionConfig.defaultSort === 'string' ? collectionConfig.defaultSort : undefined);
const baseFilterConstraint = await (collectionConfig.admin?.baseFilter ?? collectionConfig.admin?.baseListFilter)?.({
limit: query.limit,
page: query.page,
req,
sort: query.sort
});
let whereWithMergedSearch = mergeListSearchAndWhere({
collectionConfig,
search: typeof query?.search === 'string' ? query.search : undefined,
where: combineWhereConstraints([query?.where, baseFilterConstraint])
});
if (trash === true) {
whereWithMergedSearch = {
and: [whereWithMergedSearch, {
deletedAt: {
exists: true
}
}]
};
}
let Table = null;
let columnState = [];
let data = {
// no results default
docs: [],
hasNextPage: false,
hasPrevPage: false,
limit: query.limit,
nextPage: null,
page: 1,
pagingCounter: 0,
prevPage: null,
totalDocs: 0,
totalPages: 0
};
const clientCollectionConfig = clientConfig.collections.find(c => c.slug === collectionSlug);
const columns = getColumns({
clientConfig,
collectionConfig: clientCollectionConfig,
collectionSlug,
columns: columnPreference,
i18n,
permissions
});
const select = collectionConfig.admin.enableListViewSelectAPI ? transformColumnsToSelect(columns) : undefined;
/** Force select image fields for list view thumbnails */
appendUploadSelectFields({
collectionConfig,
select
});
try {
if (collectionConfig.admin.groupBy && query.groupBy) {
({
columnState,
data,
Table
} = await handleGroupBy({
clientCollectionConfig,
clientConfig,
collectionConfig,
collectionSlug,
columns,
customCellProps,
drawerSlug,
enableRowSelections,
fieldPermissions: permissions?.collections?.[collectionSlug]?.fields,
query,
req,
select,
trash,
user,
viewType,
where: whereWithMergedSearch
}));
// Enrich documents with correct display status for drafts
data = await enrichDocsWithVersionStatus({
collectionConfig,
data,
req
});
} else {
data = await req.payload.find({
collection: collectionSlug,
depth: 0,
draft: true,
fallbackLocale: false,
includeLockStatus: true,
limit: query?.limit ? Number(query.limit) : undefined,
locale: req.locale,
overrideAccess: false,
page: query?.page ? Number(query.page) : undefined,
req,
select,
sort: query?.sort,
trash,
user,
where: whereWithMergedSearch
});
// Enrich documents with correct display status for drafts
data = await enrichDocsWithVersionStatus({
collectionConfig,
data,
req
});
({
columnState,
Table
} = renderTable({
clientCollectionConfig,
collectionConfig,
columns,
customCellProps,
data,
drawerSlug,
enableRowSelections,
fieldPermissions: permissions?.collections?.[collectionSlug]?.fields,
i18n: req.i18n,
orderableFieldName: collectionConfig.orderable === true ? '_order' : undefined,
payload: req.payload,
query,
req,
useAsTitle: collectionConfig.admin.useAsTitle,
viewType
}));
}
} catch (err) {
if (err.name !== 'QueryError') {
// QueryErrors are expected when a user filters by a field they do not have access to
req.payload.logger.error({
err,
msg: `There was an error fetching the list view data for collection ${collectionSlug}`
});
throw err;
}
}
const renderedFilters = renderFilters(collectionConfig.fields, req.payload.importMap);
const resolvedFilterOptions = await resolveAllFilterOptions({
fields: collectionConfig.fields,
req
});
const staticDescription = typeof collectionConfig.admin.description === 'function' ? collectionConfig.admin.description({
t: i18n.t
}) : collectionConfig.admin.description;
const newDocumentURL = formatAdminURL({
adminRoute,
path: `/collections/${collectionSlug}/create`
});
const hasCreatePermission = permissions?.collections?.[collectionSlug]?.create;
const hasDeletePermission = permissions?.collections?.[collectionSlug]?.delete;
// Check if there's a notFound query parameter (document ID that wasn't found)
const notFoundDocId = typeof searchParams?.notFound === 'string' ? searchParams.notFound : null;
const serverProps = {
collectionConfig,
data,
i18n,
limit: query.limit,
listPreferences: collectionPreferences,
listSearchableFields: collectionConfig.admin.listSearchableFields,
locale: fullLocale,
params,
payload,
permissions,
searchParams,
user
};
const listViewSlots = renderListViewSlots({
clientProps: {
collectionSlug,
hasCreatePermission,
hasDeletePermission,
newDocumentURL
},
collectionConfig,
description: staticDescription,
notFoundDocId,
payload,
serverProps
});
const isInDrawer = Boolean(drawerSlug);
// Needed to prevent: Only plain objects can be passed to Client Components from Server Components. Objects with toJSON methods are not supported. Convert it manually to a simple value before passing it to props.
// Is there a way to avoid this? The `where` object is already seemingly plain, but is not bc it originates from the params.
query.where = query?.where ? JSON.parse(JSON.stringify(query?.where || {})) : undefined;
return {
List: /*#__PURE__*/_jsxs(Fragment, {
children: [/*#__PURE__*/_jsx(HydrateAuthProvider, {
permissions: permissions
}), /*#__PURE__*/_jsx(ListQueryProvider, {
collectionSlug: collectionSlug,
data: data,
modifySearchParams: !isInDrawer,
orderableFieldName: collectionConfig.orderable === true ? '_order' : undefined,
query: query,
children: RenderServerComponent({
clientProps: {
...listViewSlots,
collectionSlug,
columnState,
disableBulkDelete,
disableBulkEdit: collectionConfig.disableBulkEdit ?? disableBulkEdit,
disableQueryPresets,
enableRowSelections,
hasCreatePermission,
hasDeletePermission,
listPreferences: collectionPreferences,
newDocumentURL,
queryPreset,
queryPresetPermissions,
renderedFilters,
resolvedFilterOptions,
Table,
viewType
},
Component: ComponentOverride ?? collectionConfig?.admin?.components?.views?.list?.Component,
Fallback: DefaultListView,
importMap: payload.importMap,
serverProps
})
})]
})
};
};
export const ListView = async args => {
try {
const {
List: RenderedList
} = await renderListView({
...args,
enableRowSelections: true
});
return RenderedList;
} catch (error) {
// Pass through Next.js errors
if (error.message === 'not-found') {
notFound();
} else {
console.error(error); // eslint-disable-line no-console
}
}
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ToastContainer/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IACpC,MAAM,EAAE,YAAY,CAAA;CACrB,CAqCA,CAAA"}

View File

@@ -0,0 +1,23 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
let cachedDebuggerEnabled;
/**
* Was the debugger enabled when this function was first called?
*/
async function isDebuggerEnabled() {
if (cachedDebuggerEnabled === undefined) {
try {
// Node can be built without inspector support
const inspector = await import('node:inspector');
cachedDebuggerEnabled = !!inspector.url();
} catch {
cachedDebuggerEnabled = false;
}
}
return cachedDebuggerEnabled;
}
exports.isDebuggerEnabled = isDebuggerEnabled;
//# sourceMappingURL=debug.js.map

View File

@@ -0,0 +1,5 @@
export declare const eachMonthOfIntervalWithOptions: import("./types.js").FPFn2<
Date[],
import("../eachMonthOfInterval.js").EachMonthOfIntervalOptions | undefined,
import("../fp.js").Interval<Date>
>;

View File

@@ -0,0 +1,132 @@
![React Email code-block cover](https://react.email/static/covers/code-block.png)
<div align="center"><strong>@react-email/code-block</strong></div>
<div align="center">Display code with a selected theme and regex highlighting using Prism.js.</div>
<br />
<div align="center">
<a href="https://react.email">Website</a>
<span> · </span>
<a href="https://github.com/resend/react-email">GitHub</a>
<span> · </span>
<a href="https://react.email/discord">Discord</a>
</div>
## Install
Install component from your command line.
#### With yarn
```sh
yarn add @react-email/code-block -E
```
#### With npm
```sh
npm install @react-email/code-block -E
```
## Getting Started
Add the component into your email component as follows.
```jsx
import { CodeBlock, dracula } from "@react-email/code-block";
const Email = () => {
const code = `export default async (req, res) => {
try {
const html = await renderAsync(
EmailTemplate({ firstName: 'John' })
);
return NextResponse.json({ html });
} catch (error) {
return NextResponse.json({ error });
}
}`;
return (
<CodeBlock
code={code}
lineNumbers // add this so that there are line numbers beside each code line
theme={dracula}
language="javascript"
/>
);
};
```
This should render a code-block with the desired theme.
## Theming
Themes for this component are basically a set of styles for each kind of token that can result from prismjs's tokenization. See [here](https://prismjs.com/tokens.html) for more information on the tokens available.
An example of a theme would be this:
```json
{
"base": {
"color": "#f8f8f2",
"background": "#282a36",
"textShadow": "0 1px rgba(0, 0, 0, 0.3)",
"fontFamily": "Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",
"textAlign": "left",
"whiteSpace": "pre",
"wordSpacing": "normal",
"wordBreak": "normal",
"wordWrap": "normal",
"lineHeight": "1.5",
"MozTabSize": "4",
"OTabSize": "4",
"tabSize": "4",
"WebkitHyphens": "none",
"MozHyphens": "none",
"MsHyphens": "none",
"hyphens": "none",
"padding": "1em",
"margin": ".5em 0",
"overflow": "auto",
"borderRadius": "0.3em"
},
"comment": {
"color": "#6272a4"
},
"prolog": {
"color": "#6272a4"
},
"doctype": {
"color": "#6272a4"
},
"cdata": {
"color": "#6272a4"
},
"punctuation": {
"color": "#f8f8f2"
},
"property": {
"color": "#ff79c6"
}
// ...
}
```
Each token type can have their own defined styles and for each one of there can be any styles that can be applied directly to `React` elements.
As you can see from the example `dracula` theme though, there is a defined property called `base` which is the styling for the `pre` element that wraps the HTML being rendered.
For you to not need to defined a theme without any basis, or to not define one that already has been defined, we have many default themes exported from `@react-email/code-block`.
These themes were generated by a bit of code that converts a CSS file for a prismjs theme into a object theme of these.
If you want to generate a theme from another existing prismjs theme you can do so by looking into [this](https://github.com/gabrielmfern/from-prismjs-to-react-email-code-block-theme).
## Support
This component was tested using the most popular email clients.
| <img src="https://react.email/static/icons/gmail.svg" width="48px" height="48px" alt="Gmail logo"> | <img src="https://react.email/static/icons/apple-mail.svg" width="48px" height="48px" alt="Apple Mail"> | <img src="https://react.email/static/icons/outlook.svg" width="48px" height="48px" alt="Outlook logo"> | <img src="https://react.email/static/icons/yahoo-mail.svg" width="48px" height="48px" alt="Yahoo! Mail logo"> | <img src="https://react.email/static/icons/hey.svg" width="48px" height="48px" alt="HEY logo"> | <img src="https://react.email/static/icons/superhuman.svg" width="48px" height="48px" alt="Superhuman logo"> |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
## License
MIT License

View File

@@ -0,0 +1 @@
{"version":3,"file":"signal-high.js","sources":["../../../src/icons/signal-high.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SignalHigh\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMGguMDEiIC8+CiAgPHBhdGggZD0iTTcgMjB2LTQiIC8+CiAgPHBhdGggZD0iTTEyIDIwdi04IiAvPgogIDxwYXRoIGQ9Ik0xNyAyMFY4IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/signal-high\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 SignalHigh = createLucideIcon('SignalHigh', [\n ['path', { d: 'M2 20h.01', key: '4haj6o' }],\n ['path', { d: 'M7 20v-4', key: 'j294jx' }],\n ['path', { d: 'M12 20v-8', key: 'i3yub9' }],\n ['path', { d: 'M17 20V8', key: '1tkaf5' }],\n]);\n\nexport default SignalHigh;\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,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,22 @@
var _typeof = require("./typeof.js")["default"];
function _interopRequireWildcard(e, t) {
if ("function" == typeof WeakMap) var r = new WeakMap(),
n = new WeakMap();
return (module.exports = _interopRequireWildcard = function _interopRequireWildcard(e, t) {
if (!t && e && e.__esModule) return e;
var o,
i,
f = {
__proto__: null,
"default": e
};
if (null === e || "object" != _typeof(e) && "function" != typeof e) return f;
if (o = t ? n : r) {
if (o.has(e)) return o.get(e);
o.set(e, f);
}
for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]);
return f;
}, module.exports.__esModule = true, module.exports["default"] = module.exports)(e, t);
}
module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports;

View File

@@ -0,0 +1,22 @@
var createMathOperation = require('./_createMathOperation');
/**
* Multiply two numbers.
*
* @static
* @memberOf _
* @since 4.7.0
* @category Math
* @param {number} multiplier The first number in a multiplication.
* @param {number} multiplicand The second number in a multiplication.
* @returns {number} Returns the product.
* @example
*
* _.multiply(6, 4);
* // => 24
*/
var multiply = createMathOperation(function(multiplier, multiplicand) {
return multiplier * multiplicand;
}, 1);
module.exports = multiply;

View File

@@ -0,0 +1 @@
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/collections/config/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EAG1B,MAAM,YAAY,CAAA;AAyBnB,eAAO,MAAM,kBAAkB,WACrB,MAAM,cACF,gBAAgB,iCAKG,KAAK,CAAC,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,wBAC1D,MAAM,EAAE,KAC7B,OAAO,CAAC,yBAAyB,CAgRnC,CAAA"}

View File

@@ -0,0 +1,5 @@
import { browserTracingIntegrationShim, consoleLoggingIntegrationShim, feedbackIntegrationShim, loggerShim, replayIntegrationShim } from '@sentry-internal/integration-shims';
export * from './index.bundle.base';
export { consoleLoggingIntegrationShim as consoleLoggingIntegration, loggerShim as logger };
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration, replayIntegrationShim as replayIntegration, };
//# sourceMappingURL=index.bundle.d.ts.map

View File

@@ -0,0 +1,197 @@
/**
* The `node:trace_events` module provides a mechanism to centralize tracing information
* generated by V8, Node.js core, and userspace code.
*
* Tracing can be enabled with the `--trace-event-categories` command-line flag
* or by using the `trace_events` module. The `--trace-event-categories` flag
* accepts a list of comma-separated category names.
*
* The available categories are:
*
* * `node`: An empty placeholder.
* * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html) trace data.
* The [`async_hooks`](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
* * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
* * `node.console`: Enables capture of `console.time()` and `console.count()` output.
* * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
* * `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
* * `node.dns.native`: Enables capture of trace data for DNS queries.
* * `node.net.native`: Enables capture of trace data for network.
* * `node.environment`: Enables capture of Node.js Environment milestones.
* * `node.fs.sync`: Enables capture of trace data for file system sync methods.
* * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods.
* * `node.fs.async`: Enables capture of trace data for file system async methods.
* * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods.
* * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v22.x/api/perf_hooks.html) measurements.
* * `node.perf.usertiming`: Enables capture of only Performance API User Timing
* measures and marks.
* * `node.perf.timerify`: Enables capture of only Performance API timerify
* measurements.
* * `node.promises.rejections`: Enables capture of trace data tracking the number
* of unhandled Promise rejections and handled-after-rejections.
* * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
* * `v8`: The [V8](https://nodejs.org/docs/latest-v22.x/api/v8.html) events are GC, compiling, and execution related.
* * `node.http`: Enables capture of trace data for http request / response.
*
* By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
*
* ```bash
* node --trace-event-categories v8,node,node.async_hooks server.js
* ```
*
* Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag _may_ still be
* used and will enable the `node`, `node.async_hooks`, and `v8` trace event categories by default.
*
* ```bash
* node --trace-events-enabled
*
* # is equivalent to
*
* node --trace-event-categories v8,node,node.async_hooks
* ```
*
* Alternatively, trace events may be enabled using the `node:trace_events` module:
*
* ```js
* import trace_events from 'node:trace_events';
* const tracing = trace_events.createTracing({ categories: ['node.perf'] });
* tracing.enable(); // Enable trace event capture for the 'node.perf' category
*
* // do work
*
* tracing.disable(); // Disable trace event capture for the 'node.perf' category
* ```
*
* Running Node.js with tracing enabled will produce log files that can be opened
* in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
*
* The logging file is by default called `node_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can
* be specified with `--trace-event-file-pattern` that accepts a template
* string that supports `${rotation}` and `${pid}`:
*
* ```bash
* node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
* ```
*
* To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
* in your code, such as:
*
* ```js
* process.on('SIGINT', function onSigint() {
* console.info('Received SIGINT.');
* process.exit(130); // Or applicable exit code depending on OS and signal
* });
* ```
*
* The tracing system uses the same time source
* as the one used by `process.hrtime()`.
* However the trace-event timestamps are expressed in microseconds,
* unlike `process.hrtime()` which returns nanoseconds.
*
* The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html#class-worker) threads.
* @experimental
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/trace_events.js)
*/
declare module "trace_events" {
/**
* The `Tracing` object is used to enable or disable tracing for sets of
* categories. Instances are created using the
* `trace_events.createTracing()` method.
*
* When created, the `Tracing` object is disabled. Calling the
* `tracing.enable()` method adds the categories to the set of enabled trace
* event categories. Calling `tracing.disable()` will remove the categories
* from the set of enabled trace event categories.
*/
interface Tracing {
/**
* A comma-separated list of the trace event categories covered by this
* `Tracing` object.
* @since v10.0.0
*/
readonly categories: string;
/**
* Disables this `Tracing` object.
*
* Only trace event categories _not_ covered by other enabled `Tracing`
* objects and _not_ specified by the `--trace-event-categories` flag
* will be disabled.
*
* ```js
* import trace_events from 'node:trace_events';
* const t1 = trace_events.createTracing({ categories: ['node', 'v8'] });
* const t2 = trace_events.createTracing({ categories: ['node.perf', 'node'] });
* t1.enable();
* t2.enable();
*
* // Prints 'node,node.perf,v8'
* console.log(trace_events.getEnabledCategories());
*
* t2.disable(); // Will only disable emission of the 'node.perf' category
*
* // Prints 'node,v8'
* console.log(trace_events.getEnabledCategories());
* ```
* @since v10.0.0
*/
disable(): void;
/**
* Enables this `Tracing` object for the set of categories covered by
* the `Tracing` object.
* @since v10.0.0
*/
enable(): void;
/**
* `true` only if the `Tracing` object has been enabled.
* @since v10.0.0
*/
readonly enabled: boolean;
}
interface CreateTracingOptions {
/**
* An array of trace category names. Values included in the array are
* coerced to a string when possible. An error will be thrown if the
* value cannot be coerced.
*/
categories: string[];
}
/**
* Creates and returns a `Tracing` object for the given set of `categories`.
*
* ```js
* import trace_events from 'node:trace_events';
* const categories = ['node.perf', 'node.async_hooks'];
* const tracing = trace_events.createTracing({ categories });
* tracing.enable();
* // do stuff
* tracing.disable();
* ```
* @since v10.0.0
*/
function createTracing(options: CreateTracingOptions): Tracing;
/**
* Returns a comma-separated list of all currently-enabled trace event
* categories. The current set of enabled trace event categories is determined
* by the _union_ of all currently-enabled `Tracing` objects and any categories
* enabled using the `--trace-event-categories` flag.
*
* Given the file `test.js` below, the command `node --trace-event-categories node.perf test.js` will print `'node.async_hooks,node.perf'` to the console.
*
* ```js
* import trace_events from 'node:trace_events';
* const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
* const t2 = trace_events.createTracing({ categories: ['node.perf'] });
* const t3 = trace_events.createTracing({ categories: ['v8'] });
*
* t1.enable();
* t2.enable();
*
* console.log(trace_events.getEnabledCategories());
* ```
* @since v10.0.0
*/
function getEnabledCategories(): string | undefined;
}
declare module "node:trace_events" {
export * from "trace_events";
}

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 FileMusic = createLucideIcon("FileMusic", [
["circle", { cx: "14", cy: "16", r: "2", key: "1bzzi3" }],
["circle", { cx: "6", cy: "18", r: "2", key: "1fncim" }],
["path", { d: "M4 12.4V4a2 2 0 0 1 2-2h8.5L20 7.5V20a2 2 0 0 1-2 2h-7.5", key: "skc018" }],
["path", { d: "M8 18v-7.7L16 9v7", key: "1oie6o" }]
]);
export { FileMusic as default };
//# sourceMappingURL=file-music.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","useDocumentInfo","React","baseClass","VersionsPill","$","versionCount","t0","_jsx","className","children"],"sources":["../../../../../../src/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.tsx"],"sourcesContent":["'use client'\nimport { useDocumentInfo } from '@payloadcms/ui'\nimport React from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'pill-version-count'\n\nexport const VersionsPill: React.FC = () => {\n const { versionCount } = useDocumentInfo()\n\n if (!versionCount) {\n return null\n }\n\n return <span className={baseClass}>{versionCount}</span>\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,eAAe,QAAQ;AAChC,OAAOC,KAAA,MAAW;AAIlB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,YAAA,GAAyBA,CAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACpC;IAAAM;EAAA,IAAyBL,eAAA;EAAA,KAEpBK,YAAA;IAAA;EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAF,CAAA,QAAAC,YAAA;IAIEC,EAAA,GAAAC,IAAA,CAAC;MAAAC,SAAA,EAAAN,SAAA;MAAAO,QAAA,EAA4BJ;IAAA,C;;;;;;SAA7BC,E;CACT","ignoreList":[]}

View File

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

View File

@@ -0,0 +1,249 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ref_js_1 = __importDefault(require("./ref.js"));
const pointer_js_1 = __importDefault(require("./pointer.js"));
const ono_1 = require("@jsdevtools/ono");
const url = __importStar(require("./util/url.js"));
const errors_1 = require("./util/errors");
exports.default = dereference;
/**
* Crawls the JSON schema, finds all JSON references, and dereferences them.
* This method mutates the JSON schema object, replacing JSON references with their resolved value.
*
* @param parser
* @param options
*/
function dereference(parser, options) {
const start = Date.now();
// console.log('Dereferencing $ref pointers in %s', parser.$refs._root$Ref.path);
const dereferenced = crawl(parser.schema, parser.$refs._root$Ref.path, "#", new Set(), new Set(), new Map(), parser.$refs, options, start);
parser.$refs.circular = dereferenced.circular;
parser.schema = dereferenced.value;
}
/**
* Recursively crawls the given value, and dereferences any JSON references.
*
* @param obj - The value to crawl. If it's not an object or array, it will be ignored.
* @param path - The full path of `obj`, possibly with a JSON Pointer in the hash
* @param pathFromRoot - The path of `obj` from the schema root
* @param parents - An array of the parent objects that have already been dereferenced
* @param processedObjects - An array of all the objects that have already been processed
* @param dereferencedCache - An map of all the dereferenced objects
* @param $refs
* @param options
* @param startTime - The time when the dereferencing started
* @returns
*/
function crawl(obj, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime) {
let dereferenced;
const result = {
value: obj,
circular: false,
};
if (options && options.timeoutMs) {
if (Date.now() - startTime > options.timeoutMs) {
throw new errors_1.TimeoutError(options.timeoutMs);
}
}
const derefOptions = (options.dereference || {});
const isExcludedPath = derefOptions.excludedPathMatcher || (() => false);
if (derefOptions?.circular === "ignore" || !processedObjects.has(obj)) {
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !isExcludedPath(pathFromRoot)) {
parents.add(obj);
processedObjects.add(obj);
if (ref_js_1.default.isAllowed$Ref(obj, options)) {
dereferenced = dereference$Ref(obj, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime);
result.circular = dereferenced.circular;
result.value = dereferenced.value;
}
else {
for (const key of Object.keys(obj)) {
const keyPath = pointer_js_1.default.join(path, key);
const keyPathFromRoot = pointer_js_1.default.join(pathFromRoot, key);
if (isExcludedPath(keyPathFromRoot)) {
continue;
}
const value = obj[key];
let circular = false;
if (ref_js_1.default.isAllowed$Ref(value, options)) {
dereferenced = dereference$Ref(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime);
circular = dereferenced.circular;
// Avoid pointless mutations; breaks frozen objects to no profit
if (obj[key] !== dereferenced.value) {
// If we have properties we want to preserve from our dereferenced schema then we need
// to copy them over to our new object.
const preserved = new Map();
if (derefOptions?.preservedProperties) {
if (typeof obj[key] === "object" && !Array.isArray(obj[key])) {
derefOptions?.preservedProperties.forEach((prop) => {
if (prop in obj[key]) {
preserved.set(prop, obj[key][prop]);
}
});
}
}
obj[key] = dereferenced.value;
// If we have data to preserve and our dereferenced object is still an object then
// we need copy back our preserved data into our dereferenced schema.
if (derefOptions?.preservedProperties) {
if (preserved.size && typeof obj[key] === "object" && !Array.isArray(obj[key])) {
preserved.forEach((value, prop) => {
obj[key][prop] = value;
});
}
}
derefOptions?.onDereference?.(value.$ref, obj[key], obj, key);
}
}
else {
if (!parents.has(value)) {
dereferenced = crawl(value, keyPath, keyPathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime);
circular = dereferenced.circular;
// Avoid pointless mutations; breaks frozen objects to no profit
if (obj[key] !== dereferenced.value) {
obj[key] = dereferenced.value;
}
}
else {
circular = foundCircularReference(keyPath, $refs, options);
}
}
// Set the "isCircular" flag if this or any other property is circular
result.circular = result.circular || circular;
}
}
parents.delete(obj);
}
}
return result;
}
/**
* Dereferences the given JSON Reference, and then crawls the resulting value.
*
* @param $ref - The JSON Reference to resolve
* @param path - The full path of `$ref`, possibly with a JSON Pointer in the hash
* @param pathFromRoot - The path of `$ref` from the schema root
* @param parents - An array of the parent objects that have already been dereferenced
* @param processedObjects - An array of all the objects that have already been dereferenced
* @param dereferencedCache - An map of all the dereferenced objects
* @param $refs
* @param options
* @returns
*/
function dereference$Ref($ref, path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime) {
const isExternalRef = ref_js_1.default.isExternal$Ref($ref);
const shouldResolveOnCwd = isExternalRef && options?.dereference?.externalReferenceResolution === "root";
const $refPath = url.resolve(shouldResolveOnCwd ? url.cwd() : path, $ref.$ref);
const cache = dereferencedCache.get($refPath);
if (cache && !cache.circular) {
const refKeys = Object.keys($ref);
if (refKeys.length > 1) {
const extraKeys = {};
for (const key of refKeys) {
if (key !== "$ref" && !(key in cache.value)) {
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
extraKeys[key] = $ref[key];
}
}
return {
circular: cache.circular,
value: Object.assign({}, cache.value, extraKeys),
};
}
return cache;
}
const pointer = $refs._resolve($refPath, path, options);
if (pointer === null) {
return {
circular: false,
value: null,
};
}
// Check for circular references
const directCircular = pointer.circular;
let circular = directCircular || parents.has(pointer.value);
if (circular) {
foundCircularReference(path, $refs, options);
}
// Dereference the JSON reference
let dereferencedValue = ref_js_1.default.dereference($ref, pointer.value);
// Crawl the dereferenced value (unless it's circular)
if (!circular) {
// Determine if the dereferenced value is circular
const dereferenced = crawl(dereferencedValue, pointer.path, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime);
circular = dereferenced.circular;
dereferencedValue = dereferenced.value;
}
if (circular && !directCircular && options.dereference?.circular === "ignore") {
// The user has chosen to "ignore" circular references, so don't change the value
dereferencedValue = $ref;
}
if (directCircular) {
// The pointer is a DIRECT circular reference (i.e. it references itself).
// So replace the $ref path with the absolute path from the JSON Schema root
dereferencedValue.$ref = pathFromRoot;
}
const dereferencedObject = {
circular,
value: dereferencedValue,
};
// only cache if no extra properties than $ref
if (Object.keys($ref).length === 1) {
dereferencedCache.set($refPath, dereferencedObject);
}
return dereferencedObject;
}
/**
* Called when a circular reference is found.
* It sets the {@link $Refs#circular} flag, executes the options.dereference.onCircular callback,
* and throws an error if options.dereference.circular is false.
*
* @param keyPath - The JSON Reference path of the circular reference
* @param $refs
* @param options
* @returns - always returns true, to indicate that a circular reference was found
*/
function foundCircularReference(keyPath, $refs, options) {
$refs.circular = true;
options?.dereference?.onCircular?.(keyPath);
if (!options.dereference.circular) {
throw ono_1.ono.reference(`Circular $ref pointer found at ${keyPath}`);
}
return true;
}

View File

@@ -0,0 +1 @@
!function(e){var n={pattern:/[\s\S]+/,inside:null};e.languages.v=e.languages.extend("clike",{string:{pattern:/r?(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,alias:"quoted-string",greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\{[^{}]*\}|\w+(?:\.\w+(?:\([^\(\)]*\))?|\[[^\[\]]+\])*)/,lookbehind:!0,inside:{"interpolation-variable":{pattern:/^\$\w[\s\S]*$/,alias:"variable"},"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},"interpolation-expression":n}}}},"class-name":{pattern:/(\b(?:enum|interface|struct|type)\s+)(?:C\.)?\w+/,lookbehind:!0},keyword:/(?:\b(?:__global|as|asm|assert|atomic|break|chan|const|continue|defer|else|embed|enum|fn|for|go(?:to)?|if|import|in|interface|is|lock|match|module|mut|none|or|pub|return|rlock|select|shared|sizeof|static|struct|type(?:of)?|union|unsafe)|\$(?:else|for|if)|#(?:flag|include))\b/,number:/\b(?:0x[a-f\d]+(?:_[a-f\d]+)*|0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?)\b/i,operator:/~|\?|[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\.?/,builtin:/\b(?:any(?:_float|_int)?|bool|byte(?:ptr)?|charptr|f(?:32|64)|i(?:8|16|64|128|nt)|rune|size_t|string|u(?:16|32|64|128)|voidptr)\b/}),n.inside=e.languages.v,e.languages.insertBefore("v","string",{char:{pattern:/`(?:\\`|\\?[^`]{1,2})`/,alias:"rune"}}),e.languages.insertBefore("v","operator",{attribute:{pattern:/(^[\t ]*)\[(?:deprecated|direct_array_access|flag|inline|live|ref_only|typedef|unsafe_fn|windows_stdcall)\]/m,lookbehind:!0,alias:"annotation",inside:{punctuation:/[\[\]]/,keyword:/\w+/}},generic:{pattern:/<\w+>(?=\s*[\)\{])/,inside:{punctuation:/[<>]/,"class-name":/\w+/}}}),e.languages.insertBefore("v","function",{"generic-function":{pattern:/\b\w+\s*<\w+>(?=\()/,inside:{function:/^\w+/,generic:{pattern:/<\w+>/,inside:e.languages.v.generic.inside}}}})}(Prism);

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_array_without_holes.cjs",
"module": "../../esm/_array_without_holes.js"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"iterateFields.d.ts","sourceRoot":"","sources":["../../../../src/forms/fieldSchemasToFormState/calculateDefaultValues/iterateFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,KAAK,EACL,cAAc,EACd,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACV,MAAM,SAAS,CAAA;AAIhB,KAAK,IAAI,CAAC,CAAC,IAAI;IACb,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,IAAI,CAAA;IACjB,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,aAAa,GAAU,CAAC,6EAUlC,IAAI,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,IAAI,CAoBxB,CAAA"}

View File

@@ -0,0 +1,161 @@
import { IncomingHttpHeaders } from './header'
import Client from './client'
export default Errors
declare namespace Errors {
export class UndiciError extends Error {
name: string
code: string
}
/** Connect timeout error. */
export class ConnectTimeoutError extends UndiciError {
name: 'ConnectTimeoutError'
code: 'UND_ERR_CONNECT_TIMEOUT'
}
/** A header exceeds the `headersTimeout` option. */
export class HeadersTimeoutError extends UndiciError {
name: 'HeadersTimeoutError'
code: 'UND_ERR_HEADERS_TIMEOUT'
}
/** Headers overflow error. */
export class HeadersOverflowError extends UndiciError {
name: 'HeadersOverflowError'
code: 'UND_ERR_HEADERS_OVERFLOW'
}
/** A body exceeds the `bodyTimeout` option. */
export class BodyTimeoutError extends UndiciError {
name: 'BodyTimeoutError'
code: 'UND_ERR_BODY_TIMEOUT'
}
export class ResponseError extends UndiciError {
constructor (
message: string,
code: number,
options: {
headers?: IncomingHttpHeaders | string[] | null,
body?: null | Record<string, any> | string
}
)
name: 'ResponseError'
code: 'UND_ERR_RESPONSE'
statusCode: number
body: null | Record<string, any> | string
headers: IncomingHttpHeaders | string[] | null
}
/** Passed an invalid argument. */
export class InvalidArgumentError extends UndiciError {
name: 'InvalidArgumentError'
code: 'UND_ERR_INVALID_ARG'
}
/** Returned an invalid value. */
export class InvalidReturnValueError extends UndiciError {
name: 'InvalidReturnValueError'
code: 'UND_ERR_INVALID_RETURN_VALUE'
}
/** The request has been aborted by the user. */
export class RequestAbortedError extends UndiciError {
name: 'AbortError'
code: 'UND_ERR_ABORTED'
}
/** Expected error with reason. */
export class InformationalError extends UndiciError {
name: 'InformationalError'
code: 'UND_ERR_INFO'
}
/** Request body length does not match content-length header. */
export class RequestContentLengthMismatchError extends UndiciError {
name: 'RequestContentLengthMismatchError'
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
}
/** Response body length does not match content-length header. */
export class ResponseContentLengthMismatchError extends UndiciError {
name: 'ResponseContentLengthMismatchError'
code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
}
/** Trying to use a destroyed client. */
export class ClientDestroyedError extends UndiciError {
name: 'ClientDestroyedError'
code: 'UND_ERR_DESTROYED'
}
/** Trying to use a closed client. */
export class ClientClosedError extends UndiciError {
name: 'ClientClosedError'
code: 'UND_ERR_CLOSED'
}
/** There is an error with the socket. */
export class SocketError extends UndiciError {
name: 'SocketError'
code: 'UND_ERR_SOCKET'
socket: Client.SocketInfo | null
}
/** Encountered unsupported functionality. */
export class NotSupportedError extends UndiciError {
name: 'NotSupportedError'
code: 'UND_ERR_NOT_SUPPORTED'
}
/** No upstream has been added to the BalancedPool. */
export class BalancedPoolMissingUpstreamError extends UndiciError {
name: 'MissingUpstreamError'
code: 'UND_ERR_BPL_MISSING_UPSTREAM'
}
export class HTTPParserError extends UndiciError {
name: 'HTTPParserError'
code: string
}
/** The response exceed the length allowed. */
export class ResponseExceededMaxSizeError extends UndiciError {
name: 'ResponseExceededMaxSizeError'
code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
}
export class RequestRetryError extends UndiciError {
constructor (
message: string,
statusCode: number,
headers?: IncomingHttpHeaders | string[] | null,
body?: null | Record<string, any> | string
)
name: 'RequestRetryError'
code: 'UND_ERR_REQ_RETRY'
statusCode: number
data: {
count: number;
}
headers: Record<string, string | string[]>
}
export class SecureProxyConnectionError extends UndiciError {
constructor (
cause?: Error,
message?: string,
options?: Record<any, any>
)
name: 'SecureProxyConnectionError'
code: 'UND_ERR_PRX_TLS'
}
class MaxOriginsReachedError extends UndiciError {
name: 'MaxOriginsReachedError'
code: 'UND_ERR_MAX_ORIGINS_REACHED'
}
}

View File

@@ -0,0 +1,2 @@
const e=(e,t,n)=>()=>({method:`POST`,path:`/utils/sort/${e}`,body:JSON.stringify({item:t,to:n})});export{e as utilitySort};
//# sourceMappingURL=sort.js.map

View File

@@ -0,0 +1,64 @@
import type { FindOptions, GlobalSlug, Payload, RequestContext, TypedLocale } from '../../../index.js';
import type { Document, PayloadRequest, PopulateType, SelectType } from '../../../types/index.js';
import type { TypeWithVersion } from '../../../versions/types.js';
import type { DataFromGlobalSlug } from '../../config/types.js';
export type Options<TSlug extends GlobalSlug> = {
/**
* [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
* which can be read by hooks. Useful if you want to pass additional information to the hooks which
* shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
* to determine if it should run or not.
*/
context?: RequestContext;
/**
* [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.
*/
depth?: number;
/**
* When set to `true`, errors will not be thrown.
* `null` will be returned instead, if the document on this ID was not found.
*/
disableErrors?: boolean;
/**
* Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.
*/
fallbackLocale?: false | TypedLocale;
/**
* The ID of the version to find.
*/
id: number | string;
/**
* Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.
*/
locale?: 'all' | TypedLocale;
/**
* Skip access control.
* Set to `false` if you want to respect Access Control for the operation, for example when fetching data for the front-end.
* @default true
*/
overrideAccess?: boolean;
/**
* Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.
*/
populate?: PopulateType;
/**
* The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.
* Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.
*/
req?: Partial<PayloadRequest>;
/**
* Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.
* @default false
*/
showHiddenFields?: boolean;
/**
* the Global slug to operate against.
*/
slug: TSlug;
/**
* If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.
*/
user?: Document;
} & Pick<FindOptions<string, SelectType>, 'select'>;
export declare function findGlobalVersionByIDLocal<TSlug extends GlobalSlug>(payload: Payload, options: Options<TSlug>): Promise<TypeWithVersion<DataFromGlobalSlug<TSlug>>>;
//# sourceMappingURL=findVersionByID.d.ts.map

View File

@@ -0,0 +1,322 @@
'use strict'
const { collectASequenceOfCodePointsFast } = require('../infra')
const { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')
const { isCTLExcludingHtab } = require('./util')
const assert = require('node:assert')
const { unescape: qsUnescape } = require('node:querystring')
/**
* @description Parses the field-value attributes of a set-cookie header string.
* @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
* @param {string} header
* @returns {import('./index').Cookie|null} if the header is invalid, null will be returned
*/
function parseSetCookie (header) {
// 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
// character (CTL characters excluding HTAB): Abort these steps and
// ignore the set-cookie-string entirely.
if (isCTLExcludingHtab(header)) {
return null
}
let nameValuePair = ''
let unparsedAttributes = ''
let name = ''
let value = ''
// 2. If the set-cookie-string contains a %x3B (";") character:
if (header.includes(';')) {
// 1. The name-value-pair string consists of the characters up to,
// but not including, the first %x3B (";"), and the unparsed-
// attributes consist of the remainder of the set-cookie-string
// (including the %x3B (";") in question).
const position = { position: 0 }
nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
unparsedAttributes = header.slice(position.position)
} else {
// Otherwise:
// 1. The name-value-pair string consists of all the characters
// contained in the set-cookie-string, and the unparsed-
// attributes is the empty string.
nameValuePair = header
}
// 3. If the name-value-pair string lacks a %x3D ("=") character, then
// the name string is empty, and the value string is the value of
// name-value-pair.
if (!nameValuePair.includes('=')) {
value = nameValuePair
} else {
// Otherwise, the name string consists of the characters up to, but
// not including, the first %x3D ("=") character, and the (possibly
// empty) value string consists of the characters after the first
// %x3D ("=") character.
const position = { position: 0 }
name = collectASequenceOfCodePointsFast(
'=',
nameValuePair,
position
)
value = nameValuePair.slice(position.position + 1)
}
// 4. Remove any leading or trailing WSP characters from the name
// string and the value string.
name = name.trim()
value = value.trim()
// 5. If the sum of the lengths of the name string and the value string
// is more than 4096 octets, abort these steps and ignore the set-
// cookie-string entirely.
if (name.length + value.length > maxNameValuePairSize) {
return null
}
// 6. The cookie-name is the name string, and the cookie-value is the
// value string.
// https://datatracker.ietf.org/doc/html/rfc6265
// To maximize compatibility with user agents, servers that wish to
// store arbitrary data in a cookie-value SHOULD encode that data, for
// example, using Base64 [RFC4648].
return {
name, value: qsUnescape(value), ...parseUnparsedAttributes(unparsedAttributes)
}
}
/**
* Parses the remaining attributes of a set-cookie header
* @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
* @param {string} unparsedAttributes
* @param {Object.<string, unknown>} [cookieAttributeList={}]
*/
function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
// 1. If the unparsed-attributes string is empty, skip the rest of
// these steps.
if (unparsedAttributes.length === 0) {
return cookieAttributeList
}
// 2. Discard the first character of the unparsed-attributes (which
// will be a %x3B (";") character).
assert(unparsedAttributes[0] === ';')
unparsedAttributes = unparsedAttributes.slice(1)
let cookieAv = ''
// 3. If the remaining unparsed-attributes contains a %x3B (";")
// character:
if (unparsedAttributes.includes(';')) {
// 1. Consume the characters of the unparsed-attributes up to, but
// not including, the first %x3B (";") character.
cookieAv = collectASequenceOfCodePointsFast(
';',
unparsedAttributes,
{ position: 0 }
)
unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
} else {
// Otherwise:
// 1. Consume the remainder of the unparsed-attributes.
cookieAv = unparsedAttributes
unparsedAttributes = ''
}
// Let the cookie-av string be the characters consumed in this step.
let attributeName = ''
let attributeValue = ''
// 4. If the cookie-av string contains a %x3D ("=") character:
if (cookieAv.includes('=')) {
// 1. The (possibly empty) attribute-name string consists of the
// characters up to, but not including, the first %x3D ("=")
// character, and the (possibly empty) attribute-value string
// consists of the characters after the first %x3D ("=")
// character.
const position = { position: 0 }
attributeName = collectASequenceOfCodePointsFast(
'=',
cookieAv,
position
)
attributeValue = cookieAv.slice(position.position + 1)
} else {
// Otherwise:
// 1. The attribute-name string consists of the entire cookie-av
// string, and the attribute-value string is empty.
attributeName = cookieAv
}
// 5. Remove any leading or trailing WSP characters from the attribute-
// name string and the attribute-value string.
attributeName = attributeName.trim()
attributeValue = attributeValue.trim()
// 6. If the attribute-value is longer than 1024 octets, ignore the
// cookie-av string and return to Step 1 of this algorithm.
if (attributeValue.length > maxAttributeValueSize) {
return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
}
// 7. Process the attribute-name and attribute-value according to the
// requirements in the following subsections. (Notice that
// attributes with unrecognized attribute-names are ignored.)
const attributeNameLowercase = attributeName.toLowerCase()
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
// If the attribute-name case-insensitively matches the string
// "Expires", the user agent MUST process the cookie-av as follows.
if (attributeNameLowercase === 'expires') {
// 1. Let the expiry-time be the result of parsing the attribute-value
// as cookie-date (see Section 5.1.1).
const expiryTime = new Date(attributeValue)
// 2. If the attribute-value failed to parse as a cookie date, ignore
// the cookie-av.
cookieAttributeList.expires = expiryTime
} else if (attributeNameLowercase === 'max-age') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
// If the attribute-name case-insensitively matches the string "Max-
// Age", the user agent MUST process the cookie-av as follows.
// 1. If the first character of the attribute-value is not a DIGIT or a
// "-" character, ignore the cookie-av.
const charCode = attributeValue.charCodeAt(0)
if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
}
// 2. If the remainder of attribute-value contains a non-DIGIT
// character, ignore the cookie-av.
if (!/^\d+$/.test(attributeValue)) {
return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
}
// 3. Let delta-seconds be the attribute-value converted to an integer.
const deltaSeconds = Number(attributeValue)
// 4. Let cookie-age-limit be the maximum age of the cookie (which
// SHOULD be 400 days or less, see Section 4.1.2.2).
// 5. Set delta-seconds to the smaller of its present value and cookie-
// age-limit.
// deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
// 6. If delta-seconds is less than or equal to zero (0), let expiry-
// time be the earliest representable date and time. Otherwise, let
// the expiry-time be the current date and time plus delta-seconds
// seconds.
// const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
// 7. Append an attribute to the cookie-attribute-list with an
// attribute-name of Max-Age and an attribute-value of expiry-time.
cookieAttributeList.maxAge = deltaSeconds
} else if (attributeNameLowercase === 'domain') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
// If the attribute-name case-insensitively matches the string "Domain",
// the user agent MUST process the cookie-av as follows.
// 1. Let cookie-domain be the attribute-value.
let cookieDomain = attributeValue
// 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
// cookie-domain without its leading %x2E (".").
if (cookieDomain[0] === '.') {
cookieDomain = cookieDomain.slice(1)
}
// 3. Convert the cookie-domain to lower case.
cookieDomain = cookieDomain.toLowerCase()
// 4. Append an attribute to the cookie-attribute-list with an
// attribute-name of Domain and an attribute-value of cookie-domain.
cookieAttributeList.domain = cookieDomain
} else if (attributeNameLowercase === 'path') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
// If the attribute-name case-insensitively matches the string "Path",
// the user agent MUST process the cookie-av as follows.
// 1. If the attribute-value is empty or if the first character of the
// attribute-value is not %x2F ("/"):
let cookiePath = ''
if (attributeValue.length === 0 || attributeValue[0] !== '/') {
// 1. Let cookie-path be the default-path.
cookiePath = '/'
} else {
// Otherwise:
// 1. Let cookie-path be the attribute-value.
cookiePath = attributeValue
}
// 2. Append an attribute to the cookie-attribute-list with an
// attribute-name of Path and an attribute-value of cookie-path.
cookieAttributeList.path = cookiePath
} else if (attributeNameLowercase === 'secure') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
// If the attribute-name case-insensitively matches the string "Secure",
// the user agent MUST append an attribute to the cookie-attribute-list
// with an attribute-name of Secure and an empty attribute-value.
cookieAttributeList.secure = true
} else if (attributeNameLowercase === 'httponly') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
// If the attribute-name case-insensitively matches the string
// "HttpOnly", the user agent MUST append an attribute to the cookie-
// attribute-list with an attribute-name of HttpOnly and an empty
// attribute-value.
cookieAttributeList.httpOnly = true
} else if (attributeNameLowercase === 'samesite') {
// https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
// If the attribute-name case-insensitively matches the string
// "SameSite", the user agent MUST process the cookie-av as follows:
// 1. Let enforcement be "Default".
let enforcement = 'Default'
const attributeValueLowercase = attributeValue.toLowerCase()
// 2. If cookie-av's attribute-value is a case-insensitive match for
// "None", set enforcement to "None".
if (attributeValueLowercase.includes('none')) {
enforcement = 'None'
}
// 3. If cookie-av's attribute-value is a case-insensitive match for
// "Strict", set enforcement to "Strict".
if (attributeValueLowercase.includes('strict')) {
enforcement = 'Strict'
}
// 4. If cookie-av's attribute-value is a case-insensitive match for
// "Lax", set enforcement to "Lax".
if (attributeValueLowercase.includes('lax')) {
enforcement = 'Lax'
}
// 5. Append an attribute to the cookie-attribute-list with an
// attribute-name of "SameSite" and an attribute-value of
// enforcement.
cookieAttributeList.sameSite = enforcement
} else {
cookieAttributeList.unparsed ??= []
cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
}
// 8. Return to Step 1 of this algorithm.
return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
}
module.exports = {
parseSetCookie,
parseUnparsedAttributes
}

View File

@@ -0,0 +1,8 @@
'use strict';
var call = Function.prototype.call;
var $hasOwn = Object.prototype.hasOwnProperty;
var bind = require('function-bind');
/** @type {import('.')} */
module.exports = bind.call(call, $hasOwn);

View File

@@ -0,0 +1,6 @@
export interface Opts {
algorithm: 'lookup' | 'best fit';
}
export declare function match(requestedLocales: readonly string[], availableLocales: readonly string[], defaultLocale: string, opts?: Opts): string;
export { LookupSupportedLocales } from './abstract/LookupSupportedLocales';
export { ResolveLocale } from './abstract/ResolveLocale';

View File

@@ -0,0 +1,199 @@
{
"name": "prettier",
"version": "3.4.2",
"description": "Prettier is an opinionated code formatter",
"bin": "./bin/prettier.cjs",
"repository": "prettier/prettier",
"funding": "https://github.com/prettier/prettier?sponsor=1",
"homepage": "https://prettier.io",
"author": "James Long",
"license": "MIT",
"main": "./index.cjs",
"browser": "./standalone.js",
"unpkg": "./standalone.js",
"exports": {
".": {
"types": "./index.d.ts",
"require": "./index.cjs",
"browser": {
"import": "./standalone.mjs",
"default": "./standalone.js"
},
"default": "./index.mjs"
},
"./*": "./*",
"./doc": {
"types": "./doc.d.ts",
"require": "./doc.js",
"default": "./doc.mjs"
},
"./standalone": {
"types": "./standalone.d.ts",
"require": "./standalone.js",
"default": "./standalone.mjs"
},
"./plugins/estree": {
"types": "./plugins/estree.d.ts",
"require": "./plugins/estree.js",
"default": "./plugins/estree.mjs"
},
"./plugins/babel": {
"types": "./plugins/babel.d.ts",
"require": "./plugins/babel.js",
"default": "./plugins/babel.mjs"
},
"./plugins/flow": {
"types": "./plugins/flow.d.ts",
"require": "./plugins/flow.js",
"default": "./plugins/flow.mjs"
},
"./plugins/typescript": {
"types": "./plugins/typescript.d.ts",
"require": "./plugins/typescript.js",
"default": "./plugins/typescript.mjs"
},
"./plugins/acorn": {
"types": "./plugins/acorn.d.ts",
"require": "./plugins/acorn.js",
"default": "./plugins/acorn.mjs"
},
"./plugins/meriyah": {
"types": "./plugins/meriyah.d.ts",
"require": "./plugins/meriyah.js",
"default": "./plugins/meriyah.mjs"
},
"./plugins/angular": {
"types": "./plugins/angular.d.ts",
"require": "./plugins/angular.js",
"default": "./plugins/angular.mjs"
},
"./plugins/postcss": {
"types": "./plugins/postcss.d.ts",
"require": "./plugins/postcss.js",
"default": "./plugins/postcss.mjs"
},
"./plugins/graphql": {
"types": "./plugins/graphql.d.ts",
"require": "./plugins/graphql.js",
"default": "./plugins/graphql.mjs"
},
"./plugins/markdown": {
"types": "./plugins/markdown.d.ts",
"require": "./plugins/markdown.js",
"default": "./plugins/markdown.mjs"
},
"./plugins/glimmer": {
"types": "./plugins/glimmer.d.ts",
"require": "./plugins/glimmer.js",
"default": "./plugins/glimmer.mjs"
},
"./plugins/html": {
"types": "./plugins/html.d.ts",
"require": "./plugins/html.js",
"default": "./plugins/html.mjs"
},
"./plugins/yaml": {
"types": "./plugins/yaml.d.ts",
"require": "./plugins/yaml.js",
"default": "./plugins/yaml.mjs"
},
"./esm/standalone.mjs": "./standalone.mjs",
"./parser-babel": "./plugins/babel.js",
"./parser-babel.js": "./plugins/babel.js",
"./esm/parser-babel.mjs": "./plugins/babel.mjs",
"./parser-flow": "./plugins/flow.js",
"./parser-flow.js": "./plugins/flow.js",
"./esm/parser-flow.mjs": "./plugins/flow.mjs",
"./parser-typescript": "./plugins/typescript.js",
"./parser-typescript.js": "./plugins/typescript.js",
"./esm/parser-typescript.mjs": "./plugins/typescript.mjs",
"./parser-espree": "./plugins/acorn.js",
"./parser-espree.js": "./plugins/acorn.js",
"./esm/parser-espree.mjs": "./plugins/acorn.mjs",
"./parser-meriyah": "./plugins/meriyah.js",
"./parser-meriyah.js": "./plugins/meriyah.js",
"./esm/parser-meriyah.mjs": "./plugins/meriyah.mjs",
"./parser-angular": "./plugins/angular.js",
"./parser-angular.js": "./plugins/angular.js",
"./esm/parser-angular.mjs": "./plugins/angular.mjs",
"./parser-postcss": "./plugins/postcss.js",
"./parser-postcss.js": "./plugins/postcss.js",
"./esm/parser-postcss.mjs": "./plugins/postcss.mjs",
"./parser-graphql": "./plugins/graphql.js",
"./parser-graphql.js": "./plugins/graphql.js",
"./esm/parser-graphql.mjs": "./plugins/graphql.mjs",
"./parser-markdown": "./plugins/markdown.js",
"./parser-markdown.js": "./plugins/markdown.js",
"./esm/parser-markdown.mjs": "./plugins/markdown.mjs",
"./parser-glimmer": "./plugins/glimmer.js",
"./parser-glimmer.js": "./plugins/glimmer.js",
"./esm/parser-glimmer.mjs": "./plugins/glimmer.mjs",
"./parser-html": "./plugins/html.js",
"./parser-html.js": "./plugins/html.js",
"./esm/parser-html.mjs": "./plugins/html.mjs",
"./parser-yaml": "./plugins/yaml.js",
"./parser-yaml.js": "./plugins/yaml.js",
"./esm/parser-yaml.mjs": "./plugins/yaml.mjs"
},
"engines": {
"node": ">=14"
},
"files": [
"LICENSE",
"README.md",
"bin/prettier.cjs",
"doc.d.ts",
"doc.js",
"doc.mjs",
"index.cjs",
"index.d.ts",
"index.d.ts",
"index.mjs",
"internal/cli.mjs",
"package.json",
"plugins/acorn.d.ts",
"plugins/acorn.js",
"plugins/acorn.mjs",
"plugins/angular.d.ts",
"plugins/angular.js",
"plugins/angular.mjs",
"plugins/babel.d.ts",
"plugins/babel.js",
"plugins/babel.mjs",
"plugins/estree.d.ts",
"plugins/estree.js",
"plugins/estree.mjs",
"plugins/flow.d.ts",
"plugins/flow.js",
"plugins/flow.mjs",
"plugins/glimmer.d.ts",
"plugins/glimmer.js",
"plugins/glimmer.mjs",
"plugins/graphql.d.ts",
"plugins/graphql.js",
"plugins/graphql.mjs",
"plugins/html.d.ts",
"plugins/html.js",
"plugins/html.mjs",
"plugins/markdown.d.ts",
"plugins/markdown.js",
"plugins/markdown.mjs",
"plugins/meriyah.d.ts",
"plugins/meriyah.js",
"plugins/meriyah.mjs",
"plugins/postcss.d.ts",
"plugins/postcss.js",
"plugins/postcss.mjs",
"plugins/typescript.d.ts",
"plugins/typescript.js",
"plugins/typescript.mjs",
"plugins/yaml.d.ts",
"plugins/yaml.js",
"plugins/yaml.mjs",
"standalone.d.ts",
"standalone.js",
"standalone.mjs"
],
"preferUnplugged": true,
"type": "commonjs"
}

View File

@@ -0,0 +1,9 @@
import type { DayPickerProps, SharedProps, TimePickerProps } from 'payload';
export type Props = {
id?: string;
onChange?: (val: Date) => void;
placeholder?: string;
readOnly?: boolean;
value?: Date | string;
} & DayPickerProps & SharedProps & TimePickerProps;
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1,154 @@
import crypto from 'crypto';
import { status as httpStatus } from 'http-status';
import { URL } from 'url';
import { buildAfterOperation } from '../../collections/operations/utilities/buildAfterOperation.js';
import { buildBeforeOperation } from '../../collections/operations/utilities/buildBeforeOperation.js';
import { APIError } from '../../errors/index.js';
import { Forbidden } from '../../index.js';
import { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js';
import { commitTransaction } from '../../utilities/commitTransaction.js';
import { formatAdminURL } from '../../utilities/formatAdminURL.js';
import { initTransaction } from '../../utilities/initTransaction.js';
import { killTransaction } from '../../utilities/killTransaction.js';
import { getLoginOptions } from '../getLoginOptions.js';
export const forgotPasswordOperation = async (incomingArgs)=>{
const loginWithUsername = incomingArgs.collection.config.auth.loginWithUsername;
const { data, overrideAccess } = incomingArgs;
const { canLoginWithEmail, canLoginWithUsername } = getLoginOptions(loginWithUsername);
const sanitizedEmail = canLoginWithEmail && (incomingArgs.data.email || '').toLowerCase().trim() || null;
const sanitizedUsername = 'username' in data && typeof data?.username === 'string' ? data.username.toLowerCase().trim() : null;
let args = incomingArgs;
if (incomingArgs.collection.config.auth.disableLocalStrategy) {
throw new Forbidden(incomingArgs.req.t);
}
if (!sanitizedEmail && !sanitizedUsername) {
throw new APIError(`Missing ${loginWithUsername ? 'username' : 'email'}.`, httpStatus.BAD_REQUEST);
}
try {
const shouldCommit = await initTransaction(args.req);
// /////////////////////////////////////
// beforeOperation - Collection
// /////////////////////////////////////
args = await buildBeforeOperation({
args,
collection: args.collection.config,
operation: 'forgotPassword',
overrideAccess
});
const { collection: { config: collectionConfig }, disableEmail, expiration, req: { payload: { config, email }, payload }, req } = args;
// /////////////////////////////////////
// Forget password
// /////////////////////////////////////
let token = crypto.randomBytes(20).toString('hex');
if (!sanitizedEmail && !sanitizedUsername) {
throw new APIError(`Missing ${loginWithUsername ? 'username' : 'email'}.`, httpStatus.BAD_REQUEST);
}
let whereConstraint = {};
if (canLoginWithEmail && sanitizedEmail) {
whereConstraint = {
email: {
equals: sanitizedEmail
}
};
} else if (canLoginWithUsername && sanitizedUsername) {
whereConstraint = {
username: {
equals: sanitizedUsername
}
};
}
// Exclude trashed users unless `trash: true`
whereConstraint = appendNonTrashedFilter({
enableTrash: collectionConfig.trash,
trash: false,
where: whereConstraint
});
let user = await payload.db.findOne({
collection: collectionConfig.slug,
req,
where: whereConstraint
});
// We don't want to indicate specifically that an email was not found,
// as doing so could lead to the exposure of registered emails.
// Therefore, we prefer to fail silently.
if (!user) {
await commitTransaction(args.req);
return null;
}
const resetPasswordExpiration = new Date(Date.now() + (collectionConfig.auth?.forgotPassword?.expiration ?? expiration ?? 3600000)).toISOString();
user = await payload.update({
id: user.id,
collection: collectionConfig.slug,
data: {
resetPasswordExpiration,
resetPasswordToken: token
},
req
});
if (!disableEmail && user.email) {
const protocol = new URL(req.url).protocol // includes the final :
;
const serverURL = config.serverURL !== null && config.serverURL !== '' ? config.serverURL : `${protocol}//${req.headers.get('host')}`;
const forgotURL = formatAdminURL({
adminRoute: config.routes.admin,
path: `${config.admin.routes.reset}/${token}`,
serverURL
});
let html = `${req.t('authentication:youAreReceivingResetPassword')}
<a href="${forgotURL}">${forgotURL}</a>
${req.t('authentication:youDidNotRequestPassword')}`;
if (typeof collectionConfig.auth.forgotPassword?.generateEmailHTML === 'function') {
html = await collectionConfig.auth.forgotPassword.generateEmailHTML({
req,
token,
user
});
}
let subject = req.t('authentication:resetYourPassword');
if (typeof collectionConfig.auth.forgotPassword?.generateEmailSubject === 'function') {
subject = await collectionConfig.auth.forgotPassword.generateEmailSubject({
req,
token,
user
});
}
await email.sendEmail({
from: `"${email.defaultFromName}" <${email.defaultFromAddress}>`,
html,
subject,
to: user.email
});
}
// /////////////////////////////////////
// afterForgotPassword - Collection
// /////////////////////////////////////
if (collectionConfig.hooks?.afterForgotPassword?.length) {
for (const hook of collectionConfig.hooks.afterForgotPassword){
await hook({
args,
collection: args.collection?.config,
context: req.context
});
}
}
// /////////////////////////////////////
// afterOperation - Collection
// /////////////////////////////////////
token = await buildAfterOperation({
args,
collection: args.collection?.config,
operation: 'forgotPassword',
overrideAccess,
result: token
});
if (shouldCommit) {
await commitTransaction(req);
}
return token;
} catch (error) {
await killTransaction(args.req);
throw error;
}
};
//# sourceMappingURL=forgotPassword.js.map

View File

@@ -0,0 +1 @@
import t from"next-intl/config";export{default}from"next-intl/config";

View File

@@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var libsql_exports = {};
module.exports = __toCommonJS(libsql_exports);
__reExport(libsql_exports, require("./driver.cjs"), module.exports);
__reExport(libsql_exports, require("./session.cjs"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
...require("./driver.cjs"),
...require("./session.cjs")
});
//# sourceMappingURL=index.cjs.map

View File

@@ -0,0 +1,27 @@
import { status as httpStatus } from 'http-status';
import { headersWithCors } from '../../utilities/headersWithCors.js';
import { accessOperation } from '../operations/access.js';
export const accessHandler = async (req)=>{
const headers = headersWithCors({
headers: new Headers(),
req
});
try {
const results = await accessOperation({
req
});
return Response.json(results, {
headers,
status: httpStatus.OK
});
} catch (e) {
return Response.json({
error: e
}, {
headers,
status: httpStatus.INTERNAL_SERVER_ERROR
});
}
};
//# sourceMappingURL=access.js.map

View File

@@ -0,0 +1,309 @@
<p align="center">
<img src="https://cdn.jsdelivr.net/gh/hexagon/croner@master/croner.png" alt="Croner" width="150" height="150"><br>
Trigger functions or evaluate cron expressions in JavaScript or TypeScript. No dependencies. All features. Node. Deno. Bun. Browser. <br><br>Try it live on <a href="https://jsfiddle.net/hexag0n/hoa8kwsb/">jsfiddle</a>, and check out the full documentation on <a href="https://croner.56k.guru">croner.56k.guru</a>.<br>
</p>
# Croner - Cron for JavaScript and TypeScript
[![npm version](https://badge.fury.io/js/croner.svg)](https://badge.fury.io/js/croner) [![JSR](https://jsr.io/badges/@hexagon/croner)](https://jsr.io/@hexagon/croner) [![NPM Downloads](https://img.shields.io/npm/dw/croner.svg)](https://www.npmjs.org/package/croner)
![No dependencies](https://img.shields.io/badge/dependencies-none-brightgreen) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Hexagon/croner/blob/master/LICENSE)
* Trigger functions in JavaScript using [Cron](https://en.wikipedia.org/wiki/Cron#CRON_expression) syntax.
* Evaluate cron expressions and get a list of upcoming run times.
* Uses Vixie-cron [pattern](#pattern), with additional features such as `L` for last day and weekday of month and `#` for nth weekday of month.
* Works in Node.js >=18 (both require and import), Deno >=1.16 and Bun >=1.0.0.
* Works in browsers as standalone, UMD or ES-module.
* Target different [time zones](https://croner.56k.guru/usage/examples/#time-zone).
* Built-in [overrun protection](https://croner.56k.guru/usage/examples/#overrun-protection)
* Built-in [error handling](https://croner.56k.guru/usage/examples/#error-handling)
* Includes [TypeScript](https://www.typescriptlang.org/) typings.
* Support for asynchronous functions.
* Pause, resume, or stop execution after a task is scheduled.
* Operates in-memory, with no need for a database or configuration files.
* Zero dependencies.
Quick examples:
```javascript
// Basic: Run a function at the interval defined by a cron expression
const job = new Cron('*/5 * * * * *', () => {
console.log('This will run every fifth second');
});
// Enumeration: What dates do the next 100 sundays occur on?
const nextSundays = new Cron('0 0 0 * * 7').nextRuns(100);
console.log(nextSundays);
// Days left to a specific date
const msLeft = new Cron('59 59 23 24 DEC *').nextRun() - new Date();
console.log(Math.floor(msLeft/1000/3600/24) + " days left to next christmas eve");
// Run a function at a specific date/time using a non-local timezone (time is ISO 8601 local time)
// This will run 2024-01-23 00:00:00 according to the time in Asia/Kolkata
new Cron('2024-01-23T00:00:00', { timezone: 'Asia/Kolkata' }, () => { console.log('Yay!') });
```
More [examples](https://croner.56k.guru/usage/examples/)...
## Installation
Full documentation on installation and usage is found at <https://croner.56k.guru>
> **Note**
> If you are migrating from a different library such as `cron` or `node-cron`, or upgrading from a older version of croner, see the [migration section](https://croner.56k.guru/migration/) of the manual.
Install croner using your favorite package manager or CDN, then include it in you project:
Using Node.js or Bun
```javascript
// ESM Import ...
import { Cron } from "croner";
// ... or CommonJS Require, destructure to add type hints
const { Cron } = require("croner");
```
Using Deno
```typescript
// From deno.land/x
import { Cron } from "https://deno.land/x/croner@8.1.2/dist/croner.js";
// ... or jsr.io
import { Cron } from "jsr:@hexagon/croner@8.1.2";
```
In a webpage using the UMD-module
```html
<script src="https://cdn.jsdelivr.net/npm/croner@8/dist/croner.umd.min.js"></script>
```
## Documentation
### Signature
Cron takes three arguments
* [pattern](#pattern)
* [options](#options) (optional)
* scheduled function (optional)
```javascript
// Parameters
// - First: Cron pattern, js date object (fire once), or ISO 8601 time string (fire once)
// - Second: Options (optional)
// - Third: Function run trigger (optional)
const job = new Cron("* * * * * *", { maxRuns: 1 }, () => {} );
// If function is omitted in constructor, it can be scheduled later
job.schedule(job, /* optional */ context) => {});
```
The job will be sceduled to run at next matching time unless you supply option `{ paused: true }`. The `new Cron(...)` constructor will return a Cron instance, later called `job`, which have a couple of methods and properties listed below.
#### Status
```javascript
job.nextRun( /*optional*/ startFromDate ); // Get a Date object representing the next run.
job.nextRuns(10, /*optional*/ startFromDate ); // Get an array of Dates, containing the next n runs.
job.msToNext( /*optional*/ startFromDate ); // Get the milliseconds left until the next execution.
job.currentRun(); // Get a Date object showing when the current (or last) run was started.
job.previousRun( ); // Get a Date object showing when the previous job was started.
job.isRunning(); // Indicates if the job is scheduled and not paused or killed (true or false).
job.isStopped(); // Indicates if the job is permanently stopped using `stop()` (true or false).
job.isBusy(); // Indicates if the job is currently busy doing work (true or false).
job.getPattern(); // Returns the original pattern string
```
#### Control functions
```javascript
job.trigger(); // Force a trigger instantly
job.pause(); // Pause trigger
job.resume(); // Resume trigger
job.stop(); // Stop the job completely. It is not possible to resume after this.
// Note that this also removes named jobs from the exported `scheduledJobs` array.
```
#### Properties
```javascript
job.name // Optional job name, populated if a name were passed to options
```
#### Options
| Key | Default value | Data type | Remarks |
|--------------|----------------|----------------|---------------------------------------|
| name | undefined | String | If you specify a name for the job, Croner will keep a reference to the job in the exported array `scheduledJobs`. The reference will be removed on `.stop()`. |
| maxRuns | Infinite | Number | |
| catch | false | Boolean\|Function | Catch unhandled errors in triggered function. Passing `true` will silently ignore errors. Passing a callback function will trigger this callback on error. |
| timezone | undefined | String | Timezone in Europe/Stockholm format |
| startAt | undefined | String | ISO 8601 formatted datetime (2021-10-17T23:43:00)<br>in local time (according to timezone parameter if passed) |
| stopAt | undefined | String | ISO 8601 formatted datetime (2021-10-17T23:43:00)<br>in local time (according to timezone parameter if passed) |
| interval | 0 | Number | Minimum number of seconds between triggers. |
| paused | false | Boolean | If the job should be paused from start. |
| context | undefined | Any | Passed as the second parameter to triggered function |
| legacyMode | true | boolean | Combine day-of-month and day-of-week using true = OR, false = AND |
| unref | false | boolean | Setting this to true unrefs the internal timer, which allows the process to exit even if a cron job is running. |
| utcOffset | undefined | number | Schedule using a specific utc offset in minutes. This does not take care of daylight savings time, you probably want to use option `timezone` instead. |
| protect | undefined | boolean\|Function | Enabled over-run protection. Will block new triggers as long as an old trigger is in progress. Pass either `true` or a callback function to enable |
> **Warning**
> Unreferencing timers (option `unref`) is only supported by Node.js and Deno.
> Browsers have not yet implemented this feature, and it does not make sense to use it in a browser environment.
#### Pattern
The expressions used by Croner are very similar to those of Vixie Cron, but with a few additions and changes as outlined below:
```javascript
// ┌──────────────── (optional) second (0 - 59)
// │ ┌────────────── minute (0 - 59)
// │ │ ┌──────────── hour (0 - 23)
// │ │ │ ┌────────── day of month (1 - 31)
// │ │ │ │ ┌──────── month (1 - 12, JAN-DEC)
// │ │ │ │ │ ┌────── day of week (0 - 6, SUN-Mon)
// │ │ │ │ │ │ (0 to 6 are Sunday to Saturday; 7 is Sunday, the same as 0)
// │ │ │ │ │ │
// * * * * * *
```
* Croner expressions have the following additional modifiers:
- *?*: The question mark is substituted with the time of initialization. For example, ? ? * * * * would be substituted with 25 8 * * * * if the time is <any hour>:08:25 at the time of new Cron('? ? * * * *', <...>). The question mark can be used in any field.
- *L*: The letter 'L' can be used in the day of the month field to indicate the last day of the month. When used in the day of the week field in conjunction with the # character, it denotes the last specific weekday of the month. For example, `5#L` represents the last Friday of the month.
- *#*: The # character specifies the "nth" occurrence of a particular day within a month. For example, supplying
`5#2` in the day of week field signifies the second Friday of the month. This can be combined with ranges and supports day names. For instance, MON-FRI#2 would match the Monday through Friday of the second week of the month.
* Croner allows you to pass a JavaScript Date object or an ISO 8601 formatted string as a pattern. The scheduled function will trigger at the specified date/time and only once. If you use a timezone different from the local timezone, you should pass the ISO 8601 local time in the target location and specify the timezone using the options (2nd parameter).
* Croner also allows you to change how the day-of-week and day-of-month conditions are combined. By default, Croner (and Vixie cron) will trigger when either the day-of-month OR the day-of-week conditions match. For example, `0 20 1 * MON` will trigger on the first of the month as well as each Monday. If you want to use AND (so that it only triggers on Mondays that are also the first of the month), you can pass `{ legacyMode: false }`. For more information, see issue [#53](https://github.com/Hexagon/croner/issues/53).
| Field | Required | Allowed values | Allowed special characters | Remarks |
|--------------|----------|----------------|----------------------------|---------------------------------------|
| Seconds | Optional | 0-59 | * , - / ? | |
| Minutes | Yes | 0-59 | * , - / ? | |
| Hours | Yes | 0-23 | * , - / ? | |
| Day of Month | Yes | 1-31 | * , - / ? L | |
| Month | Yes | 1-12 or JAN-DEC| * , - / ? | |
| Day of Week | Yes | 0-7 or SUN-MON | * , - / ? L # | 0 to 6 are Sunday to Saturday<br>7 is Sunday, the same as 0<br># is used to specify nth occurrence of a weekday |
> **Note**
> Weekday and month names are case-insensitive. Both `MON` and `mon` work.
> When using `L` in the Day of Week field, it affects all specified weekdays. For example, `5-6#L` means the last Friday and Saturday in the month."
> The # character can be used to specify the "nth" weekday of the month. For example, 5#2 represents the second Friday of the month.
It is also possible to use the following "nicknames" as pattern.
| Nickname | Description |
| -------- | ----------- |
| \@yearly | Run once a year, ie. "0 0 1 1 *". |
| \@annually | Run once a year, ie. "0 0 1 1 *". |
| \@monthly | Run once a month, ie. "0 0 1 * *". |
| \@weekly | Run once a week, ie. "0 0 * * 0". |
| \@daily | Run once a day, ie. "0 0 * * *". |
| \@hourly | Run once an hour, ie. "0 * * * *". |
## Why another JavaScript cron implementation
Because the existing ones are not good enough. They have serious bugs, use bloated dependencies, do not work in all environments, and/or simply do not work as expected.
| | croner | cronosjs | node-cron | cron | node-schedule |
|---------------------------|:-------------------:|:-------------------:|:---------:|:-------------------------:|:-------------------:|
| **Platforms** |
| Node.js (CommonJS) | ✓ | ✓ | ✓ | ✓ | ✓ |
| Browser (ESMCommonJS) | ✓ | ✓ | | | |
| Deno (ESM) | ✓ | | | | |
| **Features** |
| Over-run protection | ✓ | | | | |
| Error handling | ✓ | | | | ✓ |
| Typescript typings | ✓ | ✓ | | ✓ | |
| Unref timers (optional) | ✓ | | | ✓ | |
| dom-OR-dow | ✓ | ✓ | ✓ | ✓ | ✓ |
| dom-AND-dow (optional) | ✓ | | | | |
| Next run | ✓ | ✓ | | ✓ | ✓ |
| Next n runs | ✓ | ✓ | | ✓ | |
| Timezone | ✓ | ✓ | ✓ | ✓ | ✓ |
| Minimum interval | ✓ | | | | |
| Controls (stop/resume) | ✓ | ✓ | ✓ | ✓ | ✓ |
| Range (0-13) | ✓ | ✓ | ✓ | ✓ | ✓ |
| Stepping (*/5) | ✓ | ✓ | ✓ | ✓ | ✓ |
| Last day of month (L) | ✓ | ✓ | | | |
| Nth weekday of month (#) | ✓ | ✓ | | | |
<details>
<summary>In depth comparison of various libraries</summary>
| | croner | cronosjs | node-cron | cron | node-schedule |
|---------------------------|:-------------------:|:-------------------:|:---------:|:-------------------------:|:-------------------:|
| **Size** |
| Minified size (KB) | 17.0 | 14.9 | 15.2 | 85.4 :warning: | 100.5 :warning: |
| Bundlephobia minzip (KB) | 5.0 | 5.1 | 5.7 | 25.8 | 29.2 :warning: |
| Dependencies | 0 | 0 | 1 | 1 | 3 :warning: |
| **Popularity** |
| Downloads/week [^1] | 2019K | 31K | 447K | 1366K | 1046K |
| **Quality** |
| Issues [^1] | 0 | 2 | 133 :warning: | 13 | 145 :warning: |
| Code coverage | 99% | 98% | 100% | 81% | 94% |
| **Performance** |
| Ops/s `1 2 3 4 5 6` | 160 651 | 55 593 | N/A :x: | 6 313 :warning: | 2 726 :warning: |
| Ops/s `0 0 0 29 2 *` | 176 714 | 67 920 | N/A :x: | 3 104 :warning: | 737 :warning: |
| **Tests** | **11/11** | **10/11** | **0/11** [^4] :question: | **7/11** :warning: | **9/11** |
> **Note**
> * Table last updated at 2023-10-10
> * node-cron has no interface to predict when the function will run, so tests cannot be carried out.
> * All tests and benchmarks were carried out using [https://github.com/Hexagon/cron-comparison](https://github.com/Hexagon/cron-comparison)
[^1]: As of 2023-10-10
[^2]: Requires support for L-modifier
[^3]: In dom-AND-dow mode, only supported by croner at the moment.
[^4]: Node-cron has no way of showing next run time.
</details>
## Development
### Master branch
![Node.js CI](https://github.com/Hexagon/croner/workflows/Node.js%20CI/badge.svg?branch=master) ![Deno CI](https://github.com/Hexagon/croner/workflows/Deno%20CI/badge.svg?branch=master) ![Bun CI](https://github.com/Hexagon/croner/workflows/Bun%20CI/badge.svg?branch=master)
This branch contains the latest stable code, released on npm's default channel `latest`. You can install the latest stable revision by running the command below.
```
npm install croner --save
```
### Dev branch
![Node.js CI](https://github.com/Hexagon/croner/workflows/Node.js%20CI/badge.svg?branch=dev) ![Deno CI](https://github.com/Hexagon/croner/workflows/Deno%20CI/badge.svg?branch=dev) ![Bun CI](https://github.com/Hexagon/croner/workflows/Bun%20CI/badge.svg?branch=dev)
This branch contains code currently being tested, and is released at channel `dev` on npm. You can install the latest revision of the development branch by running the command below.
```
npm install croner@dev
```
> **Warning**
> Expect breaking changes if you do not pin to a specific version.
A list of fixes and features currently released in the `dev` branch is available [here](https://github.com/Hexagon/croner/issues?q=is%3Aopen+is%3Aissue+label%3Areleased-in-dev)
## Contributing & Support
Croner is founded and actively maintained by Hexagon. If you find value in Croner and want to contribute:
- Code Contributions: See our [Contribution Guide](https://croner.56k.guru/contributing/) for details on how to contribute code.
- Sponsorship and Donations: See [github.com/sponsors/hexagon](https://github.com/sponsors/hexagon)
Your trust, support, and contributions drive the project. Every bit, irrespective of its size, is deeply appreciated.
## License
MIT License

View File

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

View File

@@ -0,0 +1,147 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const ono_1 = require("@jsdevtools/ono");
const url = __importStar(require("../util/url.js"));
const errors_js_1 = require("../util/errors.js");
exports.default = {
/**
* The order that this resolver will run, in relation to other resolvers.
*/
order: 200,
/**
* HTTP headers to send when downloading files.
*
* @example:
* {
* "User-Agent": "JSON Schema $Ref Parser",
* Accept: "application/json"
* }
*/
headers: null,
/**
* HTTP request timeout (in milliseconds).
*/
timeout: 60000, // 60 seconds
/**
* The maximum number of HTTP redirects to follow.
* To disable automatic following of redirects, set this to zero.
*/
redirects: 5,
/**
* The `withCredentials` option of XMLHttpRequest.
* Set this to `true` if you're downloading files from a CORS-enabled server that requires authentication
*/
withCredentials: false,
/**
* Determines whether this resolver can read a given file reference.
* Resolvers that return true will be tried in order, until one successfully resolves the file.
* Resolvers that return false will not be given a chance to resolve the file.
*/
canRead(file) {
return url.isHttp(file.url);
},
/**
* Reads the given URL and returns its raw contents as a Buffer.
*/
read(file) {
const u = url.parse(file.url);
if (typeof window !== "undefined" && !u.protocol) {
// Use the protocol of the current page
u.protocol = url.parse(location.href).protocol;
}
return download(u, this);
},
};
/**
* Downloads the given file.
* @returns
* The promise resolves with the raw downloaded data, or rejects if there is an HTTP error.
*/
async function download(u, httpOptions, _redirects) {
u = url.parse(u);
const redirects = _redirects || [];
redirects.push(u.href);
try {
const res = await get(u, httpOptions);
if (res.status >= 400) {
throw (0, ono_1.ono)({ status: res.status }, `HTTP ERROR ${res.status}`);
}
else if (res.status >= 300) {
if (!Number.isNaN(httpOptions.redirects) && redirects.length > httpOptions.redirects) {
throw new errors_js_1.ResolverError((0, ono_1.ono)({ status: res.status }, `Error downloading ${redirects[0]}. \nToo many redirects: \n ${redirects.join(" \n ")}`));
}
else if (!("location" in res.headers) || !res.headers.location) {
throw (0, ono_1.ono)({ status: res.status }, `HTTP ${res.status} redirect with no location header`);
}
else {
const redirectTo = url.resolve(u.href, res.headers.location);
return download(redirectTo, httpOptions, redirects);
}
}
else {
if (res.body) {
const buf = await res.arrayBuffer();
return Buffer.from(buf);
}
return Buffer.alloc(0);
}
}
catch (err) {
throw new errors_js_1.ResolverError((0, ono_1.ono)(err, `Error downloading ${u.href}`), u.href);
}
}
/**
* Sends an HTTP GET request.
* The promise resolves with the HTTP Response object.
*/
async function get(u, httpOptions) {
let controller;
let timeoutId;
if (httpOptions.timeout) {
controller = new AbortController();
timeoutId = setTimeout(() => controller.abort(), httpOptions.timeout);
}
const response = await fetch(u, {
method: "GET",
headers: httpOptions.headers || {},
credentials: httpOptions.withCredentials ? "include" : "same-origin",
signal: controller ? controller.signal : null,
});
if (timeoutId) {
clearTimeout(timeoutId);
}
return response;
}

View File

@@ -0,0 +1,188 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Priority queue that processes tasks in natural ordering (lower priority first)
* accoridng to the priority computed by the function passed in the constructor.
*
* FIFO ordering isn't guaranteed for tasks with the same priority.
*
* Worker specific tasks with the same priority as a non-worker specific task
* are always processed first.
*/
class PriorityQueue {
constructor(_computePriority) {
_defineProperty(this, '_queue', []);
_defineProperty(this, '_sharedQueue', new MinHeap());
this._computePriority = _computePriority;
}
enqueue(task, workerId) {
if (workerId == null) {
this._enqueue(task, this._sharedQueue);
} else {
const queue = this._getWorkerQueue(workerId);
this._enqueue(task, queue);
}
}
_enqueue(task, queue) {
const item = {
priority: this._computePriority(task.request[2], ...task.request[3]),
task
};
queue.add(item);
}
dequeue(workerId) {
const workerQueue = this._getWorkerQueue(workerId);
const workerTop = workerQueue.peek();
const sharedTop = this._sharedQueue.peek(); // use the task from the worker queue if there's no task in the shared queue
// or if the priority of the worker queue is smaller or equal to the
// priority of the top task in the shared queue. The tasks of the
// worker specific queue are preferred because no other worker can pick this
// specific task up.
if (
sharedTop == null ||
(workerTop != null && workerTop.priority <= sharedTop.priority)
) {
var _workerQueue$poll$tas, _workerQueue$poll;
return (_workerQueue$poll$tas =
(_workerQueue$poll = workerQueue.poll()) === null ||
_workerQueue$poll === void 0
? void 0
: _workerQueue$poll.task) !== null && _workerQueue$poll$tas !== void 0
? _workerQueue$poll$tas
: null;
}
return this._sharedQueue.poll().task;
}
_getWorkerQueue(workerId) {
let queue = this._queue[workerId];
if (queue == null) {
queue = this._queue[workerId] = new MinHeap();
}
return queue;
}
}
exports.default = PriorityQueue;
class MinHeap {
constructor() {
_defineProperty(this, '_heap', []);
}
peek() {
var _this$_heap$;
return (_this$_heap$ = this._heap[0]) !== null && _this$_heap$ !== void 0
? _this$_heap$
: null;
}
add(item) {
const nodes = this._heap;
nodes.push(item);
if (nodes.length === 1) {
return;
}
let currentIndex = nodes.length - 1; // Bubble up the added node as long as the parent is bigger
while (currentIndex > 0) {
const parentIndex = Math.floor((currentIndex + 1) / 2) - 1;
const parent = nodes[parentIndex];
if (parent.priority <= item.priority) {
break;
}
nodes[currentIndex] = parent;
nodes[parentIndex] = item;
currentIndex = parentIndex;
}
}
poll() {
const nodes = this._heap;
const result = nodes[0];
const lastElement = nodes.pop(); // heap was empty or removed the last element
if (result == null || nodes.length === 0) {
return result !== null && result !== void 0 ? result : null;
}
let index = 0;
nodes[0] =
lastElement !== null && lastElement !== void 0 ? lastElement : null;
const element = nodes[0];
while (true) {
let swapIndex = null;
const rightChildIndex = (index + 1) * 2;
const leftChildIndex = rightChildIndex - 1;
const rightChild = nodes[rightChildIndex];
const leftChild = nodes[leftChildIndex]; // if the left child is smaller, swap with the left
if (leftChild != null && leftChild.priority < element.priority) {
swapIndex = leftChildIndex;
} // If the right child is smaller or the right child is smaller than the left
// then swap with the right child
if (
rightChild != null &&
rightChild.priority < (swapIndex == null ? element : leftChild).priority
) {
swapIndex = rightChildIndex;
}
if (swapIndex == null) {
break;
}
nodes[index] = nodes[swapIndex];
nodes[swapIndex] = element;
index = swapIndex;
}
return result;
}
}

View File

@@ -0,0 +1,29 @@
import { DirectusNotification } from "../../../schema/notification.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/create/notifications.d.ts
type CreateNotificationOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusNotification<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* Create multiple new notifications.
*
* @param items The notifications to create
* @param query Optional return data query
*
* @returns Returns the notification object for the created notification.
*/
declare const createNotifications: <Schema, const TQuery extends Query<Schema, DirectusNotification<Schema>>>(items: NestedPartial<DirectusNotification<Schema>>[], query?: TQuery) => RestCommand<CreateNotificationOutput<Schema, TQuery>[], Schema>;
/**
* Create a new notification.
*
* @param item The notification to create
* @param query Optional return data query
*
* @returns Returns the notification object for the created notification.
*/
declare const createNotification: <Schema, const TQuery extends Query<Schema, DirectusNotification<Schema>>>(item: NestedPartial<DirectusNotification<Schema>>, query?: TQuery) => RestCommand<CreateNotificationOutput<Schema, TQuery>, Schema>;
//#endregion
export { CreateNotificationOutput, createNotification, createNotifications };
//# sourceMappingURL=notifications.d.ts.map

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.05194,"52":0.07792,"56":0.00649,"96":0.00649,"103":0.00649,"115":0.42205,"125":0.03247,"128":0.00649,"136":0.01948,"137":0.00649,"139":0.00649,"140":0.17531,"141":0.00649,"142":0.00649,"143":0.02597,"144":0.01299,"145":0.58437,"146":0.96096,"147":0.00649,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 97 98 99 100 101 102 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 126 127 129 130 131 132 133 134 135 138 148 149 3.5 3.6"},D:{"49":0.01299,"69":0.05194,"70":0.00649,"77":0.00649,"79":0.01948,"81":0.00649,"86":0.00649,"87":0.01299,"88":0.00649,"89":0.05844,"90":0.00649,"97":0.00649,"98":0.02597,"99":0.00649,"100":0.00649,"101":0.00649,"102":0.00649,"103":0.17531,"104":0.21427,"105":0.16233,"106":0.20778,"107":0.16233,"108":0.17531,"109":4.62951,"110":0.16233,"111":0.24673,"112":9.22655,"113":0.00649,"114":0.01948,"115":0.01299,"116":0.35062,"117":0.16233,"118":0.00649,"119":0.03247,"120":0.27271,"121":0.01299,"122":0.0909,"123":0.02597,"124":0.22726,"125":0.43503,"126":2.21411,"127":0.01948,"128":0.05844,"129":0.01948,"130":0.00649,"131":0.3701,"132":0.07142,"133":0.36361,"134":0.1818,"135":0.05844,"136":0.04545,"137":0.02597,"138":0.10389,"139":0.38309,"140":0.21427,"141":0.1883,"142":6.38911,"143":11.65494,"144":0.00649,"145":0.01299,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 71 72 73 74 75 76 78 80 83 84 85 91 92 93 94 95 96 146"},F:{"36":0.01299,"73":0.20128,"77":0.05844,"79":0.0909,"82":0.00649,"83":0.00649,"84":0.00649,"85":0.04545,"86":0.07792,"90":0.00649,"91":0.00649,"92":0.00649,"93":0.08441,"95":0.73371,"98":0.00649,"114":0.00649,"117":0.00649,"119":0.00649,"120":0.01299,"121":0.00649,"122":0.01299,"123":0.03896,"124":3.09067,"125":1.46093,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 74 75 76 78 80 81 87 88 89 94 96 97 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 118 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00649,"109":0.02597,"122":0.00649,"131":0.00649,"132":0.00649,"133":0.00649,"134":0.00649,"135":0.00649,"136":0.00649,"137":0.00649,"138":0.00649,"139":0.00649,"140":0.00649,"141":0.05844,"142":0.62982,"143":2.4089,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 123 124 125 126 127 128 129 130"},E:{"13":0.05194,_:"0 4 5 6 7 8 9 10 11 12 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 16.0","13.1":0.01948,"14.1":0.00649,"15.4":0.01299,"15.5":0.00649,"15.6":0.07792,"16.1":0.03896,"16.2":0.02597,"16.3":0.02597,"16.4":0.00649,"16.5":0.08441,"16.6":0.14285,"17.0":0.00649,"17.1":0.23375,"17.2":0.01948,"17.3":0.01948,"17.4":0.05194,"17.5":0.0909,"17.6":0.10389,"18.0":0.04545,"18.1":0.03896,"18.2":0.01948,"18.3":0.05194,"18.4":0.02597,"18.5-18.6":0.14934,"26.0":0.08441,"26.1":0.81163,"26.2":0.22726,"26.3":0.00649},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00248,"5.0-5.1":0,"6.0-6.1":0.00497,"7.0-7.1":0.00373,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00993,"10.0-10.2":0.00124,"10.3":0.01739,"11.0-11.2":0.21359,"11.3-11.4":0.00621,"12.0-12.1":0.00497,"12.2-12.5":0.05588,"13.0-13.1":0.00124,"13.2":0.00869,"13.3":0.00248,"13.4-13.7":0.00869,"14.0-14.4":0.01739,"14.5-14.8":0.01863,"15.0-15.1":0.01987,"15.2-15.3":0.0149,"15.4":0.01614,"15.5":0.01739,"15.6-15.8":0.26948,"16.0":0.03105,"16.1":0.05961,"16.2":0.03105,"16.3":0.05588,"16.4":0.01366,"16.5":0.02359,"16.6-16.7":0.3502,"17.0":0.01987,"17.1":0.03229,"17.2":0.02359,"17.3":0.03601,"17.4":0.06085,"17.5":0.11922,"17.6-17.7":0.27569,"18.0":0.06209,"18.1":0.12915,"18.2":0.0683,"18.3":0.22229,"18.4":0.11425,"18.5-18.7":8.20352,"26.0":0.1602,"26.1":1.33248,"26.2":0.25333,"26.3":0.01118},P:{"4":0.04221,"25":0.01055,"26":0.01055,"27":0.01055,"28":0.03166,"29":1.03424,_:"20 21 22 23 24 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.02101,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00002},A:{"11":0.15583,_:"6 7 8 9 10 5.5"},K:{"0":0.70491,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.01403},O:{"0":0.02455},H:{"0":0},L:{"0":21.196},R:{_:"0"},M:{"0":0.08417}};

View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { EditorState, LexicalEditor } from 'lexical';
export type HistoryStateEntry = {
editor: LexicalEditor;
editorState: EditorState;
};
export type HistoryState = {
current: null | HistoryStateEntry;
redoStack: Array<HistoryStateEntry>;
undoStack: Array<HistoryStateEntry>;
};
/**
* Registers necessary listeners to manage undo/redo history stack and related editor commands.
* It returns `unregister` callback that cleans up all listeners and should be called on editor unmount.
* @param editor - The lexical editor.
* @param historyState - The history state, containing the current state and the undo/redo stack.
* @param delay - The time (in milliseconds) the editor should delay generating a new history stack,
* instead of merging the current changes with the current stack.
* @returns The listeners cleanup callback function.
*/
export declare function registerHistory(editor: LexicalEditor, historyState: HistoryState, delay: number): () => void;
/**
* Creates an empty history state.
* @returns - The empty history state, as an object.
*/
export declare function createEmptyHistoryState(): HistoryState;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Row/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAQ1D,eAAO,MAAM,GAAG,EAAE,2BAMjB,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"sanitizeJoinField.d.ts","sourceRoot":"","sources":["../../../src/fields/config/sanitizeJoinField.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAO/D,eAAO,MAAM,iBAAiB,2FAQ3B;IACD,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,gBAAgB,CAAC,EAAE,aAAa,EAAE,CAAA;IAClC,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,SA0FA,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/utilities/dependencies/realPath.ts"],"sourcesContent":["/*\n This source code has been taken from https://github.com/vercel/next.js/blob/39498d604c3b25d92a483153fe648a7ee456fbda/packages/next/src/lib/realpath.ts\n\n License:\n\n The MIT License (MIT)\n\n Copyright (c) 2024 Vercel, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\nimport fs from 'fs'\n\nconst isWindows = process.platform === 'win32'\n\n// Interesting learning from this, that fs.realpathSync is 70x slower than fs.realpathSync.native:\n// https://sun0day.github.io/blog/vite/why-vite4_3-is-faster.html#fs-realpathsync-issue\n// https://github.com/nodejs/node/issues/2680\n// However, we can't use fs.realpathSync.native on Windows due to behavior differences.\nexport const realpathSync = isWindows ? fs.realpathSync : fs.realpathSync.native\n"],"names":["fs","isWindows","process","platform","realpathSync","native"],"mappings":"AAAA;;;;;;;;;;;;;;AAcA,GACA,OAAOA,QAAQ,KAAI;AAEnB,MAAMC,YAAYC,QAAQC,QAAQ,KAAK;AAEvC,kGAAkG;AAClG,uFAAuF;AACvF,6CAA6C;AAC7C,uFAAuF;AACvF,OAAO,MAAMC,eAAeH,YAAYD,GAAGI,YAAY,GAAGJ,GAAGI,YAAY,CAACC,MAAM,CAAA"}

View File

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

View File

@@ -0,0 +1,243 @@
import { inspect } from '../jsutils/inspect.mjs';
import { Kind } from '../language/kinds.mjs';
import { parseSchemaCoordinate } from '../language/parser.mjs';
import {
isEnumType,
isInputObjectType,
isInterfaceType,
isObjectType,
} from '../type/definition.mjs';
/**
* A schema coordinate is resolved in the context of a GraphQL schema to
* uniquely identify a schema element. It returns undefined if the schema
* coordinate does not resolve to a schema element, meta-field, or introspection
* schema element. It will throw if the containing schema element (if
* applicable) does not exist.
*
* https://spec.graphql.org/draft/#sec-Schema-Coordinates.Semantics
*/
export function resolveSchemaCoordinate(schema, schemaCoordinate) {
return resolveASTSchemaCoordinate(
schema,
parseSchemaCoordinate(schemaCoordinate),
);
}
/**
* TypeCoordinate : Name
*/
function resolveTypeCoordinate(schema, schemaCoordinate) {
// 1. Let {typeName} be the value of {Name}.
const typeName = schemaCoordinate.name.value;
const type = schema.getType(typeName); // 2. Return the type in the {schema} named {typeName} if it exists.
if (type == null) {
return;
}
return {
kind: 'NamedType',
type,
};
}
/**
* MemberCoordinate : Name . Name
*/
function resolveMemberCoordinate(schema, schemaCoordinate) {
// 1. Let {typeName} be the value of the first {Name}.
// 2. Let {type} be the type in the {schema} named {typeName}.
const typeName = schemaCoordinate.name.value;
const type = schema.getType(typeName); // 3. Assert: {type} must exist, and must be an Enum, Input Object, Object or Interface type.
if (!type) {
throw new Error(
`Expected ${inspect(typeName)} to be defined as a type in the schema.`,
);
}
if (
!isEnumType(type) &&
!isInputObjectType(type) &&
!isObjectType(type) &&
!isInterfaceType(type)
) {
throw new Error(
`Expected ${inspect(
typeName,
)} to be an Enum, Input Object, Object or Interface type.`,
);
} // 4. If {type} is an Enum type:
if (isEnumType(type)) {
// 1. Let {enumValueName} be the value of the second {Name}.
const enumValueName = schemaCoordinate.memberName.value;
const enumValue = type.getValue(enumValueName); // 2. Return the enum value of {type} named {enumValueName} if it exists.
if (enumValue == null) {
return;
}
return {
kind: 'EnumValue',
type,
enumValue,
};
} // 5. Otherwise, if {type} is an Input Object type:
if (isInputObjectType(type)) {
// 1. Let {inputFieldName} be the value of the second {Name}.
const inputFieldName = schemaCoordinate.memberName.value;
const inputField = type.getFields()[inputFieldName]; // 2. Return the input field of {type} named {inputFieldName} if it exists.
if (inputField == null) {
return;
}
return {
kind: 'InputField',
type,
inputField,
};
} // 6. Otherwise:
// 1. Let {fieldName} be the value of the second {Name}.
const fieldName = schemaCoordinate.memberName.value;
const field = type.getFields()[fieldName]; // 2. Return the field of {type} named {fieldName} if it exists.
if (field == null) {
return;
}
return {
kind: 'Field',
type,
field,
};
}
/**
* ArgumentCoordinate : Name . Name ( Name : )
*/
function resolveArgumentCoordinate(schema, schemaCoordinate) {
// 1. Let {typeName} be the value of the first {Name}.
// 2. Let {type} be the type in the {schema} named {typeName}.
const typeName = schemaCoordinate.name.value;
const type = schema.getType(typeName); // 3. Assert: {type} must exist, and be an Object or Interface type.
if (type == null) {
throw new Error(
`Expected ${inspect(typeName)} to be defined as a type in the schema.`,
);
}
if (!isObjectType(type) && !isInterfaceType(type)) {
throw new Error(
`Expected ${inspect(typeName)} to be an object type or interface type.`,
);
} // 4. Let {fieldName} be the value of the second {Name}.
// 5. Let {field} be the field of {type} named {fieldName}.
const fieldName = schemaCoordinate.fieldName.value;
const field = type.getFields()[fieldName]; // 7. Assert: {field} must exist.
if (field == null) {
throw new Error(
`Expected ${inspect(fieldName)} to exist as a field of type ${inspect(
typeName,
)} in the schema.`,
);
} // 7. Let {fieldArgumentName} be the value of the third {Name}.
const fieldArgumentName = schemaCoordinate.argumentName.value;
const fieldArgument = field.args.find(
(arg) => arg.name === fieldArgumentName,
); // 8. Return the argument of {field} named {fieldArgumentName} if it exists.
if (fieldArgument == null) {
return;
}
return {
kind: 'FieldArgument',
type,
field,
fieldArgument,
};
}
/**
* DirectiveCoordinate : \@ Name
*/
function resolveDirectiveCoordinate(schema, schemaCoordinate) {
// 1. Let {directiveName} be the value of {Name}.
const directiveName = schemaCoordinate.name.value;
const directive = schema.getDirective(directiveName); // 2. Return the directive in the {schema} named {directiveName} if it exists.
if (!directive) {
return;
}
return {
kind: 'Directive',
directive,
};
}
/**
* DirectiveArgumentCoordinate : \@ Name ( Name : )
*/
function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) {
// 1. Let {directiveName} be the value of the first {Name}.
// 2. Let {directive} be the directive in the {schema} named {directiveName}.
const directiveName = schemaCoordinate.name.value;
const directive = schema.getDirective(directiveName); // 3. Assert {directive} must exist.
if (!directive) {
throw new Error(
`Expected ${inspect(
directiveName,
)} to be defined as a directive in the schema.`,
);
} // 4. Let {directiveArgumentName} be the value of the second {Name}.
const {
argumentName: { value: directiveArgumentName },
} = schemaCoordinate;
const directiveArgument = directive.args.find(
(arg) => arg.name === directiveArgumentName,
); // 5. Return the argument of {directive} named {directiveArgumentName} if it exists.
if (!directiveArgument) {
return;
}
return {
kind: 'DirectiveArgument',
directive,
directiveArgument,
};
}
/**
* Resolves schema coordinate from a parsed SchemaCoordinate node.
*/
export function resolveASTSchemaCoordinate(schema, schemaCoordinate) {
switch (schemaCoordinate.kind) {
case Kind.TYPE_COORDINATE:
return resolveTypeCoordinate(schema, schemaCoordinate);
case Kind.MEMBER_COORDINATE:
return resolveMemberCoordinate(schema, schemaCoordinate);
case Kind.ARGUMENT_COORDINATE:
return resolveArgumentCoordinate(schema, schemaCoordinate);
case Kind.DIRECTIVE_COORDINATE:
return resolveDirectiveCoordinate(schema, schemaCoordinate);
case Kind.DIRECTIVE_ARGUMENT_COORDINATE:
return resolveDirectiveArgumentCoordinate(schema, schemaCoordinate);
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"gallery-vertical-end.js","sources":["../../../src/icons/gallery-vertical-end.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name GalleryVerticalEnd\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNyAyaDEwIiAvPgogIDxwYXRoIGQ9Ik01IDZoMTQiIC8+CiAgPHJlY3Qgd2lkdGg9IjE4IiBoZWlnaHQ9IjEyIiB4PSIzIiB5PSIxMCIgcng9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/gallery-vertical-end\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 GalleryVerticalEnd = createLucideIcon('GalleryVerticalEnd', [\n ['path', { d: 'M7 2h10', key: 'nczekb' }],\n ['path', { d: 'M5 6h14', key: 'u2x4p' }],\n ['rect', { width: '18', height: '12', x: '3', y: '10', rx: '2', key: 'l0tzu3' }],\n]);\n\nexport default GalleryVerticalEnd;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAAA,CAChE,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,SAAS,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,105 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "minder dan een seconde",
other: "minder dan {{count}} seconden",
},
xSeconds: {
one: "1 seconde",
other: "{{count}} seconden",
},
halfAMinute: "een halve minuut",
lessThanXMinutes: {
one: "minder dan een minuut",
other: "minder dan {{count}} minuten",
},
xMinutes: {
one: "een minuut",
other: "{{count}} minuten",
},
aboutXHours: {
one: "ongeveer 1 uur",
other: "ongeveer {{count}} uur",
},
xHours: {
one: "1 uur",
other: "{{count}} uur",
},
xDays: {
one: "1 dag",
other: "{{count}} dagen",
},
aboutXWeeks: {
one: "ongeveer 1 week",
other: "ongeveer {{count}} weken",
},
xWeeks: {
one: "1 week",
other: "{{count}} weken",
},
aboutXMonths: {
one: "ongeveer 1 maand",
other: "ongeveer {{count}} maanden",
},
xMonths: {
one: "1 maand",
other: "{{count}} maanden",
},
aboutXYears: {
one: "ongeveer 1 jaar",
other: "ongeveer {{count}} jaar",
},
xYears: {
one: "1 jaar",
other: "{{count}} jaar",
},
overXYears: {
one: "meer dan 1 jaar",
other: "meer dan {{count}} jaar",
},
almostXYears: {
one: "bijna 1 jaar",
other: "bijna {{count}} jaar",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "over " + result;
} else {
return result + " geleden";
}
}
return result;
};
exports.formatDistance = formatDistance;

View File

@@ -0,0 +1 @@
{"version":3,"file":"fields.cjs","names":[],"sources":["../../../../src/rest/commands/read/fields.ts"],"sourcesContent":["import type { DirectusField } from '../../../schema/field.js';\nimport type { ApplyQueryFields } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadFieldOutput<Schema, Item extends object = DirectusField<Schema>> = ApplyQueryFields<Schema, Item, '*'>;\n\n/**\n * List the available fields.\n * @param query The query parameters\n * @returns An array of field objects.\n */\nexport const readFields =\n\t<Schema>(): RestCommand<ReadFieldOutput<Schema>[], Schema> =>\n\t() => ({\n\t\tpath: `/fields`,\n\t\tmethod: 'GET',\n\t});\n\n/**\n * List the available fields in a given collection.\n * @param collection The primary key of the field\n * @returns\n * @throws Will throw if collection is empty\n */\nexport const readFieldsByCollection =\n\t<Schema>(collection: DirectusField<Schema>['collection']): RestCommand<ReadFieldOutput<Schema>[], Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/fields/${collection}`,\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n\n/**\n *\n * @param key The primary key of the dashboard\n * @param query The query parameters\n * @returns\n * @throws Will throw if collection is empty\n * @throws Will throw if field is empty\n */\nexport const readField =\n\t<Schema>(\n\t\tcollection: DirectusField<Schema>['collection'],\n\t\tfield: DirectusField<Schema>['field'],\n\t): RestCommand<ReadFieldOutput<Schema>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\t\tthrowIfEmpty(field, 'Field cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/fields/${collection}/${field}`,\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"kDAYa,WAEL,CACN,KAAM,UACN,OAAQ,MACR,EAQW,EACH,QAER,EAAA,aAAa,EAAY,6BAA6B,CAE/C,CACN,KAAM,WAAW,IACjB,OAAQ,MACR,EAWU,GAEX,EACA,SAGA,EAAA,aAAa,EAAY,6BAA6B,CACtD,EAAA,aAAa,EAAO,wBAAwB,CAErC,CACN,KAAM,WAAW,EAAW,GAAG,IAC/B,OAAQ,MACR"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","WatchCondition","withCondition","Field","CheckForCondition","props","path","_jsx"],"sources":["../../../src/forms/withCondition/index.tsx"],"sourcesContent":["'use client'\nimport type { FieldPaths } from 'payload'\nimport type { MarkOptional } from 'ts-essentials'\n\nimport React from 'react'\n\nimport { WatchCondition } from './WatchCondition.js'\n\nexport const withCondition = <P extends MarkOptional<FieldPaths, 'indexPath' | 'path'>>(\n Field: React.ComponentType<P>,\n): React.FC<P> => {\n const CheckForCondition: React.FC<P> = (props) => {\n const { path } = props\n\n return (\n <WatchCondition path={path}>\n <Field {...props} />\n </WatchCondition>\n )\n }\n\n return CheckForCondition\n}\n"],"mappings":"AAAA;;;AAIA,OAAOA,KAAA,MAAW;AAElB,SAASC,cAAc,QAAQ;AAE/B,OAAO,MAAMC,aAAA,GACXC,KAAA;EAEA,MAAMC,iBAAA,GAAkCC,KAAA;IACtC,MAAM;MAAEC;IAAI,CAAE,GAAGD,KAAA;IAEjB,oBACEE,IAAA,CAACN,cAAA;MAAeK,IAAA,EAAMA,IAAA;gBACpB,aAAAC,IAAA,CAACJ,KAAA;QAAO,GAAGE;;;EAGjB;EAEA,OAAOD,iBAAA;AACT","ignoreList":[]}

View File

@@ -0,0 +1,33 @@
import type { I18nClient } from '@payloadcms/translations';
import type { ClientField, CollectionPreferences, CollectionSlug, Column, DefaultCellComponentProps, Document, Field, PaginatedDocs, Payload, PayloadRequest, SanitizedCollectionConfig, SanitizedFieldsPermissions, ViewTypes } from 'payload';
import type { SortColumnProps } from '../../../elements/SortColumn/index.js';
export type BuildColumnStateArgs = {
beforeRows?: Column[];
clientFields: ClientField[];
columns?: CollectionPreferences['columns'];
customCellProps: DefaultCellComponentProps['customCellProps'];
enableLinkedCell?: boolean;
enableRowSelections: boolean;
enableRowTypes?: boolean;
fieldPermissions?: SanitizedFieldsPermissions;
i18n: I18nClient;
payload: Payload;
req?: PayloadRequest;
serverFields: Field[];
sortColumnProps?: Partial<SortColumnProps>;
useAsTitle: SanitizedCollectionConfig['admin']['useAsTitle'];
viewType?: ViewTypes;
} & ({
collectionSlug: CollectionSlug;
dataType: 'monomorphic';
docs: PaginatedDocs['docs'];
} | {
collectionSlug?: undefined;
dataType: 'polymorphic';
docs: {
relationTo: CollectionSlug;
value: Document;
}[];
});
export declare const buildColumnState: (args: BuildColumnStateArgs) => Column[];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,97 @@
"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 text_exports = {};
__export(text_exports, {
SQLiteText: () => SQLiteText,
SQLiteTextBuilder: () => SQLiteTextBuilder,
SQLiteTextJson: () => SQLiteTextJson,
SQLiteTextJsonBuilder: () => SQLiteTextJsonBuilder,
text: () => text
});
module.exports = __toCommonJS(text_exports);
var import_entity = require("../../entity.cjs");
var import_utils = require("../../utils.cjs");
var import_common = require("./common.cjs");
class SQLiteTextBuilder extends import_common.SQLiteColumnBuilder {
static [import_entity.entityKind] = "SQLiteTextBuilder";
constructor(name, config) {
super(name, "string", "SQLiteText");
this.config.enumValues = config.enum;
this.config.length = config.length;
}
/** @internal */
build(table) {
return new SQLiteText(
table,
this.config
);
}
}
class SQLiteText extends import_common.SQLiteColumn {
static [import_entity.entityKind] = "SQLiteText";
enumValues = this.config.enumValues;
length = this.config.length;
constructor(table, config) {
super(table, config);
}
getSQLType() {
return `text${this.config.length ? `(${this.config.length})` : ""}`;
}
}
class SQLiteTextJsonBuilder extends import_common.SQLiteColumnBuilder {
static [import_entity.entityKind] = "SQLiteTextJsonBuilder";
constructor(name) {
super(name, "json", "SQLiteTextJson");
}
/** @internal */
build(table) {
return new SQLiteTextJson(
table,
this.config
);
}
}
class SQLiteTextJson extends import_common.SQLiteColumn {
static [import_entity.entityKind] = "SQLiteTextJson";
getSQLType() {
return "text";
}
mapFromDriverValue(value) {
return JSON.parse(value);
}
mapToDriverValue(value) {
return JSON.stringify(value);
}
}
function text(a, b = {}) {
const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
if (config.mode === "json") {
return new SQLiteTextJsonBuilder(name);
}
return new SQLiteTextBuilder(name, config);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SQLiteText,
SQLiteTextBuilder,
SQLiteTextJson,
SQLiteTextJsonBuilder,
text
});
//# sourceMappingURL=text.cjs.map

View File

@@ -0,0 +1,157 @@
import { NoopCache } from "../cache/core/index.js";
import { Column } from "../column.js";
import { entityKind, is } from "../entity.js";
import { NoopLogger } from "../logger.js";
import {
MySqlPreparedQuery,
MySqlSession,
MySqlTransaction
} from "../mysql-core/session.js";
import { fillPlaceholders, sql } from "../sql/sql.js";
import { mapResultRow } from "../utils.js";
const executeRawConfig = { fullResult: true };
const queryConfig = { arrayMode: true };
class TiDBServerlessPreparedQuery extends MySqlPreparedQuery {
constructor(client, queryString, params, logger, cache, queryMetadata, cacheConfig, fields, customResultMapper, generatedIds, returningIds) {
super(cache, queryMetadata, cacheConfig);
this.client = client;
this.queryString = queryString;
this.params = params;
this.logger = logger;
this.fields = fields;
this.customResultMapper = customResultMapper;
this.generatedIds = generatedIds;
this.returningIds = returningIds;
}
static [entityKind] = "TiDBPreparedQuery";
async execute(placeholderValues = {}) {
const params = fillPlaceholders(this.params, placeholderValues);
this.logger.logQuery(this.queryString, params);
const { fields, client, queryString, joinsNotNullableMap, customResultMapper, returningIds, generatedIds } = this;
if (!fields && !customResultMapper) {
const res = await this.queryWithCache(queryString, params, async () => {
return await client.execute(queryString, params, executeRawConfig);
});
const insertId = res.lastInsertId ?? 0;
const affectedRows = res.rowsAffected ?? 0;
if (returningIds) {
const returningResponse = [];
let j = 0;
for (let i = insertId; i < insertId + affectedRows; i++) {
for (const column of returningIds) {
const key = returningIds[0].path[0];
if (is(column.field, Column)) {
if (column.field.primary && column.field.autoIncrement) {
returningResponse.push({ [key]: i });
}
if (column.field.defaultFn && generatedIds) {
returningResponse.push({ [key]: generatedIds[j][key] });
}
}
}
j++;
}
return returningResponse;
}
return res;
}
const rows = await this.queryWithCache(queryString, params, async () => {
return await client.execute(queryString, params, queryConfig);
});
if (customResultMapper) {
return customResultMapper(rows);
}
return rows.map((row) => mapResultRow(fields, row, joinsNotNullableMap));
}
iterator(_placeholderValues) {
throw new Error("Streaming is not supported by the TiDB Cloud Serverless driver");
}
}
class TiDBServerlessSession extends MySqlSession {
constructor(baseClient, dialect, tx, schema, options = {}) {
super(dialect);
this.baseClient = baseClient;
this.schema = schema;
this.options = options;
this.client = tx ?? baseClient;
this.logger = options.logger ?? new NoopLogger();
this.cache = options.cache ?? new NoopCache();
}
static [entityKind] = "TiDBServerlessSession";
logger;
client;
cache;
prepareQuery(query, fields, customResultMapper, generatedIds, returningIds, queryMetadata, cacheConfig) {
return new TiDBServerlessPreparedQuery(
this.client,
query.sql,
query.params,
this.logger,
this.cache,
queryMetadata,
cacheConfig,
fields,
customResultMapper,
generatedIds,
returningIds
);
}
all(query) {
const querySql = this.dialect.sqlToQuery(query);
this.logger.logQuery(querySql.sql, querySql.params);
return this.client.execute(querySql.sql, querySql.params);
}
async count(sql2) {
const res = await this.execute(sql2);
return Number(
res["rows"][0]["count"]
);
}
async transaction(transaction) {
const nativeTx = await this.baseClient.begin();
try {
const session = new TiDBServerlessSession(this.baseClient, this.dialect, nativeTx, this.schema, this.options);
const tx = new TiDBServerlessTransaction(
this.dialect,
session,
this.schema
);
const result = await transaction(tx);
await nativeTx.commit();
return result;
} catch (err) {
await nativeTx.rollback();
throw err;
}
}
}
class TiDBServerlessTransaction extends MySqlTransaction {
static [entityKind] = "TiDBServerlessTransaction";
constructor(dialect, session, schema, nestedIndex = 0) {
super(dialect, session, schema, nestedIndex, "default");
}
async transaction(transaction) {
const savepointName = `sp${this.nestedIndex + 1}`;
const tx = new TiDBServerlessTransaction(
this.dialect,
this.session,
this.schema,
this.nestedIndex + 1
);
await tx.execute(sql.raw(`savepoint ${savepointName}`));
try {
const result = await transaction(tx);
await tx.execute(sql.raw(`release savepoint ${savepointName}`));
return result;
} catch (err) {
await tx.execute(sql.raw(`rollback to savepoint ${savepointName}`));
throw err;
}
}
}
export {
TiDBServerlessPreparedQuery,
TiDBServerlessSession,
TiDBServerlessTransaction
};
//# sourceMappingURL=session.js.map

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