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

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions
@@ -0,0 +1,24 @@
import { SpanKind, SpanStatus, Attributes, HrTime, Link, SpanContext } from '@opentelemetry/api';
import { Resource } from '@opentelemetry/resources';
import { InstrumentationScope } from '@opentelemetry/core';
import { TimedEvent } from '../TimedEvent';
export interface ReadableSpan {
readonly name: string;
readonly kind: SpanKind;
readonly spanContext: () => SpanContext;
readonly parentSpanContext?: SpanContext;
readonly startTime: HrTime;
readonly endTime: HrTime;
readonly status: SpanStatus;
readonly attributes: Attributes;
readonly links: Link[];
readonly events: TimedEvent[];
readonly duration: HrTime;
readonly ended: boolean;
readonly resource: Resource;
readonly instrumentationScope: InstrumentationScope;
readonly droppedAttributesCount: number;
readonly droppedEventsCount: number;
readonly droppedLinksCount: number;
}
//# sourceMappingURL=ReadableSpan.d.ts.map
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_update.cjs",
"module": "../../esm/_update.js"
}
@@ -0,0 +1,52 @@
/**
* 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.
*
*/
/**
* Common update tags used in Lexical. These tags can be used with editor.update() or $addUpdateTag()
* to indicate the type/purpose of an update. Multiple tags can be used in a single update.
*/
/**
* Indicates that the update is related to history operations (undo/redo)
*/
export declare const HISTORIC_TAG = "historic";
/**
* Indicates that a new history entry should be pushed to the history stack
*/
export declare const HISTORY_PUSH_TAG = "history-push";
/**
* Indicates that the current update should be merged with the previous history entry
*/
export declare const HISTORY_MERGE_TAG = "history-merge";
/**
* Indicates that the update is related to a paste operation
*/
export declare const PASTE_TAG = "paste";
/**
* Indicates that the update is related to collaborative editing
*/
export declare const COLLABORATION_TAG = "collaboration";
/**
* Indicates that the update should skip collaborative sync
*/
export declare const SKIP_COLLAB_TAG = "skip-collab";
/**
* Indicates that the update should skip scrolling the selection into view
*/
export declare const SKIP_SCROLL_INTO_VIEW_TAG = "skip-scroll-into-view";
/**
* Indicates that the update should skip updating the DOM selection
* This is useful when you want to make updates without changing the selection or focus
*/
export declare const SKIP_DOM_SELECTION_TAG = "skip-dom-selection";
/**
* The update was triggered by editor.focus()
*/
export declare const FOCUS_TAG = "focus";
/**
* The set of known update tags to help with TypeScript suggestions.
*/
export type UpdateTag = typeof COLLABORATION_TAG | typeof FOCUS_TAG | typeof HISTORIC_TAG | typeof HISTORY_MERGE_TAG | typeof HISTORY_PUSH_TAG | typeof PASTE_TAG | typeof SKIP_COLLAB_TAG | typeof SKIP_DOM_SELECTION_TAG | typeof SKIP_SCROLL_INTO_VIEW_TAG | (string & {});
@@ -0,0 +1,11 @@
import { DatabaseError } from './messages'
import { serialize } from './serializer'
import { Parser, MessageCallback } from './parser'
export function parse(stream: NodeJS.ReadableStream, callback: MessageCallback): Promise<void> {
const parser = new Parser()
stream.on('data', (buffer: Buffer) => parser.parse(buffer, callback))
return new Promise((resolve) => stream.on('end', () => resolve()))
}
export { serialize, DatabaseError }
@@ -0,0 +1,3 @@
export { GRAPHQL_PLAYGROUND_GET, GRAPHQL_POST } from './graphql/index.js';
export { DELETE as REST_DELETE, GET as REST_GET, OPTIONS as REST_OPTIONS, PATCH as REST_PATCH, POST as REST_POST, } from './rest/index.js';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"wrappingLoader.d.ts","sourceRoot":"","sources":["../../../../src/config/loaders/wrappingLoader.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAA0B,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA8B1C,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC5C,kBAAkB,EAAE,MAAM,GAAG,WAAW,GAAG,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;IAC/F,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mCAAmC,CAAC,EAAE,MAAM,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AAEH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,IAAI,EAAE,UAAU,CAAC,qBAAqB,CAAC,EACvC,QAAQ,EAAE,MAAM,EAEhB,mBAAmB,EAAE,GAAG,GACvB,IAAI,CAgLN"}
@@ -0,0 +1,17 @@
// Note: This file is autogenerated using "resources/gen-version.js" script and
// automatically updated by "npm version" command.
/**
* A string containing the version of the GraphQL.js library
*/
export const version = '16.12.0';
/**
* An object containing the components of the GraphQL.js version string
*/
export const versionInfo = Object.freeze({
major: 16,
minor: 12,
patch: 0,
preReleaseTag: null,
});
@@ -0,0 +1,64 @@
(function (Prism) {
Prism.languages.diff = {
'coord': [
// Match all kinds of coord lines (prefixed by "+++", "---" or "***").
/^(?:\*{3}|-{3}|\+{3}).*$/m,
// Match "@@ ... @@" coord lines in unified diff.
/^@@.*@@$/m,
// Match coord lines in normal diff (starts with a number).
/^\d.*$/m
]
// deleted, inserted, unchanged, diff
};
/**
* A map from the name of a block to its line prefix.
*
* @type {Object<string, string>}
*/
var PREFIXES = {
'deleted-sign': '-',
'deleted-arrow': '<',
'inserted-sign': '+',
'inserted-arrow': '>',
'unchanged': ' ',
'diff': '!',
};
// add a token for each prefix
Object.keys(PREFIXES).forEach(function (name) {
var prefix = PREFIXES[name];
var alias = [];
if (!/^\w+$/.test(name)) { // "deleted-sign" -> "deleted"
alias.push(/\w+/.exec(name)[0]);
}
if (name === 'diff') {
alias.push('bold');
}
Prism.languages.diff[name] = {
pattern: RegExp('^(?:[' + prefix + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'),
alias: alias,
inside: {
'line': {
pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/,
lookbehind: true
},
'prefix': {
pattern: /[\s\S]/,
alias: /\w+/.exec(name)[0]
}
}
};
});
// make prefixes available to Diff plugin
Object.defineProperty(Prism.languages.diff, 'PREFIXES', {
value: PREFIXES
});
}(Prism));
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/aws-data-api/pg/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uBAAc,wBAAd;AACA,uBAAc,yBADd;","names":[]}
@@ -0,0 +1,348 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Dependency = require("./Dependency");
const { UsageState } = require("./ExportsInfo");
const ModuleGraphConnection = require("./ModuleGraphConnection");
const { STAGE_DEFAULT } = require("./OptimizationStages");
const ArrayQueue = require("./util/ArrayQueue");
const TupleQueue = require("./util/TupleQueue");
const { getEntryRuntime, mergeRuntimeOwned } = require("./util/runtime");
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./DependenciesBlock")} DependenciesBlock */
/** @typedef {import("./Dependency").ReferencedExport} ReferencedExport */
/** @typedef {import("./Dependency").ReferencedExports} ReferencedExports */
/** @typedef {import("./ExportsInfo")} ExportsInfo */
/** @typedef {import("./Module")} Module */
/** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */
const { NO_EXPORTS_REFERENCED, EXPORTS_OBJECT_REFERENCED } = Dependency;
const PLUGIN_NAME = "FlagDependencyUsagePlugin";
const PLUGIN_LOGGER_NAME = `webpack.${PLUGIN_NAME}`;
class FlagDependencyUsagePlugin {
/**
* @param {boolean} global do a global analysis instead of per runtime
*/
constructor(global) {
/** @type {boolean} */
this.global = global;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
const moduleGraph = compilation.moduleGraph;
compilation.hooks.optimizeDependencies.tap(
{ name: PLUGIN_NAME, stage: STAGE_DEFAULT },
(modules) => {
if (compilation.moduleMemCaches) {
throw new Error(
"optimization.usedExports can't be used with cacheUnaffected as export usage is a global effect"
);
}
const logger = compilation.getLogger(PLUGIN_LOGGER_NAME);
/** @type {Map<ExportsInfo, Module>} */
const exportInfoToModuleMap = new Map();
/** @type {TupleQueue<Module, RuntimeSpec>} */
const queue = new TupleQueue();
/**
* @param {Module} module module to process
* @param {ReferencedExports} usedExports list of used exports
* @param {RuntimeSpec} runtime part of which runtime
* @param {boolean} forceSideEffects always apply side effects
* @returns {void}
*/
const processReferencedModule = (
module,
usedExports,
runtime,
forceSideEffects
) => {
const exportsInfo = moduleGraph.getExportsInfo(module);
if (usedExports.length > 0) {
if (!module.buildMeta || !module.buildMeta.exportsType) {
if (exportsInfo.setUsedWithoutInfo(runtime)) {
queue.enqueue(module, runtime);
}
return;
}
for (const usedExportInfo of usedExports) {
/** @type {string[]} */
let usedExport;
let canMangle = true;
if (Array.isArray(usedExportInfo)) {
usedExport = usedExportInfo;
} else {
usedExport = usedExportInfo.name;
canMangle = usedExportInfo.canMangle !== false;
}
if (usedExport.length === 0) {
if (exportsInfo.setUsedInUnknownWay(runtime)) {
queue.enqueue(module, runtime);
}
} else {
let currentExportsInfo = exportsInfo;
for (let i = 0; i < usedExport.length; i++) {
const exportInfo = currentExportsInfo.getExportInfo(
usedExport[i]
);
if (canMangle === false) {
exportInfo.canMangleUse = false;
}
const lastOne = i === usedExport.length - 1;
if (!lastOne) {
const nestedInfo = exportInfo.getNestedExportsInfo();
if (nestedInfo) {
if (
exportInfo.setUsedConditionally(
(used) => used === UsageState.Unused,
UsageState.OnlyPropertiesUsed,
runtime
)
) {
const currentModule =
currentExportsInfo === exportsInfo
? module
: exportInfoToModuleMap.get(currentExportsInfo);
if (currentModule) {
queue.enqueue(currentModule, runtime);
}
}
currentExportsInfo = nestedInfo;
continue;
}
}
if (
exportInfo.setUsedConditionally(
(v) => v !== UsageState.Used,
UsageState.Used,
runtime
)
) {
const currentModule =
currentExportsInfo === exportsInfo
? module
: exportInfoToModuleMap.get(currentExportsInfo);
if (currentModule) {
queue.enqueue(currentModule, runtime);
}
}
break;
}
}
}
} else {
// for a module without side effects we stop tracking usage here when no export is used
// This module won't be evaluated in this case
// TODO webpack 6 remove this check
if (
!forceSideEffects &&
module.factoryMeta !== undefined &&
module.factoryMeta.sideEffectFree
) {
return;
}
if (exportsInfo.setUsedForSideEffectsOnly(runtime)) {
queue.enqueue(module, runtime);
}
}
};
/**
* @param {DependenciesBlock} module the module
* @param {RuntimeSpec} runtime part of which runtime
* @param {boolean} forceSideEffects always apply side effects
* @returns {void}
*/
const processModule = (module, runtime, forceSideEffects) => {
/** @typedef {Map<string, string[] | ReferencedExport>} ExportMaps */
/** @type {Map<Module, ReferencedExports | ExportMaps>} */
const map = new Map();
/** @type {ArrayQueue<DependenciesBlock>} */
const queue = new ArrayQueue();
queue.enqueue(module);
for (;;) {
const block = queue.dequeue();
if (block === undefined) break;
for (const b of block.blocks) {
if (b.groupOptions && b.groupOptions.entryOptions) {
processModule(
b,
this.global
? undefined
: b.groupOptions.entryOptions.runtime || undefined,
true
);
} else {
queue.enqueue(b);
}
}
for (const dep of block.dependencies) {
const connection = moduleGraph.getConnection(dep);
if (!connection || !connection.module) {
continue;
}
const activeState = connection.getActiveState(runtime);
if (activeState === false) continue;
const { module } = connection;
if (activeState === ModuleGraphConnection.TRANSITIVE_ONLY) {
processModule(module, runtime, false);
continue;
}
const oldReferencedExports = map.get(module);
if (oldReferencedExports === EXPORTS_OBJECT_REFERENCED) {
continue;
}
const referencedExports =
compilation.getDependencyReferencedExports(dep, runtime);
if (
oldReferencedExports === undefined ||
oldReferencedExports === NO_EXPORTS_REFERENCED ||
referencedExports === EXPORTS_OBJECT_REFERENCED
) {
map.set(module, referencedExports);
} else if (
oldReferencedExports !== undefined &&
referencedExports === NO_EXPORTS_REFERENCED
) {
continue;
} else {
/** @type {undefined | ExportMaps} */
let exportsMap;
if (Array.isArray(oldReferencedExports)) {
exportsMap = new Map();
for (const item of oldReferencedExports) {
if (Array.isArray(item)) {
exportsMap.set(item.join("\n"), item);
} else {
exportsMap.set(item.name.join("\n"), item);
}
}
map.set(module, exportsMap);
} else {
exportsMap = oldReferencedExports;
}
for (const item of referencedExports) {
if (Array.isArray(item)) {
const key = item.join("\n");
const oldItem = exportsMap.get(key);
if (oldItem === undefined) {
exportsMap.set(key, item);
}
// if oldItem is already an array we have to do nothing
// if oldItem is an ReferencedExport object, we don't have to do anything
// as canMangle defaults to true for arrays
} else {
const key = item.name.join("\n");
const oldItem = exportsMap.get(key);
if (oldItem === undefined || Array.isArray(oldItem)) {
exportsMap.set(key, item);
} else {
exportsMap.set(key, {
name: item.name,
canMangle: item.canMangle && oldItem.canMangle
});
}
}
}
}
}
}
for (const [module, referencedExports] of map) {
if (Array.isArray(referencedExports)) {
processReferencedModule(
module,
referencedExports,
runtime,
forceSideEffects
);
} else {
processReferencedModule(
module,
[...referencedExports.values()],
runtime,
forceSideEffects
);
}
}
};
logger.time("initialize exports usage");
for (const module of modules) {
const exportsInfo = moduleGraph.getExportsInfo(module);
exportInfoToModuleMap.set(exportsInfo, module);
exportsInfo.setHasUseInfo();
}
logger.timeEnd("initialize exports usage");
logger.time("trace exports usage in graph");
/**
* @param {Dependency} dep dependency
* @param {RuntimeSpec} runtime runtime
*/
const processEntryDependency = (dep, runtime) => {
const module = moduleGraph.getModule(dep);
if (module) {
processReferencedModule(
module,
NO_EXPORTS_REFERENCED,
runtime,
true
);
}
};
/** @type {RuntimeSpec} */
let globalRuntime;
for (const [
entryName,
{ dependencies: deps, includeDependencies: includeDeps, options }
] of compilation.entries) {
const runtime = this.global
? undefined
: getEntryRuntime(compilation, entryName, options);
for (const dep of deps) {
processEntryDependency(dep, runtime);
}
for (const dep of includeDeps) {
processEntryDependency(dep, runtime);
}
globalRuntime = mergeRuntimeOwned(globalRuntime, runtime);
}
for (const dep of compilation.globalEntry.dependencies) {
processEntryDependency(dep, globalRuntime);
}
for (const dep of compilation.globalEntry.includeDependencies) {
processEntryDependency(dep, globalRuntime);
}
while (queue.length) {
const [module, runtime] = /** @type {[Module, RuntimeSpec]} */ (
queue.dequeue()
);
processModule(module, runtime, false);
}
logger.timeEnd("trace exports usage in graph");
}
);
});
}
}
module.exports = FlagDependencyUsagePlugin;
@@ -0,0 +1,43 @@
import { eachDayOfInterval } from "./eachDayOfInterval.mjs";
import { isWeekend } from "./isWeekend.mjs";
/**
* @name eachWeekendOfInterval
* @category Interval Helpers
* @summary List all the Saturdays and Sundays in the given date interval.
*
* @description
* Get all the Saturdays and Sundays in the given date interval.
*
* @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 interval - The given interval
*
* @returns An array containing all the Saturdays and Sundays
*
* @example
* // Lists all Saturdays and Sundays in the given date interval
* const result = eachWeekendOfInterval({
* start: new Date(2018, 8, 17),
* end: new Date(2018, 8, 30)
* })
* //=> [
* // Sat Sep 22 2018 00:00:00,
* // Sun Sep 23 2018 00:00:00,
* // Sat Sep 29 2018 00:00:00,
* // Sun Sep 30 2018 00:00:00
* // ]
*/
export function eachWeekendOfInterval(interval) {
const dateInterval = eachDayOfInterval(interval);
const weekends = [];
let index = 0;
while (index < dateInterval.length) {
const date = dateInterval[index++];
if (isWeekend(date)) weekends.push(date);
}
return weekends;
}
// Fallback for modularized imports:
export default eachWeekendOfInterval;
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/columns/varchar.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyPgTable } from '~/pg-core/table.ts';\nimport { getColumnNameAndConfig, type Writable } from '~/utils.ts';\nimport { PgColumn, PgColumnBuilder } from './common.ts';\n\nexport type PgVarcharBuilderInitial<\n\tTName extends string,\n\tTEnum extends [string, ...string[]],\n\tTLength extends number | undefined,\n> = PgVarcharBuilder<{\n\tname: TName;\n\tdataType: 'string';\n\tcolumnType: 'PgVarchar';\n\tdata: TEnum[number];\n\tdriverParam: string;\n\tenumValues: TEnum;\n\tlength: TLength;\n}>;\n\nexport class PgVarcharBuilder<\n\tT extends ColumnBuilderBaseConfig<'string', 'PgVarchar'> & { length?: number | undefined },\n> extends PgColumnBuilder<\n\tT,\n\t{ length: T['length']; enumValues: T['enumValues'] },\n\t{ length: T['length'] }\n> {\n\tstatic override readonly [entityKind]: string = 'PgVarcharBuilder';\n\n\tconstructor(name: T['name'], config: PgVarcharConfig<T['enumValues'], T['length']>) {\n\t\tsuper(name, 'string', 'PgVarchar');\n\t\tthis.config.length = config.length;\n\t\tthis.config.enumValues = config.enum;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgVarchar<MakeColumnConfig<T, TTableName> & { length: T['length'] }> {\n\t\treturn new PgVarchar<MakeColumnConfig<T, TTableName> & { length: T['length'] }>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class PgVarchar<T extends ColumnBaseConfig<'string', 'PgVarchar'> & { length?: number | undefined }>\n\textends PgColumn<T, { length: T['length']; enumValues: T['enumValues'] }, { length: T['length'] }>\n{\n\tstatic override readonly [entityKind]: string = 'PgVarchar';\n\n\treadonly length = this.config.length;\n\toverride readonly enumValues = this.config.enumValues;\n\n\tgetSQLType(): string {\n\t\treturn this.length === undefined ? `varchar` : `varchar(${this.length})`;\n\t}\n}\n\nexport interface PgVarcharConfig<\n\tTEnum extends readonly string[] | string[] | undefined = readonly string[] | string[] | undefined,\n\tTLength extends number | undefined = number | undefined,\n> {\n\tenum?: TEnum;\n\tlength?: TLength;\n}\n\nexport function varchar(): PgVarcharBuilderInitial<'', [string, ...string[]], undefined>;\nexport function varchar<\n\tU extends string,\n\tT extends Readonly<[U, ...U[]]>,\n\tL extends number | undefined,\n>(\n\tconfig?: PgVarcharConfig<T | Writable<T>, L>,\n): PgVarcharBuilderInitial<'', Writable<T>, L>;\nexport function varchar<\n\tTName extends string,\n\tU extends string,\n\tT extends Readonly<[U, ...U[]]>,\n\tL extends number | undefined,\n>(\n\tname: TName,\n\tconfig?: PgVarcharConfig<T | Writable<T>, L>,\n): PgVarcharBuilderInitial<TName, Writable<T>, L>;\nexport function varchar(a?: string | PgVarcharConfig, b: PgVarcharConfig = {}): any {\n\tconst { name, config } = getColumnNameAndConfig<PgVarcharConfig>(a, b);\n\treturn new PgVarcharBuilder(name, config as any);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAE3B,mBAAsD;AACtD,oBAA0C;AAgBnC,MAAM,yBAEH,8BAIR;AAAA,EACD,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAAuD;AACnF,UAAM,MAAM,UAAU,WAAW;AACjC,SAAK,OAAO,SAAS,OAAO;AAC5B,SAAK,OAAO,aAAa,OAAO;AAAA,EACjC;AAAA;AAAA,EAGS,MACR,OACuE;AACvE,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,kBACJ,uBACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEvC,SAAS,KAAK,OAAO;AAAA,EACZ,aAAa,KAAK,OAAO;AAAA,EAE3C,aAAqB;AACpB,WAAO,KAAK,WAAW,SAAY,YAAY,WAAW,KAAK,MAAM;AAAA,EACtE;AACD;AA2BO,SAAS,QAAQ,GAA8B,IAAqB,CAAC,GAAQ;AACnF,QAAM,EAAE,MAAM,OAAO,QAAI,qCAAwC,GAAG,CAAC;AACrE,SAAO,IAAI,iBAAiB,MAAM,MAAa;AAChD;","names":[]}
@@ -0,0 +1,75 @@
export const rtlLanguages = [
'ar',
'fa',
'he'
];
export const acceptedLanguages = [
'ar',
'az',
'bg',
'bn-BD',
'bn-IN',
'ca',
'cs',
'bn-BD',
'bn-IN',
'da',
'de',
'en',
'es',
'et',
'fa',
'fr',
'he',
'hr',
'hu',
'hy',
'id',
'is',
'it',
'ja',
'ko',
'lt',
'lv',
'my',
'nb',
'nl',
'pl',
'pt',
'ro',
'rs',
'rs-latin',
'ru',
'sk',
'sl',
'sv',
'ta',
'th',
'tr',
'uk',
'vi',
'zh',
'zh-TW'
];
function parseAcceptLanguage(acceptLanguageHeader) {
return acceptLanguageHeader.split(',').map((lang)=>{
const [language, quality] = lang.trim().split(';q=');
return {
language,
quality: quality ? parseFloat(quality) : 1
};
}).sort((a, b)=>b.quality - a.quality) // Sort by quality, highest to lowest
;
}
export function extractHeaderLanguage(acceptLanguageHeader) {
const parsedHeader = parseAcceptLanguage(acceptLanguageHeader);
let matchedLanguage;
for (const { language } of parsedHeader){
if (!matchedLanguage && acceptedLanguages.includes(language)) {
matchedLanguage = language;
}
}
return matchedLanguage;
}
//# sourceMappingURL=languages.js.map
@@ -0,0 +1,39 @@
import type { SanitizedCollectionConfig } from '../../../collections/config/types.js';
import type { SanitizedGlobalConfig } from '../../../globals/config/types.js';
import type { RequestContext, TypedFallbackLocale } from '../../../index.js';
import type { JsonObject, PayloadRequest, PopulateType, SelectType } from '../../../types/index.js';
export type AfterReadArgs<T extends JsonObject> = {
collection: null | SanitizedCollectionConfig;
context: RequestContext;
currentDepth?: number;
depth: number;
doc: T;
draft: boolean;
fallbackLocale: TypedFallbackLocale;
findMany?: boolean;
/**
* Controls whether locales should be flattened into the requested locale.
* E.g.: { [locale]: fields } -> fields
*
* @default true
*/
flattenLocales?: boolean;
global: null | SanitizedGlobalConfig;
locale: string;
overrideAccess: boolean;
populate?: PopulateType;
req: PayloadRequest;
select?: SelectType;
showHiddenFields: boolean;
};
/**
* This function is responsible for the following actions, in order:
* - Remove hidden fields from response
* - Flatten locales into requested locale. If the input doc contains all locales, the output doc after this function will only contain the requested locale.
* - Sanitize outgoing data (point field, etc.)
* - Execute field hooks
* - Execute read access control
* - Populate relationships
*/
export declare function afterRead<T extends JsonObject>(args: AfterReadArgs<T>): Promise<T>;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
module.exports={C:{"47":0.00354,"61":0.00354,"72":0.00354,"108":0.00354,"112":0.00354,"115":0.07436,"123":0.00354,"126":0.00354,"127":0.01062,"128":0.01062,"129":0.00354,"133":0.02479,"135":0.00354,"138":0.02125,"139":0.00354,"140":0.01062,"141":0.00354,"142":0.01062,"143":0.04249,"144":0.03895,"145":0.38951,"146":0.46387,"147":0.00708,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 48 49 50 51 52 53 54 55 56 57 58 59 60 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 113 114 116 117 118 119 120 121 122 124 125 130 131 132 134 136 137 148 149 3.5 3.6"},D:{"43":0.00354,"48":0.00354,"55":0.00708,"56":0.01062,"57":0.00354,"61":0.00354,"62":0.00354,"63":0.00354,"65":0.00354,"66":0.00354,"67":0.00708,"68":0.00354,"69":0.00354,"70":0.00354,"71":0.01062,"72":0.00708,"73":0.00354,"74":0.00354,"75":0.00354,"78":0.00354,"79":0.00708,"80":0.00708,"81":0.00354,"83":0.00354,"86":0.00354,"87":0.00708,"89":0.00708,"91":0.00354,"95":0.00354,"96":0.00354,"97":0.00708,"99":0.00354,"100":0.00354,"103":0.16643,"104":0.15935,"105":0.15935,"106":0.16643,"107":0.16289,"108":0.16289,"109":0.35056,"110":0.15935,"111":0.17351,"112":0.15935,"114":0.04249,"115":0.00708,"116":0.33285,"117":0.16289,"118":0.00354,"119":0.01771,"120":0.16643,"121":0.00708,"122":0.03541,"123":0.01416,"124":0.17705,"125":0.10977,"126":3.21877,"127":0.01062,"128":0.02125,"129":0.02125,"130":0.01416,"131":0.37181,"132":0.01771,"133":0.33994,"134":0.03541,"135":0.08853,"136":0.03541,"137":0.04603,"138":0.10977,"139":2.83988,"140":0.08853,"141":0.16643,"142":3.49851,"143":5.84619,"144":0.01062,"145":0.00354,_:"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 44 45 46 47 49 50 51 52 53 54 58 59 60 64 76 77 84 85 88 90 92 93 94 98 101 102 113 146"},F:{"93":0.01416,"95":0.00708,"113":0.00354,"116":0.00354,"119":0.00354,"120":0.01062,"121":0.00354,"122":0.02479,"123":0.01062,"124":0.16643,"125":0.0602,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 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 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 115 117 118 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00354,"16":0.00354,"17":0.00354,"18":0.01062,"92":0.01771,"100":0.00354,"109":0.00354,"114":0.00354,"120":0.00708,"122":0.00708,"131":0.02833,"133":0.00354,"134":0.00354,"135":0.00354,"136":0.00354,"137":0.00354,"138":0.01771,"139":0.00708,"140":0.01416,"141":0.02833,"142":0.39659,"143":1.35974,_:"13 14 15 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 121 123 124 125 126 127 128 129 130 132"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.4 17.0 17.2 17.3 26.3","13.1":0.00708,"14.1":0.00354,"15.6":0.07082,"16.1":0.02479,"16.3":0.00708,"16.5":0.00354,"16.6":0.04603,"17.1":0.00708,"17.4":0.00354,"17.5":0.00354,"17.6":0.03541,"18.0":0.00354,"18.1":0.00708,"18.2":0.00354,"18.3":0.01062,"18.4":0.00708,"18.5-18.6":0.04249,"26.0":0.03541,"26.1":0.15935,"26.2":0.05312},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00113,"5.0-5.1":0,"6.0-6.1":0.00226,"7.0-7.1":0.00169,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00451,"10.0-10.2":0.00056,"10.3":0.00789,"11.0-11.2":0.09699,"11.3-11.4":0.00282,"12.0-12.1":0.00226,"12.2-12.5":0.02537,"13.0-13.1":0.00056,"13.2":0.00395,"13.3":0.00113,"13.4-13.7":0.00395,"14.0-14.4":0.00789,"14.5-14.8":0.00846,"15.0-15.1":0.00902,"15.2-15.3":0.00677,"15.4":0.00733,"15.5":0.00789,"15.6-15.8":0.12236,"16.0":0.0141,"16.1":0.02707,"16.2":0.0141,"16.3":0.02537,"16.4":0.0062,"16.5":0.01071,"16.6-16.7":0.15901,"17.0":0.00902,"17.1":0.01466,"17.2":0.01071,"17.3":0.01635,"17.4":0.02763,"17.5":0.05413,"17.6-17.7":0.12518,"18.0":0.02819,"18.1":0.05864,"18.2":0.03101,"18.3":0.10093,"18.4":0.05188,"18.5-18.7":3.72493,"26.0":0.07274,"26.1":0.60503,"26.2":0.11503,"26.3":0.00507},P:{"4":0.01103,"20":0.01103,"21":0.01103,"25":0.02206,"26":0.01103,"27":0.01103,"28":0.04411,"29":0.3198,_:"22 23 24 5.0-5.4 6.2-6.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","7.2-7.4":0.01103},I:{"0":0.12897,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00003,"4.4":0,"4.4.3-4.4.4":0.0001},A:{"8":0.01416,"9":0.00472,"10":0.00472,"11":0.06138,_:"6 7 5.5"},K:{"0":0.17439,_:"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.14856},O:{"0":0.23252},H:{"0":0},L:{"0":68.73633},R:{_:"0"},M:{"0":0.12272}};
@@ -0,0 +1 @@
{"version":3,"file":"background-color.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-color.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAiC;IACzD,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,aAAa;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,oBAA0C;IAC9C,MAAM,EAAE,OAAO;CAClB,CAAC"}
@@ -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 P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N","132":"O"},C:{"1":"0 1 2 3 4 5 6 7 8 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","2":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB 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","132":"xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B"},E:{"1":"F A B C L M G AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E 6C bC 7C 8C 9C"},F:{"1":"0 1 2 3 4 5 6 7 8 zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"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 JD KD LD MD PC xC ND QC","132":"kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB"},G:{"1":"TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J","132":"tD uD vD wD"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:1,C:"relList (DOMTokenList)",D:true};
@@ -0,0 +1,186 @@
#ifdef FS_EVENTS
#include "macos/FSEventsBackend.hh"
#endif
#ifdef WATCHMAN
#include "watchman/WatchmanBackend.hh"
#endif
#ifdef WINDOWS
#include "windows/WindowsBackend.hh"
#endif
#ifdef INOTIFY
#include "linux/InotifyBackend.hh"
#endif
#ifdef KQUEUE
#include "kqueue/KqueueBackend.hh"
#endif
#ifdef __wasm32__
#include "wasm/WasmBackend.hh"
#endif
#include "shared/BruteForceBackend.hh"
#include "Backend.hh"
#include <unordered_map>
static std::unordered_map<std::string, std::shared_ptr<Backend>>& getSharedBackends() {
static std::unordered_map<std::string, std::shared_ptr<Backend>>* sharedBackends =
new std::unordered_map<std::string, std::shared_ptr<Backend>>();
return *sharedBackends;
}
std::shared_ptr<Backend> getBackend(std::string backend) {
// Use FSEvents on macOS by default.
// Use watchman by default if available on other platforms.
// Fall back to brute force.
#ifdef FS_EVENTS
if (backend == "fs-events" || backend == "default") {
return std::make_shared<FSEventsBackend>();
}
#endif
#ifdef WATCHMAN
if ((backend == "watchman" || backend == "default") && WatchmanBackend::checkAvailable()) {
return std::make_shared<WatchmanBackend>();
}
#endif
#ifdef WINDOWS
if (backend == "windows" || backend == "default") {
return std::make_shared<WindowsBackend>();
}
#endif
#ifdef INOTIFY
if (backend == "inotify" || backend == "default") {
return std::make_shared<InotifyBackend>();
}
#endif
#ifdef KQUEUE
if (backend == "kqueue" || backend == "default") {
return std::make_shared<KqueueBackend>();
}
#endif
#ifdef __wasm32__
if (backend == "wasm" || backend == "default") {
return std::make_shared<WasmBackend>();
}
#endif
if (backend == "brute-force" || backend == "default") {
return std::make_shared<BruteForceBackend>();
}
return nullptr;
}
std::shared_ptr<Backend> Backend::getShared(std::string backend) {
auto found = getSharedBackends().find(backend);
if (found != getSharedBackends().end()) {
return found->second;
}
auto result = getBackend(backend);
if (!result) {
return getShared("default");
}
result->run();
getSharedBackends().emplace(backend, result);
return result;
}
void removeShared(Backend *backend) {
for (auto it = getSharedBackends().begin(); it != getSharedBackends().end(); it++) {
if (it->second.get() == backend) {
getSharedBackends().erase(it);
break;
}
}
// Free up memory.
if (getSharedBackends().size() == 0) {
getSharedBackends().rehash(0);
}
}
void Backend::run() {
#ifndef __wasm32__
mThread = std::thread([this] () {
try {
start();
} catch (std::exception &err) {
handleError(err);
}
});
if (mThread.joinable()) {
mStartedSignal.wait();
}
#else
try {
start();
} catch (std::exception &err) {
handleError(err);
}
#endif
}
void Backend::notifyStarted() {
mStartedSignal.notify();
}
void Backend::start() {
notifyStarted();
}
Backend::~Backend() {
#ifndef __wasm32__
// Wait for thread to stop
if (mThread.joinable()) {
// If the backend is being destroyed from the thread itself, detach, otherwise join.
if (mThread.get_id() == std::this_thread::get_id()) {
mThread.detach();
} else {
mThread.join();
}
}
#endif
}
void Backend::watch(WatcherRef watcher) {
std::unique_lock<std::mutex> lock(mMutex);
auto res = mSubscriptions.find(watcher);
if (res == mSubscriptions.end()) {
try {
this->subscribe(watcher);
mSubscriptions.insert(watcher);
} catch (std::exception&) {
unref();
throw;
}
}
}
void Backend::unwatch(WatcherRef watcher) {
std::unique_lock<std::mutex> lock(mMutex);
size_t deleted = mSubscriptions.erase(watcher);
if (deleted > 0) {
this->unsubscribe(watcher);
unref();
}
}
void Backend::unref() {
if (mSubscriptions.size() == 0) {
removeShared(this);
}
}
void Backend::handleWatcherError(WatcherError &err) {
unwatch(err.mWatcher);
err.mWatcher->notifyError(err);
}
void Backend::handleError(std::exception &err) {
std::unique_lock<std::mutex> lock(mMutex);
for (auto it = mSubscriptions.begin(); it != mSubscriptions.end(); it++) {
(*it)->notifyError(err);
}
removeShared(this);
}
@@ -0,0 +1,122 @@
/**
* Convert to snake_case (matches to-snake-case library behavior)
* Handles camelCase, PascalCase, and hyphens
*/ export const toSnakeCase = (str)=>{
return str.replace(/([A-Z])/g, '_$1').toLowerCase().replace(/^_/, '').replace(/-/g, '_') // Convert hyphens to underscores
;
};
/**
* Core logic for calculating the status of each locale for each version
* by processing version history chronologically.
*
* This works by:
* 1. Processing versions in chronological order (oldest first)
* 2. Tracking the cumulative published state for each document as we process versions
* 3. For each version, determining what status each locale should have based on:
* - Publish events with publishedLocale: mark that locale as published, version shows NEW state
* - Publish events without publishedLocale: mark all locales as published, version shows NEW state
* - Draft saves (_status='draft'): mark all locales as draft (unpublish everything)
* - Snapshots: preserve state AFTER publish (snapshots created after publishing specific locale)
*
* Snapshot creation flow when publishing one locale:
* 1. Merge incoming content with last published → update main table
* 2. Create snapshot object (preserves other locales' draft content + updates published locale)
* 3. Create publish version (_status='published', publishedLocale set)
* 4. Create snapshot version (_status='draft', snapshot=true)
* - Snapshot CONTENT is mixed (draft + published content)
* - Snapshot STATUS reflects which locales are actually published
*
* Example scenario:
* - V1: publish all locales (no snapshot) → state: {en: published, es: published, de: published}
* - V2: draft save → state: {en: draft, es: draft, de: draft}
* - V3: publish en only → state: {en: published, es: draft, de: draft}
* - V4: snapshot after publishing en → state: {en: published, es: draft, de: draft}
* - V5: publish all locales (no snapshot) → state: {en: published, es: published, de: published}
*
* @param versions - Array of version records (must be sorted by parent, then createdAt ASC)
* @param locales - Array of locale codes (e.g., ['en', 'es', 'pt'])
* @param payload - Payload instance for logging
* @returns Map of versionId -> Map of locale -> status
*/ export function calculateVersionLocaleStatuses(versions, locales, payload) {
payload.logger.info({
msg: `Processing ${versions.length} version records`
});
// Track the cumulative published state for each document across all locales
// This represents what IS published at any given point in the version history
const documentPublishState = new Map();
// Map to store the final status for each version
const versionLocaleStatus = new Map();
// Process versions chronologically to build up status history
for (const version of versions){
const versionId = version.id;
const documentId = version.parent;
const status = version._status;
const publishedLocale = version.published_locale || version.publishedLocale;
const isSnapshot = version.snapshot === true;
// Initialize document state if first time seeing this document
if (!documentPublishState.has(documentId)) {
const localeMap = new Map();
for (const locale of locales){
localeMap.set(locale, 'draft');
}
documentPublishState.set(documentId, localeMap);
}
const currentPublishState = documentPublishState.get(documentId);
const versionStatusMap = new Map();
if (isSnapshot) {
// Snapshots are created AFTER publishing a specific locale
// Snapshot CONTENT is mixed: preserves other locales' draft content + new published locale content
// But snapshot STATUS should reflect publish state: which locales are published vs draft
// We use currentPublishState to track this, which has been updated by the previous publish
for (const [locale, publishedStatus] of currentPublishState.entries()){
versionStatusMap.set(locale, publishedStatus);
}
} else if (status === 'published') {
// This is a publish event
if (publishedLocale) {
// Publishing ONE locale - update the document's published state for that locale
currentPublishState.set(publishedLocale, 'published');
// This version should show the NEW state (after this publish)
for (const [locale, publishedStatus] of currentPublishState.entries()){
versionStatusMap.set(locale, publishedStatus);
}
} else {
// Publishing ALL locales - update all locales to published
for (const locale of locales){
currentPublishState.set(locale, 'published');
versionStatusMap.set(locale, 'published');
}
}
} else {
// This is a draft save - in the OLD system, _status='draft' meant unpublish ALL locales
for (const locale of locales){
currentPublishState.set(locale, 'draft');
versionStatusMap.set(locale, 'draft');
}
}
// Store the status for this version
versionLocaleStatus.set(versionId, versionStatusMap);
}
return versionLocaleStatus;
}
/**
* Sorts version records by parent document, then by creation date (oldest first)
*
* @param versions - Array of version records
* @returns Sorted array of version records
*/ export function sortVersionsChronologically(versions) {
return versions.sort((a, b)=>{
// First sort by parent
const parentA = String(a.parent);
const parentB = String(b.parent);
if (parentA !== parentB) {
return parentA.localeCompare(parentB);
}
// Then sort by creation date
const dateA = new Date(a.created_at || a.createdAt || 0);
const dateB = new Date(b.created_at || b.createdAt || 0);
return dateA.getTime() - dateB.getTime();
});
}
//# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
{"version":3,"file":"chef-hat.js","sources":["../../../src/icons/chef-hat.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChefHat\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgMjFhMSAxIDAgMCAwIDEtMXYtNS4zNWMwLS40NTcuMzE2LS44NDQuNzI3LTEuMDQxYTQgNCAwIDAgMC0yLjEzNC03LjU4OSA1IDUgMCAwIDAtOS4xODYgMCA0IDQgMCAwIDAtMi4xMzQgNy41ODhjLjQxMS4xOTguNzI3LjU4NS43MjcgMS4wNDFWMjBhMSAxIDAgMCAwIDEgMVoiIC8+CiAgPHBhdGggZD0iTTYgMTdoMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/chef-hat\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 ChefHat = createLucideIcon('ChefHat', [\n [\n 'path',\n {\n d: 'M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z',\n key: '1qvrer',\n },\n ],\n ['path', { d: 'M6 17h12', key: '1jwigz' }],\n]);\n\nexport default ChefHat;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _regex = _interopRequireDefault(require("./regex.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function validate(uuid) {
return typeof uuid === 'string' && _regex.default.test(uuid);
}
var _default = validate;
exports.default = _default;
@@ -0,0 +1 @@
{"version":3,"file":"plug-zap.js","sources":["../../../src/icons/plug-zap.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PlugZap\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNi4zIDIwLjNhMi40IDIuNCAwIDAgMCAzLjQgMEwxMiAxOGwtNi02LTIuMyAyLjNhMi40IDIuNCAwIDAgMCAwIDMuNFoiIC8+CiAgPHBhdGggZD0ibTIgMjIgMy0zIiAvPgogIDxwYXRoIGQ9Ik03LjUgMTMuNSAxMCAxMSIgLz4KICA8cGF0aCBkPSJNMTAuNSAxNi41IDEzIDE0IiAvPgogIDxwYXRoIGQ9Im0xOCAzLTQgNGg2bC00IDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/plug-zap\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 PlugZap = createLucideIcon('PlugZap', [\n [\n 'path',\n { d: 'M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z', key: 'goz73y' },\n ],\n ['path', { d: 'm2 22 3-3', key: '19mgm9' }],\n ['path', { d: 'M7.5 13.5 10 11', key: '7xgeeb' }],\n ['path', { d: 'M10.5 16.5 13 14', key: '10btkg' }],\n ['path', { d: 'm18 3-4 4h6l-4 4', key: '16psg9' }],\n]);\n\nexport default PlugZap;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC9F,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,23 @@
'use strict'
const fs = require('fs')
const { Writable } = require('stream')
function run (opts) {
let data = ''
return new Writable({
autoDestroy: true,
write (chunk, enc, cb) {
data += chunk.toString()
cb()
},
destroy (err, cb) {
// process._rawDebug('destroy called')
fs.writeFile(opts.dest, data, function (err2) {
cb(err2 || err)
})
}
})
}
module.exports = run
@@ -0,0 +1 @@
import{a as t}from"./chunk-CUNVWAK5.js";var r={...Object.fromEntries(Object.entries(t).filter(([e])=>e!=="extra")),...t.extra.unofficial},i=r;export{i as default,r as status};
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/gel-core/columns/relative-duration.ts"],"sourcesContent":["import type { RelativeDuration } from 'gel';\nimport type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyGelTable } from '~/gel-core/table.ts';\nimport { GelColumn, GelColumnBuilder } from './common.ts';\n\nexport type GelRelDurationBuilderInitial<TName extends string> = GelRelDurationBuilder<{\n\tname: TName;\n\tdataType: 'relDuration';\n\tcolumnType: 'GelRelDuration';\n\tdata: RelativeDuration;\n\tdriverParam: RelativeDuration;\n\tenumValues: undefined;\n}>;\n\nexport class GelRelDurationBuilder<T extends ColumnBuilderBaseConfig<'relDuration', 'GelRelDuration'>>\n\textends GelColumnBuilder<T>\n{\n\tstatic override readonly [entityKind]: string = 'GelRelDurationBuilder';\n\n\tconstructor(\n\t\tname: T['name'],\n\t) {\n\t\tsuper(name, 'relDuration', 'GelRelDuration');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyGelTable<{ name: TTableName }>,\n\t): GelRelDuration<MakeColumnConfig<T, TTableName>> {\n\t\treturn new GelRelDuration<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class GelRelDuration<T extends ColumnBaseConfig<'relDuration', 'GelRelDuration'>> extends GelColumn<T> {\n\tstatic override readonly [entityKind]: string = 'GelRelDuration';\n\n\tgetSQLType(): string {\n\t\treturn `edgedbt.relative_duration_t`;\n\t}\n}\n\nexport function relDuration(): GelRelDurationBuilderInitial<''>;\nexport function relDuration<TName extends string>(name: TName): GelRelDurationBuilderInitial<TName>;\nexport function relDuration(name?: string) {\n\treturn new GelRelDurationBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAA2B;AAE3B,oBAA4C;AAWrC,MAAM,8BACJ,+BACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YACC,MACC;AACD,UAAM,MAAM,eAAe,gBAAgB;AAAA,EAC5C;AAAA;AAAA,EAGS,MACR,OACkD;AAClD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,uBAAoF,wBAAa;AAAA,EAC7G,QAA0B,wBAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAIO,SAAS,YAAY,MAAe;AAC1C,SAAO,IAAI,sBAAsB,QAAQ,EAAE;AAC5C;","names":[]}
@@ -0,0 +1,19 @@
/**
* @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 EarOff = createLucideIcon("EarOff", [
["path", { d: "M6 18.5a3.5 3.5 0 1 0 7 0c0-1.57.92-2.52 2.04-3.46", key: "1qngmn" }],
["path", { d: "M6 8.5c0-.75.13-1.47.36-2.14", key: "b06bma" }],
["path", { d: "M8.8 3.15A6.5 6.5 0 0 1 19 8.5c0 1.63-.44 2.81-1.09 3.76", key: "g10hsz" }],
["path", { d: "M12.5 6A2.5 2.5 0 0 1 15 8.5M10 13a2 2 0 0 0 1.82-1.18", key: "ygzou7" }],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { EarOff as default };
//# sourceMappingURL=ear-off.js.map
@@ -0,0 +1,296 @@
import { checkSync } from "recheck";
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("basic datetime parsing", () => {
const datetime = z.string().datetime();
datetime.parse("1970-01-01T00:00:00.000Z");
datetime.parse("2022-10-13T09:52:31.816Z");
datetime.parse("2022-10-13T09:52:31.8162314Z");
datetime.parse("1970-01-01T00:00:00Z");
datetime.parse("2022-10-13T09:52:31Z");
expect(() => datetime.parse("")).toThrow();
expect(() => datetime.parse("foo")).toThrow();
expect(() => datetime.parse("2020-10-14")).toThrow();
expect(() => datetime.parse("T18:45:12.123")).toThrow();
expect(() => datetime.parse("2020-10-14T17:42:29+00:00")).toThrow();
});
test("datetime parsing with precision -1", () => {
const datetimeNoMs = z.string().datetime({ precision: -1, offset: true, local: true });
datetimeNoMs.parse("1970-01-01T00:00Z");
datetimeNoMs.parse("2022-10-13T09:52Z");
datetimeNoMs.parse("2022-10-13T09:52+02:00");
datetimeNoMs.parse("2022-10-13T09:52");
expect(() => datetimeNoMs.parse("tuna")).toThrow();
expect(() => datetimeNoMs.parse("2022-10-13T09:52+02")).toThrow();
expect(() => datetimeNoMs.parse("1970-01-01T00:00:00.000Z")).toThrow();
expect(() => datetimeNoMs.parse("1970-01-01T00:00:00.Z")).toThrow();
expect(() => datetimeNoMs.parse("2022-10-13T09:52:31.816Z")).toThrow();
});
test("datetime parsing with precision 0", () => {
const datetimeNoMs = z.string().datetime({ precision: 0 });
datetimeNoMs.parse("1970-01-01T00:00:00Z");
datetimeNoMs.parse("2022-10-13T09:52:31Z");
expect(() => datetimeNoMs.parse("tuna")).toThrow();
expect(() => datetimeNoMs.parse("1970-01-01T00:00:00.000Z")).toThrow();
expect(() => datetimeNoMs.parse("1970-01-01T00:00:00.Z")).toThrow();
expect(() => datetimeNoMs.parse("2022-10-13T09:52:31.816Z")).toThrow();
});
test("datetime parsing with precision 3", () => {
const datetime3Ms = z.string().datetime({ precision: 3 });
datetime3Ms.parse("1970-01-01T00:00:00.000Z");
datetime3Ms.parse("2022-10-13T09:52:31.123Z");
expect(() => datetime3Ms.parse("tuna")).toThrow();
expect(() => datetime3Ms.parse("1970-01-01T00:00:00.1Z")).toThrow();
expect(() => datetime3Ms.parse("1970-01-01T00:00:00.12Z")).toThrow();
expect(() => datetime3Ms.parse("2022-10-13T09:52:31Z")).toThrow();
});
test("datetime parsing with offset", () => {
const datetimeOffset = z.string().datetime({ offset: true });
datetimeOffset.parse("1970-01-01T00:00:00.000Z");
datetimeOffset.parse("2022-10-13T09:52:31.816234134Z");
datetimeOffset.parse("1970-01-01T00:00:00Z");
datetimeOffset.parse("2022-10-13T09:52:31.4Z");
datetimeOffset.parse("2020-10-14T17:42:29+00:00");
datetimeOffset.parse("2020-10-14T17:42:29+03:15");
expect(() => datetimeOffset.parse("2020-10-14T17:42:29+0315")).toThrow();
expect(() => datetimeOffset.parse("2020-10-14T17:42:29+03")).toThrow();
expect(() => datetimeOffset.parse("tuna")).toThrow();
expect(() => datetimeOffset.parse("2022-10-13T09:52:31.Z")).toThrow();
});
test("datetime parsing with offset and precision 0", () => {
const datetimeOffsetNoMs = z.string().datetime({ offset: true, precision: 0 });
datetimeOffsetNoMs.parse("1970-01-01T00:00:00Z");
datetimeOffsetNoMs.parse("2022-10-13T09:52:31Z");
datetimeOffsetNoMs.parse("2020-10-14T17:42:29+00:00");
expect(() => datetimeOffsetNoMs.parse("2020-10-14T17:42:29+0000")).toThrow();
expect(() => datetimeOffsetNoMs.parse("2020-10-14T17:42:29+00")).toThrow();
expect(() => datetimeOffsetNoMs.parse("tuna")).toThrow();
expect(() => datetimeOffsetNoMs.parse("1970-01-01T00:00:00.000Z")).toThrow();
expect(() => datetimeOffsetNoMs.parse("1970-01-01T00:00:00.Z")).toThrow();
expect(() => datetimeOffsetNoMs.parse("2022-10-13T09:52:31.816Z")).toThrow();
expect(() => datetimeOffsetNoMs.parse("2020-10-14T17:42:29.124+00:00")).toThrow();
});
test("datetime parsing with offset and precision 4", () => {
const datetimeOffset4Ms = z.string().datetime({ offset: true, precision: 4 });
datetimeOffset4Ms.parse("1970-01-01T00:00:00.1234Z");
datetimeOffset4Ms.parse("2020-10-14T17:42:29.1234+00:00");
expect(() => datetimeOffset4Ms.parse("2020-10-14T17:42:29.1234+0000")).toThrow();
expect(() => datetimeOffset4Ms.parse("2020-10-14T17:42:29.1234+00")).toThrow();
expect(() => datetimeOffset4Ms.parse("tuna")).toThrow();
expect(() => datetimeOffset4Ms.parse("1970-01-01T00:00:00.123Z")).toThrow();
expect(() => datetimeOffset4Ms.parse("2020-10-14T17:42:29.124+00:00")).toThrow();
});
test("datetime offset normalization", () => {
const a = z.iso.datetime({ offset: true });
expect(a.safeParse("2020-10-14T17:42:29+02")).toMatchObject({ success: false });
expect(a.safeParse("2020-10-14T17:42:29+0200")).toMatchObject({ success: false });
a.safeParse("2020-10-14T17:42:29+02:00");
});
test("datetime parsing with local option", () => {
const a = z.string().datetime({ local: true });
expect(a.safeParse("1970-01-01T00:00")).toMatchObject({ success: true });
expect(a.safeParse("1970-01-01T00:00:00")).toMatchObject({ success: true });
expect(a.safeParse("2022-10-13T09:52:31.816")).toMatchObject({ success: true });
expect(a.safeParse("1970-01-01T00:00:00.000")).toMatchObject({ success: true });
expect(a.safeParse("1970-01-01T00")).toMatchObject({ success: false });
// Should reject timezone indicators and invalid formats
expect(() => a.parse("2022-10-13T09:52:31+00:00")).toThrow();
expect(() => a.parse("2022-10-13 09:52:31")).toThrow();
expect(() => a.parse("2022-10-13T24:52:31")).toThrow();
expect(() => a.parse("2022-10-13T24:52")).toThrow();
expect(() => a.parse("2022-10-13T24:52Z")).toThrow();
});
test("datetime parsing with local and offset", () => {
const a = z.string().datetime({ local: true, offset: true });
// expect(a.parse("2022-10-13T12:52")).toEqual("2022-10-13T12:52:00");
a.parse("2022-10-13T12:52:00");
a.parse("2022-10-13T12:52:00Z");
a.parse("2022-10-13T12:52Z");
a.parse("2022-10-13T12:52");
a.parse("2022-10-13T12:52+02:00");
expect(() => a.parse("2022-10-13T12:52:00+02")).toThrow();
// expect(() => a.parse("2022-10-13T12:52Z")).toThrow();
// expect(() => a.parse("2022-10-13T12:52+02:00")).toThrow();
});
test("date parsing", () => {
const date = z.string().date();
date.parse("1970-01-01");
date.parse("2022-01-31");
date.parse("2022-03-31");
date.parse("2022-04-30");
date.parse("2022-05-31");
date.parse("2022-06-30");
date.parse("2022-07-31");
date.parse("2022-08-31");
date.parse("2022-09-30");
date.parse("2022-10-31");
date.parse("2022-11-30");
date.parse("2022-12-31");
date.parse("2000-02-29");
date.parse("2400-02-29");
expect(() => date.parse("2022-02-29")).toThrow();
expect(() => date.parse("2100-02-29")).toThrow();
expect(() => date.parse("2200-02-29")).toThrow();
expect(() => date.parse("2300-02-29")).toThrow();
expect(() => date.parse("2500-02-29")).toThrow();
expect(() => date.parse("")).toThrow();
expect(() => date.parse("foo")).toThrow();
expect(() => date.parse("200-01-01")).toThrow();
expect(() => date.parse("20000-01-01")).toThrow();
expect(() => date.parse("2000-0-01")).toThrow();
expect(() => date.parse("2000-011-01")).toThrow();
expect(() => date.parse("2000-01-0")).toThrow();
expect(() => date.parse("2000-01-011")).toThrow();
expect(() => date.parse("2000/01/01")).toThrow();
expect(() => date.parse("01-01-2022")).toThrow();
expect(() => date.parse("01/01/2022")).toThrow();
expect(() => date.parse("2000-01-01 00:00:00Z")).toThrow();
expect(() => date.parse("2020-10-14T17:42:29+00:00")).toThrow();
expect(() => date.parse("2020-10-14T17:42:29Z")).toThrow();
expect(() => date.parse("2020-10-14T17:42:29")).toThrow();
expect(() => date.parse("2020-10-14T17:42:29.123Z")).toThrow();
expect(() => date.parse("2000-00-12")).toThrow();
expect(() => date.parse("2000-12-00")).toThrow();
expect(() => date.parse("2000-01-32")).toThrow();
expect(() => date.parse("2000-13-01")).toThrow();
expect(() => date.parse("2000-21-01")).toThrow();
expect(() => date.parse("2000-02-30")).toThrow();
expect(() => date.parse("2000-02-31")).toThrow();
expect(() => date.parse("2000-04-31")).toThrow();
expect(() => date.parse("2000-06-31")).toThrow();
expect(() => date.parse("2000-09-31")).toThrow();
expect(() => date.parse("2000-11-31")).toThrow();
});
test("time parsing", () => {
const time = z.string().time();
time.parse("00:00:00");
time.parse("23:00:00");
time.parse("00:59:00");
time.parse("00:00:59");
time.parse("23:59:59");
time.parse("09:52:31");
time.parse("23:59:59.9999999");
time.parse("00:00");
expect(() => time.parse("")).toThrow();
expect(() => time.parse("foo")).toThrow();
expect(() => time.parse("00:00:00Z")).toThrow();
expect(() => time.parse("0:00:00")).toThrow();
expect(() => time.parse("00:0:00")).toThrow();
expect(() => time.parse("00:00:0")).toThrow();
expect(() => time.parse("00:00:00.000+00:00")).toThrow();
expect(() => time.parse("24:00:00")).toThrow();
expect(() => time.parse("00:60:00")).toThrow();
expect(() => time.parse("00:00:60")).toThrow();
expect(() => time.parse("24:60:60")).toThrow();
const time2 = z.string().time({ precision: 2 });
time2.parse("00:00:00.00");
time2.parse("09:52:31.12");
time2.parse("23:59:59.99");
expect(() => time2.parse("")).toThrow();
expect(() => time2.parse("foo")).toThrow();
expect(() => time2.parse("00:00:00")).toThrow();
expect(() => time2.parse("00:00:00.00Z")).toThrow();
expect(() => time2.parse("00:00:00.0")).toThrow();
expect(() => time2.parse("00:00:00.000")).toThrow();
expect(() => time2.parse("00:00:00.00+00:00")).toThrow();
const time3 = z.string().time({ precision: z.TimePrecision.Minute });
time3.parse("00:00");
expect(() => time3.parse("00:00:00")).toThrow();
});
test("duration", () => {
const duration = z.string().duration();
const validDurations = [
"P3Y6M4DT12H30M5S",
"P2Y9M3DT12H31M8.001S",
// "+P3Y6M4DT12H30M5S",
// "-PT0.001S",
// "+PT0.001S",
"PT0,001S",
"PT12H30M5S",
// "-P2M1D",
// "P-2M-1D",
// "-P5DT10H",
// "P-5DT-10H",
"P1Y",
"P2MT30M",
"PT6H",
"P5W",
// "P0.5Y",
// "P0,5Y",
// "P42YT7.004M",
];
const invalidDurations = [
"foo bar",
"",
" ",
"P",
"PT",
"P1Y2MT",
"T1H",
"P0.5Y1D",
"P0,5Y6M",
"P1YT",
"P-2M-1D",
"P-5DT-10H",
"P1W2D",
"-P1D",
];
for (const val of validDurations) {
const result = duration.safeParse(val);
if (!result.success) {
throw Error(`Valid duration could not be parsed: ${val}`);
}
}
for (const val of invalidDurations) {
const result = duration.safeParse(val);
if (result.success) {
throw Error(`Invalid duration was successful parsed: ${val}`);
}
expect(result.error.issues[0].message).toEqual("Invalid ISO duration");
}
});
test("redos checker", () => {
const a = z.iso.datetime();
const b = z.string().datetime({ offset: true });
const c = z.string().datetime({ local: true });
const d = z.string().datetime({ local: true, offset: true, precision: 3 });
const e = z.string().date();
const f = z.string().time();
const g = z.string().duration();
for (const schema of [a, b, c, d, e, f, g]) {
const result = checkSync(schema._zod.pattern.source, "");
if (result.status !== "safe") throw Error("ReDoS issue");
}
});
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/Table/DefaultCell/fields/Blocks/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAG3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,WAAW,eAAgB,SAAQ,yBAAyB,CAAC,iBAAiB,CAAC;CAAG;AAExF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2ChD,CAAA"}
@@ -0,0 +1,2 @@
import type { DateFnsDocs } from "@date-fns/docs";
export declare const config: DateFnsDocs.Config;
@@ -0,0 +1,33 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
const makeSerializable = require("./util/makeSerializable");
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
class CommentCompilationWarning extends WebpackError {
/**
* @param {string} message warning message
* @param {DependencyLocation} loc affected lines of code
*/
constructor(message, loc) {
super(message);
/** @type {string} */
this.name = "CommentCompilationWarning";
/** @type {DependencyLocation} */
this.loc = loc;
}
}
makeSerializable(
CommentCompilationWarning,
"webpack/lib/CommentCompilationWarning"
);
module.exports = CommentCompilationWarning;
@@ -0,0 +1,16 @@
import type { SanitizedCollectionConfig } from '../collections/config/types.js';
import type { JsonObject, PayloadRequest } from '../types/index.js';
type GetDuplicateDocumentArgs = {
collectionConfig: SanitizedCollectionConfig;
draftArg?: boolean;
id: number | string;
overrideAccess?: boolean;
req: PayloadRequest;
selectedLocales?: string[];
};
export declare const getDuplicateDocumentData: ({ id, collectionConfig, draftArg, overrideAccess, req, selectedLocales, }: GetDuplicateDocumentArgs) => Promise<{
duplicatedFromDoc: JsonObject;
duplicatedFromDocWithLocales: JsonObject;
}>;
export {};
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,150 @@
/**
* @license React
* scheduler-unstable_post_task.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function runTask(priorityLevel, postTaskPriority, node, callback) {
deadline = getCurrentTime() + 5;
try {
currentPriorityLevel_DEPRECATED = priorityLevel;
var result = callback(!1);
if ("function" === typeof result) {
var continuationOptions = { signal: node._controller.signal },
nextTask = runTask.bind(
null,
priorityLevel,
postTaskPriority,
node,
result
);
void 0 !== scheduler.yield
? scheduler
.yield(continuationOptions)
.then(nextTask)
.catch(handleAbortError)
: scheduler
.postTask(nextTask, continuationOptions)
.catch(handleAbortError);
}
} catch (error) {
setTimeout(function () {
throw error;
});
} finally {
currentPriorityLevel_DEPRECATED = 3;
}
}
function handleAbortError() {}
var perf = window.performance,
setTimeout = window.setTimeout,
scheduler = global.scheduler,
getCurrentTime = perf.now.bind(perf),
deadline = 0,
currentPriorityLevel_DEPRECATED = 3;
exports.unstable_IdlePriority = 5;
exports.unstable_ImmediatePriority = 1;
exports.unstable_LowPriority = 4;
exports.unstable_NormalPriority = 3;
exports.unstable_Profiling = null;
exports.unstable_UserBlockingPriority = 2;
exports.unstable_cancelCallback = function (node) {
node._controller.abort();
};
exports.unstable_forceFrameRate = function () {};
exports.unstable_getCurrentPriorityLevel = function () {
return currentPriorityLevel_DEPRECATED;
};
exports.unstable_next = function (callback) {
switch (currentPriorityLevel_DEPRECATED) {
case 1:
case 2:
case 3:
var priorityLevel = 3;
break;
default:
priorityLevel = currentPriorityLevel_DEPRECATED;
}
var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
currentPriorityLevel_DEPRECATED = priorityLevel;
try {
return callback();
} finally {
currentPriorityLevel_DEPRECATED = previousPriorityLevel;
}
};
exports.unstable_now = getCurrentTime;
exports.unstable_requestPaint = function () {};
exports.unstable_runWithPriority = function (priorityLevel, callback) {
var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
currentPriorityLevel_DEPRECATED = priorityLevel;
try {
return callback();
} finally {
currentPriorityLevel_DEPRECATED = previousPriorityLevel;
}
};
exports.unstable_scheduleCallback = function (
priorityLevel,
callback,
options
) {
switch (priorityLevel) {
case 1:
case 2:
var postTaskPriority = "user-blocking";
break;
case 4:
case 3:
postTaskPriority = "user-visible";
break;
case 5:
postTaskPriority = "background";
break;
default:
postTaskPriority = "user-visible";
}
var controller = new TaskController({ priority: postTaskPriority });
options = {
delay:
"object" === typeof options && null !== options ? options.delay : 0,
signal: controller.signal
};
controller = { _controller: controller };
scheduler
.postTask(
runTask.bind(
null,
priorityLevel,
postTaskPriority,
controller,
callback
),
options
)
.catch(handleAbortError);
return controller;
};
exports.unstable_shouldYield = function () {
return getCurrentTime() >= deadline;
};
exports.unstable_wrapCallback = function (callback) {
var parentPriorityLevel = currentPriorityLevel_DEPRECATED;
return function () {
var previousPriorityLevel = currentPriorityLevel_DEPRECATED;
currentPriorityLevel_DEPRECATED = parentPriorityLevel;
try {
return callback();
} finally {
currentPriorityLevel_DEPRECATED = previousPriorityLevel;
}
};
};
})();
@@ -0,0 +1 @@
{"version":3,"file":"relationshipPopulationPromise.d.ts","sourceRoot":"","sources":["../../../../src/fields/hooks/afterRead/relationshipPopulationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAoItF,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd,cAAc,EAAE,mBAAmB,CAAA;IACnC,KAAK,EAAE,SAAS,GAAG,iBAAiB,GAAG,WAAW,CAAA;IAClD,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;IACrB,cAAc,EAAE,OAAO,CAAA;IACvB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,6BAA6B,gKAavC,WAAW,KAAG,OAAO,CAAC,IAAI,CAoH5B,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"subscript.js","sources":["../../../src/icons/subscript.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Subscript\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNCA1IDggOCIgLz4KICA8cGF0aCBkPSJtMTIgNS04IDgiIC8+CiAgPHBhdGggZD0iTTIwIDE5aC00YzAtMS41LjQ0LTIgMS41LTIuNVMyMCAxNS4zMyAyMCAxNGMwLS40Ny0uMTctLjkzLS40OC0xLjI5YTIuMTEgMi4xMSAwIDAgMC0yLjYyLS40NGMtLjQyLjI0LS43NC42Mi0uOSAxLjA3IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/subscript\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 Subscript = createLucideIcon('Subscript', [\n ['path', { d: 'm4 5 8 8', key: '1eunvl' }],\n ['path', { d: 'm12 5-8 8', key: '1ah0jp' }],\n [\n 'path',\n {\n d: 'M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07',\n key: 'e8ta8j',\n },\n ],\n]);\n\nexport default Subscript;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,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,CAC1C,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,92 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Parser = require("../Parser");
const JsonExportsDependency = require("../dependencies/JsonExportsDependency");
const memoize = require("../util/memoize");
const JsonData = require("./JsonData");
/** @typedef {import("../../declarations/plugins/JsonModulesPluginParser").JsonModulesPluginParserOptions} JsonModulesPluginParserOptions */
/** @typedef {import("../Module").BuildInfo} BuildInfo */
/** @typedef {import("../Module").BuildMeta} BuildMeta */
/** @typedef {import("../Parser").ParserState} ParserState */
/** @typedef {import("../Parser").PreparsedAst} PreparsedAst */
/** @typedef {import("../util/fs").JsonValue} JsonValue */
/**
* @template T
* @typedef {import("../util/memoize").FunctionReturning<T>} FunctionReturning
*/
/** @typedef {(input: string) => Buffer | JsonValue} ParseFn */
/** @type {FunctionReturning<ParseFn>} */
const getParseJson = memoize(() => require("json-parse-even-better-errors"));
class JsonParser extends Parser {
/**
* @param {JsonModulesPluginParserOptions} options parser options
*/
constructor(options) {
super();
this.options = options || {};
}
/**
* @param {string | Buffer | PreparsedAst} source the source to parse
* @param {ParserState} state the parser state
* @returns {ParserState} the parser state
*/
parse(source, state) {
if (Buffer.isBuffer(source)) {
source = source.toString("utf8");
}
/** @type {ParseFn} */
const parseFn =
typeof this.options.parse === "function"
? this.options.parse
: getParseJson();
/** @type {Buffer | JsonValue | undefined} */
let data;
try {
data =
typeof source === "object"
? source
: parseFn(source[0] === "\uFEFF" ? source.slice(1) : source);
} catch (err) {
throw new Error(
`Cannot parse JSON: ${/** @type {Error} */ (err).message}`,
{ cause: err }
);
}
const jsonData = new JsonData(/** @type {Buffer | JsonValue} */ (data));
const buildInfo = /** @type {BuildInfo} */ (state.module.buildInfo);
buildInfo.jsonData = jsonData;
buildInfo.strict = true;
const buildMeta = /** @type {BuildMeta} */ (state.module.buildMeta);
buildMeta.exportsType = "default";
buildMeta.defaultObject =
typeof data === "object"
? this.options.namedExports === false
? false
: this.options.namedExports === true
? "redirect"
: "redirect-warn"
: false;
state.module.addDependency(
new JsonExportsDependency(
jsonData,
/** @type {number} */
(this.options.exportsDepth)
)
);
return state;
}
}
module.exports = JsonParser;
@@ -0,0 +1,529 @@
'use strict'
function deepClone (obj) {
if (obj === null || typeof obj !== 'object') {
return obj
}
if (obj instanceof Date) {
return new Date(obj.getTime())
}
if (obj instanceof Array) {
const cloned = []
for (let i = 0; i < obj.length; i++) {
cloned[i] = deepClone(obj[i])
}
return cloned
}
if (typeof obj === 'object') {
const cloned = Object.create(Object.getPrototypeOf(obj))
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
cloned[key] = deepClone(obj[key])
}
}
return cloned
}
return obj
}
function parsePath (path) {
const parts = []
let current = ''
let inBrackets = false
let inQuotes = false
let quoteChar = ''
for (let i = 0; i < path.length; i++) {
const char = path[i]
if (!inBrackets && char === '.') {
if (current) {
parts.push(current)
current = ''
}
} else if (char === '[') {
if (current) {
parts.push(current)
current = ''
}
inBrackets = true
} else if (char === ']' && inBrackets) {
// Always push the current value when closing brackets, even if it's an empty string
parts.push(current)
current = ''
inBrackets = false
inQuotes = false
} else if ((char === '"' || char === "'") && inBrackets) {
if (!inQuotes) {
inQuotes = true
quoteChar = char
} else if (char === quoteChar) {
inQuotes = false
quoteChar = ''
} else {
current += char
}
} else {
current += char
}
}
if (current) {
parts.push(current)
}
return parts
}
function setValue (obj, parts, value) {
let current = obj
for (let i = 0; i < parts.length - 1; i++) {
const key = parts[i]
// Type safety: Check if current is an object before using 'in' operator
if (typeof current !== 'object' || current === null || !(key in current)) {
return false // Path doesn't exist, don't create it
}
if (typeof current[key] !== 'object' || current[key] === null) {
return false // Path doesn't exist properly
}
current = current[key]
}
const lastKey = parts[parts.length - 1]
if (lastKey === '*') {
if (Array.isArray(current)) {
for (let i = 0; i < current.length; i++) {
current[i] = value
}
} else if (typeof current === 'object' && current !== null) {
for (const key in current) {
if (Object.prototype.hasOwnProperty.call(current, key)) {
current[key] = value
}
}
}
} else {
// Type safety: Check if current is an object before using 'in' operator
if (typeof current === 'object' && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) {
current[lastKey] = value
}
}
return true
}
function removeKey (obj, parts) {
let current = obj
for (let i = 0; i < parts.length - 1; i++) {
const key = parts[i]
// Type safety: Check if current is an object before using 'in' operator
if (typeof current !== 'object' || current === null || !(key in current)) {
return false // Path doesn't exist, don't create it
}
if (typeof current[key] !== 'object' || current[key] === null) {
return false // Path doesn't exist properly
}
current = current[key]
}
const lastKey = parts[parts.length - 1]
if (lastKey === '*') {
if (Array.isArray(current)) {
// For arrays, we can't really "remove" all items as that would change indices
// Instead, we set them to undefined which will be omitted by JSON.stringify
for (let i = 0; i < current.length; i++) {
current[i] = undefined
}
} else if (typeof current === 'object' && current !== null) {
for (const key in current) {
if (Object.prototype.hasOwnProperty.call(current, key)) {
delete current[key]
}
}
}
} else {
// Type safety: Check if current is an object before using 'in' operator
if (typeof current === 'object' && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) {
delete current[lastKey]
}
}
return true
}
// Sentinel object to distinguish between undefined value and non-existent path
const PATH_NOT_FOUND = Symbol('PATH_NOT_FOUND')
function getValueIfExists (obj, parts) {
let current = obj
for (const part of parts) {
if (current === null || current === undefined) {
return PATH_NOT_FOUND
}
// Type safety: Check if current is an object before property access
if (typeof current !== 'object' || current === null) {
return PATH_NOT_FOUND
}
// Check if the property exists before accessing it
if (!(part in current)) {
return PATH_NOT_FOUND
}
current = current[part]
}
return current
}
function getValue (obj, parts) {
let current = obj
for (const part of parts) {
if (current === null || current === undefined) {
return undefined
}
// Type safety: Check if current is an object before property access
if (typeof current !== 'object' || current === null) {
return undefined
}
current = current[part]
}
return current
}
function redactPaths (obj, paths, censor, remove = false) {
for (const path of paths) {
const parts = parsePath(path)
if (parts.includes('*')) {
redactWildcardPath(obj, parts, censor, path, remove)
} else {
if (remove) {
removeKey(obj, parts)
} else {
// Get value only if path exists - single traversal
const value = getValueIfExists(obj, parts)
if (value === PATH_NOT_FOUND) {
continue
}
const actualCensor = typeof censor === 'function'
? censor(value, parts)
: censor
setValue(obj, parts, actualCensor)
}
}
}
}
function redactWildcardPath (obj, parts, censor, originalPath, remove = false) {
const wildcardIndex = parts.indexOf('*')
if (wildcardIndex === parts.length - 1) {
const parentParts = parts.slice(0, -1)
let current = obj
for (const part of parentParts) {
if (current === null || current === undefined) return
// Type safety: Check if current is an object before property access
if (typeof current !== 'object' || current === null) return
current = current[part]
}
if (Array.isArray(current)) {
if (remove) {
// For arrays, set all items to undefined which will be omitted by JSON.stringify
for (let i = 0; i < current.length; i++) {
current[i] = undefined
}
} else {
for (let i = 0; i < current.length; i++) {
const indexPath = [...parentParts, i.toString()]
const actualCensor = typeof censor === 'function'
? censor(current[i], indexPath)
: censor
current[i] = actualCensor
}
}
} else if (typeof current === 'object' && current !== null) {
if (remove) {
// Collect keys to delete to avoid issues with deleting during iteration
const keysToDelete = []
for (const key in current) {
if (Object.prototype.hasOwnProperty.call(current, key)) {
keysToDelete.push(key)
}
}
for (const key of keysToDelete) {
delete current[key]
}
} else {
for (const key in current) {
const keyPath = [...parentParts, key]
const actualCensor = typeof censor === 'function'
? censor(current[key], keyPath)
: censor
current[key] = actualCensor
}
}
}
} else {
redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove)
}
}
function redactIntermediateWildcard (obj, parts, censor, wildcardIndex, originalPath, remove = false) {
const beforeWildcard = parts.slice(0, wildcardIndex)
const afterWildcard = parts.slice(wildcardIndex + 1)
const pathArray = [] // Cached array to avoid allocations
function traverse (current, pathLength) {
if (pathLength === beforeWildcard.length) {
if (Array.isArray(current)) {
for (let i = 0; i < current.length; i++) {
pathArray[pathLength] = i.toString()
traverse(current[i], pathLength + 1)
}
} else if (typeof current === 'object' && current !== null) {
for (const key in current) {
pathArray[pathLength] = key
traverse(current[key], pathLength + 1)
}
}
} else if (pathLength < beforeWildcard.length) {
const nextKey = beforeWildcard[pathLength]
// Type safety: Check if current is an object before using 'in' operator
if (current && typeof current === 'object' && current !== null && nextKey in current) {
pathArray[pathLength] = nextKey
traverse(current[nextKey], pathLength + 1)
}
} else {
// Check if afterWildcard contains more wildcards
if (afterWildcard.includes('*')) {
// Recursively handle remaining wildcards
// Wrap censor to prepend current path context
const wrappedCensor = typeof censor === 'function'
? (value, path) => {
const fullPath = [...pathArray.slice(0, pathLength), ...path]
return censor(value, fullPath)
}
: censor
redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove)
} else {
// No more wildcards, apply the redaction directly
if (remove) {
removeKey(current, afterWildcard)
} else {
const actualCensor = typeof censor === 'function'
? censor(getValue(current, afterWildcard), [...pathArray.slice(0, pathLength), ...afterWildcard])
: censor
setValue(current, afterWildcard, actualCensor)
}
}
}
}
if (beforeWildcard.length === 0) {
traverse(obj, 0)
} else {
let current = obj
for (let i = 0; i < beforeWildcard.length; i++) {
const part = beforeWildcard[i]
if (current === null || current === undefined) return
// Type safety: Check if current is an object before property access
if (typeof current !== 'object' || current === null) return
current = current[part]
pathArray[i] = part
}
if (current !== null && current !== undefined) {
traverse(current, beforeWildcard.length)
}
}
}
function buildPathStructure (pathsToClone) {
if (pathsToClone.length === 0) {
return null // No paths to redact
}
// Parse all paths and organize by depth
const pathStructure = new Map()
for (const path of pathsToClone) {
const parts = parsePath(path)
let current = pathStructure
for (let i = 0; i < parts.length; i++) {
const part = parts[i]
if (!current.has(part)) {
current.set(part, new Map())
}
current = current.get(part)
}
}
return pathStructure
}
function selectiveClone (obj, pathStructure) {
if (!pathStructure) {
return obj // No paths to redact, return original
}
function cloneSelectively (source, pathMap, depth = 0) {
if (!pathMap || pathMap.size === 0) {
return source // No more paths to clone, return reference
}
if (source === null || typeof source !== 'object') {
return source
}
if (source instanceof Date) {
return new Date(source.getTime())
}
if (Array.isArray(source)) {
const cloned = []
for (let i = 0; i < source.length; i++) {
const indexStr = i.toString()
if (pathMap.has(indexStr) || pathMap.has('*')) {
cloned[i] = cloneSelectively(source[i], pathMap.get(indexStr) || pathMap.get('*'))
} else {
cloned[i] = source[i] // Share reference for non-redacted items
}
}
return cloned
}
// Handle objects
const cloned = Object.create(Object.getPrototypeOf(source))
for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (pathMap.has(key) || pathMap.has('*')) {
cloned[key] = cloneSelectively(source[key], pathMap.get(key) || pathMap.get('*'))
} else {
cloned[key] = source[key] // Share reference for non-redacted properties
}
}
}
return cloned
}
return cloneSelectively(obj, pathStructure)
}
function validatePath (path) {
if (typeof path !== 'string') {
throw new Error('Paths must be (non-empty) strings')
}
if (path === '') {
throw new Error('Invalid redaction path ()')
}
// Check for double dots
if (path.includes('..')) {
throw new Error(`Invalid redaction path (${path})`)
}
// Check for comma-separated paths (invalid syntax)
if (path.includes(',')) {
throw new Error(`Invalid redaction path (${path})`)
}
// Check for unmatched brackets
let bracketCount = 0
let inQuotes = false
let quoteChar = ''
for (let i = 0; i < path.length; i++) {
const char = path[i]
if ((char === '"' || char === "'") && bracketCount > 0) {
if (!inQuotes) {
inQuotes = true
quoteChar = char
} else if (char === quoteChar) {
inQuotes = false
quoteChar = ''
}
} else if (char === '[' && !inQuotes) {
bracketCount++
} else if (char === ']' && !inQuotes) {
bracketCount--
if (bracketCount < 0) {
throw new Error(`Invalid redaction path (${path})`)
}
}
}
if (bracketCount !== 0) {
throw new Error(`Invalid redaction path (${path})`)
}
}
function validatePaths (paths) {
if (!Array.isArray(paths)) {
throw new TypeError('paths must be an array')
}
for (const path of paths) {
validatePath(path)
}
}
function slowRedact (options = {}) {
const {
paths = [],
censor = '[REDACTED]',
serialize = JSON.stringify,
strict = true,
remove = false
} = options
// Validate paths upfront to match fast-redact behavior
validatePaths(paths)
// Build path structure once during setup, not on every call
const pathStructure = buildPathStructure(paths)
return function redact (obj) {
if (strict && (obj === null || typeof obj !== 'object')) {
if (obj === null || obj === undefined) {
return serialize ? serialize(obj) : obj
}
if (typeof obj !== 'object') {
return serialize ? serialize(obj) : obj
}
}
// Only clone paths that need redaction
const cloned = selectiveClone(obj, pathStructure)
const original = obj // Keep reference to original for restore
let actualCensor = censor
if (typeof censor === 'function') {
actualCensor = censor
}
redactPaths(cloned, paths, actualCensor, remove)
if (serialize === false) {
cloned.restore = function () {
return deepClone(original) // Full clone only when restore is called
}
return cloned
}
if (typeof serialize === 'function') {
return serialize(cloned)
}
return JSON.stringify(cloned)
}
}
module.exports = slowRedact
@@ -0,0 +1,66 @@
# OpenTelemetry Logs Bridge API for JavaScript
[![NPM Published Version][npm-img]][npm-url]
[![Apache License][license-image]][license-image]
**Note: This is an experimental package under active development. New releases may include breaking changes.**
This package provides everything needed to interact with the unstable OpenTelemetry Logs Bridge API, including all TypeScript interfaces, enums, and no-op implementations. It is intended for use both on the server and in the browser.
**Note: This module defines a log backend API. The API is not intended to be called by application developers directly.
It is provided for logging library authors to build log appenders, which use this API to bridge between existing
logging libraries and the OpenTelemetry log data model.**
## Alpha Software - Use at your own risk
The Logs Bridge API is considered alpha software and there is no guarantee of stability or long-term support. When the API is stabilized, it will be made available and supported long-term in the `@opentelemetry/api` package and this package will be deprecated.
## Quick Start
Purposefully left blank until SDK is available.
## Version Compatibility
Because the npm installer and node module resolution algorithm could potentially allow two or more copies of any given package to exist within the same `node_modules` structure, the OpenTelemetry API takes advantage of a variable on the `global` object to store the global API. When an API method in the API package is called, it checks if this `global` API exists and proxies calls to it if and only if it is a compatible API version. This means if a package has a dependency on an OpenTelemetry API version which is not compatible with the API used by the end user, the package will receive a no-op implementation of the API.
## Advanced Use
### API Methods
If you are writing an instrumentation library, or prefer to call the API methods directly rather than using the `register` method on the Tracer/Meter/Logger Provider, OpenTelemetry provides direct access to the underlying API methods through the `@opentelemetry/api-logs` package. API entry points are defined as global singleton objects `trace`, `metrics`, `logs`, `propagation`, and `context` which contain methods used to initialize SDK implementations and acquire resources from the API.
- [Logs API Documentation][logs-api-docs]
```javascript
const api = require("@opentelemetry/api-logs");
/* A specific implementation of LoggerProvider comes from an SDK */
const loggerProvider = createLoggerProvider();
/* Initialize LoggerProvider */
api.logs.setGlobalLoggerProvider(loggerProvider);
/* returns loggerProvider (no-op if a working provider has not been initialized) */
api.logs.getLoggerProvider();
/* returns a logger from the registered global logger provider (no-op if a working provider has not been initialized) */
const logger = api.logs.getLogger(name, version);
// logging a log record in a log appender
logger.emit({ severityNumber: SeverityNumber.TRACE, body: 'log data' });
```
## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
## License
Apache 2.0 - See [LICENSE][license-url] for more information.
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[npm-url]: https://www.npmjs.com/package/@opentelemetry/api-logs
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi-logs.svg
[logs-api-docs]: https://open-telemetry.github.io/opentelemetry-js/modules/_opentelemetry_api_logs.html
@@ -0,0 +1,25 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/
import type {
LexicalEditor,
LexicalNode,
EditorState,
EditorThemeClasses,
} from 'lexical';
declare export function createHeadlessEditor(editorConfig?: {
editorState?: EditorState,
namespace?: string,
nodes?: $ReadOnlyArray<Class<LexicalNode>>,
onError?: (error: Error) => void,
parentEditor?: LexicalEditor,
editable?: boolean,
theme?: EditorThemeClasses,
}): LexicalEditor;
@@ -0,0 +1,56 @@
import { handleSchedules } from '../operations/handleSchedules/index.js';
import { configHasJobs } from './run.js';
/**
* GET /api/payload-jobs/handle-schedules endpoint
*
* This endpoint is GET instead of POST to allow it to be used in a Vercel Cron.
*/ export const handleSchedulesJobsEndpoint = {
handler: async (req)=>{
const jobsConfig = req.payload.config.jobs;
if (!configHasJobs(jobsConfig)) {
return Response.json({
message: 'No jobs to schedule.'
}, {
status: 200
});
}
const accessFn = jobsConfig.access?.run ?? (()=>true);
const hasAccess = await accessFn({
req
});
if (!hasAccess) {
return Response.json({
message: req.i18n.t('error:unauthorized')
}, {
status: 401
});
}
if (!jobsConfig.scheduling) {
// There is no reason to call the handleSchedules endpoint if the stats global is not enabled (= no schedules defined)
return Response.json({
message: 'Cannot handle schedules because no tasks or workflows with schedules are defined.'
}, {
status: 500
});
}
const { allQueues, queue } = req.query;
const runAllQueues = allQueues && !(typeof allQueues === 'string' && allQueues === 'false');
const { errored, queued, skipped } = await handleSchedules({
allQueues: runAllQueues,
queue,
req
});
return Response.json({
errored,
message: req.i18n.t('general:success'),
queued,
skipped
}, {
status: 200
});
},
method: 'get',
path: '/handle-schedules'
};
//# sourceMappingURL=handleSchedules.js.map
@@ -0,0 +1,317 @@
[![Node.js CI](https://github.com/Borewit/strtok3/actions/workflows/nodejs-ci.yml/badge.svg?branch=master)](https://github.com/Borewit/strtok3/actions/workflows/nodejs-ci.yml?query=branch%3Amaster)
[![CodeQL](https://github.com/Borewit/strtok3/actions/workflows/codeql.yml/badge.svg?branch=master)](https://github.com/Borewit/strtok3/actions/workflows/codeql.yml)
[![NPM version](https://badge.fury.io/js/strtok3.svg)](https://npmjs.org/package/strtok3)
[![npm downloads](http://img.shields.io/npm/dm/strtok3.svg)](https://npmcharts.com/compare/strtok3,token-types?start=1200&interval=30)
[![DeepScan grade](https://deepscan.io/api/teams/5165/projects/8526/branches/103329/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=5165&pid=8526&bid=103329)
[![Known Vulnerabilities](https://snyk.io/test/github/Borewit/strtok3/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Borewit/strtok3?targetFile=package.json)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/59dd6795e61949fb97066ca52e6097ef)](https://www.codacy.com/app/Borewit/strtok3?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Borewit/strtok3&amp;utm_campaign=Badge_Grade)
# strtok3
A promise based streaming [*tokenizer*](#tokenizer) for [Node.js](http://nodejs.org) and browsers.
This node module is a successor of [strtok2](https://github.com/Borewit/strtok2).
The `strtok3` contains a few methods to turn different input into a [*tokenizer*](#tokenizer). Designed to
* Support a streaming environment
* Decoding of binary data, strings and numbers in mind
* Read [predefined](https://github.com/Borewit/token-types) or custom tokens.
* Optimized [*tokenizers*](#tokenizer) for reading from [file](#method-strtok3fromfile), [stream](#method-strtok3fromstream) or [buffer](#method-strtok3frombuffer).
It can read from:
* A file (taking a file path as an input)
* A Node.js [stream](https://nodejs.org/api/stream.html).
* A [Buffer](https://nodejs.org/api/buffer.html) or [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)
* HTTP chunked transfer provided by [@tokenizer/http](https://github.com/Borewit/tokenizer-http).
* Chunked [Amazon S3](https://aws.amazon.com/s3) access provided by [@tokenizer/s3](https://github.com/Borewit/tokenizer-s3).
## Installation
```sh
npm install strtok3
```
### Compatibility
Module: version 7 migrated from [CommonJS](https://en.wikipedia.org/wiki/CommonJS) to [pure ECMAScript Module (ESM)](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
JavaScript is compliant with [ECMAScript 2020 (11th Edition)](https://en.wikipedia.org/wiki/ECMAScript_version_history#11th_Edition_%E2%80%93_ECMAScript_2020).
Requires [Node.js ≥ 16](https://nodejs.org/en/about/previous-releases) engine, but can also be used with a module bundler in a browser.
## API
Use one of the methods to instantiate an [*abstract tokenizer*](#tokenizer):
* [strtok3.fromFile](#method-strtok3fromfile)
* [strtok3.fromStream](#method-strtok3fromstream)
* [strtok3.fromWeb](#method-strtok3fromwebstream)
* [strtok3.fromBuffer](#method-strtok3fromBuffer)
* [strtok3.fromUint8Array](#method-strtok3fromUint8Array)
### strtok3 methods
All of the strtok3 methods return a [*tokenizer*](#tokenizer), either directly or via a promise.
#### Method `strtok3.fromFile()`
| Parameter | Type | Description |
|-----------|-----------------------|----------------------------|
| path | Path to file (string) | Path to file to read from |
> __Note__: that [file-information](#file-information) is automatically added.
Returns, via a promise, a [*tokenizer*](#tokenizer) which can be used to parse a file.
```js
import * as strtok3 from 'strtok3';
import * as Token from 'token-types';
(async () => {
const tokenizer = await strtok3.fromFile("somefile.bin");
try {
const myNumber = await tokenizer.readToken(Token.UINT8);
console.log(`My number: ${myNumber}`);
} finally {
tokenizer.close(); // Close the file
}
})();
```
#### Method `strtok3.fromStream()`
Create [*tokenizer*](#tokenizer) from a Node.js [readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable).
| Parameter | Optional | Type | Description |
|-----------|-----------|-----------------------------------------------------------------------------|--------------------------|
| stream | no | [Readable](https://nodejs.org/api/stream.html#stream_class_stream_readable) | Stream to read from |
| fileInfo | yes | [IFileInfo](#IFileInfo) | Provide file information |
Returns a Promise providing a [*tokenizer*](#tokenizer).
#### Method `strtok3.fromWebStream()`
Create [*tokenizer*](#tokenizer) from a [WHATWG ReadableStream](https://nodejs.org/api/webstreams.html#web-streams-api).
| Parameter | Optional | Type | Description |
|----------------|-----------|--------------------------------------------------------------------------|------------------------------------|
| readableStream | no | [ReadableStream](https://nodejs.org/api/webstreams.html#web-streams-api) | WHATWG ReadableStream to read from |
| fileInfo | yes | [IFileInfo](#IFileInfo) | Provide file information |
Returns a Promise providing a [*tokenizer*](#tokenizer)
```js
import strtok3 from 'strtok3';
import * as Token from 'token-types';
strtok3.fromWebStream(readableStream).then(tokenizer => {
return tokenizer.readToken(Token.UINT8).then(myUint8Number => {
console.log(`My number: ${myUint8Number}`);
});
});
```
#### Method `strtok3.fromBuffer()`
| Parameter | Optional | Type | Description |
|------------|----------|--------------------------------------------------|----------------------------------------|
| uint8Array | no | [Uint8Array](https://nodejs.org/api/buffer.html) | Uint8Array or Buffer to read from |
| fileInfo | yes | [IFileInfo](#IFileInfo) | Provide file information |
Returns a Promise providing a [*tokenizer*](#tokenizer).
```js
import * as strtok3 from 'strtok3';
const tokenizer = strtok3.fromBuffer(buffer);
tokenizer.readToken(Token.UINT8).then(myUint8Number => {
console.log(`My number: ${myUint8Number}`);
});
```
## Tokenizer
The tokenizer allows us to *read* or *peek* from the *tokenizer-stream*. The *tokenizer-stream* is an abstraction of a [stream](https://nodejs.org/api/stream.html), file or [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array).
It can also be translated in chunked reads, as done in [@tokenizer/http](https://github.com/Borewit/tokenizer-http);
What is the difference with Nodejs.js stream?
* The *tokenizer-stream* supports jumping / seeking in a the *tokenizer-stream* using [`tokenizer.ignore()`](#method-tokenizerignore)
* In addition to *read* methods, it has *peek* methods, to read a ahead and check what is coming.
The [tokenizer.position](#attribute-tokenizerposition) keeps tracks of the read position.
### strtok3 attributes
#### Attribute `tokenizer.fileInfo`
Optional attribute describing the file information, see [IFileInfo](#IFileInfo)
#### Attribute `tokenizer.position`
Pointer to the current position in the [*tokenizer*](#tokenizer) stream.
If a *position* is provided to a *read* or *peek* method, is should be, at least, equal or greater than this value.
### Tokenizer methods
There are two kind of methods:
1. *read* methods: used to read a *token* of [Buffer](https://nodejs.org/api/buffer.html) from the [*tokenizer*](#tokenizer). The position of the *tokenizer-stream* will advance with the size of the token.
2. *peek* methods: same as the read, but it will *not* advance the pointer. It allows to read (peek) ahead.
#### Method `tokenizer.readBuffer()`
Read buffer from stream.
`readBuffer(buffer, options?)`
| Parameter | Type | Description |
|------------|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| buffer | [Buffer](https://nodejs.org/api/buffer.html) &#124; Uint8Array | Target buffer to write the data read to |
| options | [IReadChunkOptions](#ireadchunkoptions) | An integer specifying the number of bytes to read |
Return value `Promise<number>` Promise with number of bytes read. The number of bytes read maybe if less, *mayBeLess* flag was set.
#### Method `tokenizer.peekBuffer()`
Peek (read ahead) buffer from [*tokenizer*](#tokenizer)
`peekBuffer(buffer, options?)`
| Parameter | Type | Description |
|------------|-----------------------------------------|-----------------------------------------------------|
| buffer | Buffer &#124; Uint8Array | Target buffer to write the data read (peeked) to. |
| options | [IReadChunkOptions](#ireadchunkoptions) | An integer specifying the number of bytes to read. | |
Return value `Promise<number>` Promise with number of bytes read. The number of bytes read maybe if less, *mayBeLess* flag was set.
#### Method `tokenizer.readToken()`
Read a *token* from the tokenizer-stream.
`readToken(token, position?)`
| Parameter | Type | Description |
|------------|-------------------------|---------------------------------------------------------------------------------------------------------------------- |
| token | [IGetToken](#IGetToken) | Token to read from the tokenizer-stream. |
| position? | number | Offset where to begin reading within the file. If position is null, data will be read from the current file position. |
Return value `Promise<number>`. Promise with number of bytes read. The number of bytes read maybe if less, *mayBeLess* flag was set.
#### Method `tokenizer.peekToken()`
Peek a *token* from the [*tokenizer*](#tokenizer).
`peekToken(token, position?)`
| Parameter | Type | Description |
|------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------|
| token | [IGetToken<T>](#IGetToken) | Token to read from the tokenizer-stream. |
| position? | number | Offset where to begin reading within the file. If position is null, data will be read from the current file position. |
Return value `Promise<T>` Promise with token value peeked from the [*tokenizer*](#tokenizer).
#### Method `tokenizer.readNumber()`
Peek a numeric [*token*](#token) from the [*tokenizer*](#tokenizer).
`readNumber(token)`
| Parameter | Type | Description |
|------------|---------------------------------|----------------------------------------------------|
| token | [IGetToken<number>](#IGetToken) | Numeric token to read from the tokenizer-stream. |
Return value `Promise<number>` Promise with number peeked from the *tokenizer-stream*.
#### Method `tokenizer.ignore()`
Advance the offset pointer with the number of bytes provided.
`ignore(length)`
| Parameter | Type | Description |
|------------|--------|----------------------------------------------------------------------|
| ignore | number | Numeric of bytes to ignore. Will advance the `tokenizer.position` |
Return value `Promise<number>` Promise with number peeked from the *tokenizer-stream*.
#### Method `tokenizer.close()`
Clean up resources, such as closing a file pointer if applicable.
### IReadChunkOptions
Each attribute is optional:
| Attribute | Type | Description |
|-----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| offset | number | The offset in the buffer to start writing at; if not provided, start at 0 |
| length | number | Requested number of bytes to read. |
| position | number | Position where to peek from the file. If position is null, data will be read from the [current file position](#attribute-tokenizerposition). Position may not be less then [tokenizer.position](#attribute-tokenizerposition) |
| mayBeLess | boolean | If and only if set, will not throw an EOF error if less then the requested *mayBeLess* could be read. |
Example:
```js
tokenizer.peekBuffer(buffer, {mayBeLess: true});
```
## IFileInfo
File information interface which describes the underlying file, each attribute is optional.
| Attribute | Type | Description |
|-----------|---------|---------------------------------------------------------------------------------------------------|
| size | number | File size in bytes |
| mimeType | number | [MIME-type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of file. |
| path | number | File path |
| url | boolean | File URL |
## Token
The *token* is basically a description what to read form the [*tokenizer-stream*](#tokenizer).
A basic set of *token types* can be found here: [*token-types*](https://github.com/Borewit/token-types).
A token is something which implements the following interface:
```ts
export interface IGetToken<T> {
/**
* Length in bytes of encoded value
*/
len: number;
/**
* Decode value from buffer at offset
* @param buf Buffer to read the decoded value from
* @param off Decode offset
*/
get(buf: Uint8Array, off: number): T;
}
```
The *tokenizer* reads `token.len` bytes from the *tokenizer-stream* into a Buffer.
The `token.get` will be called with the Buffer. `token.get` is responsible for conversion from the buffer to the desired output type.
## Browser compatibility
To exclude fs based dependencies, you can use a submodule-import from 'strtok3/lib/core'.
| function | 'strtok3' | 'strtok3/lib/core' |
| ----------------------| --------------------|---------------------|
| `parseBuffer` | ✓ | ✓ |
| `parseStream` | ✓ | ✓ |
| `fromFile` | ✓ | |
### Working with Web-API readable stream
To convert a [Web-API readable stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader) into a [Node.js readable stream]((https://nodejs.org/api/stream.html#stream_readable_streams)), you can use [readable-web-to-node-stream](https://github.com/Borewit/readable-web-to-node-stream) to convert one in another.
Example submodule-import:
```js
import * as strtok3core from 'strtok3/core'; // Submodule-import to prevent Node.js specific dependencies
import { ReadableWebToNodeStream } from 'readable-web-to-node-stream';
(async () => {
const response = await fetch(url);
const readableWebStream = response.body; // Web-API readable stream
const nodeStream = new ReadableWebToNodeStream(readableWebStream); // convert to Node.js readable stream
const tokenizer = strtok3core.fromStream(nodeStream); // And we now have tokenizer in a web environment
})();
```
## Licence
(The MIT License)
Copyright (c) 2020 Borewit
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,36 @@
{
"name": "randombytes",
"version": "2.1.0",
"description": "random bytes from browserify stand alone",
"main": "index.js",
"scripts": {
"test": "standard && node test.js | tspec",
"phantom": "zuul --phantom -- test.js",
"local": "zuul --local --no-coverage -- test.js"
},
"repository": {
"type": "git",
"url": "git@github.com:crypto-browserify/randombytes.git"
},
"keywords": [
"crypto",
"random"
],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/crypto-browserify/randombytes/issues"
},
"homepage": "https://github.com/crypto-browserify/randombytes",
"browser": "browser.js",
"devDependencies": {
"phantomjs": "^1.9.9",
"standard": "^10.0.2",
"tap-spec": "^2.1.2",
"tape": "^4.6.3",
"zuul": "^3.7.2"
},
"dependencies": {
"safe-buffer": "^5.1.0"
}
}
@@ -0,0 +1,28 @@
'use strict';
const DatePart = require('./datepart');
class Milliseconds extends DatePart {
constructor(opts={}) {
super(opts);
}
up() {
this.date.setMilliseconds(this.date.getMilliseconds() + 1);
}
down() {
this.date.setMilliseconds(this.date.getMilliseconds() - 1);
}
setTo(val) {
this.date.setMilliseconds(parseInt(val.substr(-(this.token.length))));
}
toString() {
return String(this.date.getMilliseconds()).padStart(4, '0')
.substr(0, this.token.length);
}
}
module.exports = Milliseconds;
@@ -0,0 +1,132 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^(\d+)(chi)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(m\.a|m\.)/i,
abbreviated: /^(m\.a\.?\s?m\.?)/i,
wide: /^(miloddan avval|miloddan keyin)/i,
};
const parseEraPatterns = {
any: [/^b/i, /^(a|c)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](chi)? chorak/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[yfmasond]/i,
abbreviated: /^(yan|fev|mar|apr|may|iyun|iyul|avg|sen|okt|noy|dek)/i,
wide: /^(yanvar|fevral|mart|aprel|may|iyun|iyul|avgust|sentabr|oktabr|noyabr|dekabr)/i,
};
const parseMonthPatterns = {
narrow: [
/^y/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^i/i,
/^i/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
any: [
/^ya/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^iyun/i,
/^iyul/i,
/^av/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[ydschj]/i,
short: /^(ya|du|se|cho|pa|ju|sha)/i,
abbreviated: /^(yak|dush|sesh|chor|pay|jum|shan)/i,
wide: /^(yakshanba|dushanba|seshanba|chorshanba|payshanba|juma|shanba)/i,
};
const parseDayPatterns = {
narrow: [/^y/i, /^d/i, /^s/i, /^ch/i, /^p/i, /^j/i, /^sh/i],
any: [/^ya/i, /^d/i, /^se/i, /^ch/i, /^p/i, /^j/i, /^sh/i],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|y\.t|p| (ertalab|tushdan keyin|kechqurun|tun))/i,
any: /^([ap]\.?\s?m\.?|yarim tun|peshin| (ertalab|tushdan keyin|kechqurun|tun))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^y\.t/i,
noon: /^pe/i,
morning: /ertalab/i,
afternoon: /tushdan keyin/i,
evening: /kechqurun/i,
night: /tun/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};
@@ -0,0 +1 @@
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../../../../src/globals/operations/local/findOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAChF,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,EACV,yBAAyB,EAC1B,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,uBAAuB,CAAA;AAI9B,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAExE,KAAK,kBAAkB,CAAC,KAAK,SAAS,UAAU,EAAE,OAAO,SAAS,UAAU,IAAI;IAC9E;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAA;IACpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAA;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,GACjD,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAA;AAE3C,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,UAAU,EAAE,OAAO,SAAS,UAAU,IACtE,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;AAErE,wBAAsB,kBAAkB,CACtC,KAAK,SAAS,UAAU,EACxB,OAAO,SAAS,oBAAoB,CAAC,KAAK,CAAC,EAE3C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,yBAAyB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAkCpD"}
@@ -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 SatelliteDish = createLucideIcon("SatelliteDish", [
["path", { d: "M4 10a7.31 7.31 0 0 0 10 10Z", key: "1fzpp3" }],
["path", { d: "m9 15 3-3", key: "88sc13" }],
["path", { d: "M17 13a6 6 0 0 0-6-6", key: "15cc6u" }],
["path", { d: "M21 13A10 10 0 0 0 11 3", key: "11nf8s" }]
]);
export { SatelliteDish as default };
//# sourceMappingURL=satellite-dish.js.map
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const resolve_1 = require("./resolve");
class MissingRefError extends Error {
constructor(resolver, baseId, ref, msg) {
super(msg || `can't resolve reference ${ref} from id ${baseId}`);
this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
}
}
exports.default = MissingRefError;
//# sourceMappingURL=ref_error.js.map
@@ -0,0 +1,28 @@
import type { SendMailOptions as NodemailerSendMailOptions } from 'nodemailer';
import type { Payload } from '../types/index.js';
type Prettify<T> = {
[K in keyof T]: T[K];
} & NonNullable<unknown>;
/**
* Options for sending an email. Allows access to the PayloadRequest object
*/
export type SendEmailOptions = Prettify<NodemailerSendMailOptions>;
/**
* Email adapter after it has been initialized. This is used internally by Payload.
*/
export type InitializedEmailAdapter<TSendEmailResponse = unknown> = ReturnType<EmailAdapter<TSendEmailResponse>>;
/**
* Email adapter interface. Allows a generic type for the response of the sendEmail method.
*
* This is the interface to use if you are creating a new email adapter.
*/
export type EmailAdapter<TSendEmailResponse = unknown> = ({ payload }: {
payload: Payload;
}) => {
defaultFromAddress: string;
defaultFromName: string;
name: string;
sendEmail: (message: SendEmailOptions) => Promise<TSendEmailResponse>;
};
export {};
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
import { trimCharsStart } from "../fp";
export = trimCharsStart;
@@ -0,0 +1,42 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.cjs");
//Source: https://www.unicode.org/cldr/charts/32/summary/gu.html
const dateFormats = {
full: "EEEE, d MMMM, y", // CLDR #1825
long: "d MMMM, y", // CLDR #1826
medium: "d MMM, y", // CLDR #1827
short: "d/M/yy", // CLDR #1828
};
const timeFormats = {
full: "hh:mm:ss a zzzz", // CLDR #1829
long: "hh:mm:ss a z", // CLDR #1830
medium: "hh:mm:ss a", // CLDR #1831
short: "hh:mm a", // CLDR #1832
};
const dateTimeFormats = {
full: "{{date}} {{time}}", // CLDR #1833
long: "{{date}} {{time}}", // CLDR #1834
medium: "{{date}} {{time}}", // CLDR #1835
short: "{{date}} {{time}}", // CLDR #1836
};
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",
}),
});
@@ -0,0 +1,132 @@
/// <reference types="node" />
/// <reference types="node" />
import { Span } from '@opentelemetry/api';
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
export interface PublishInfo {
moduleVersion: string | undefined;
exchange: string;
routingKey: string;
content: Buffer;
options?: AmqplibPublishOptions;
isConfirmChannel?: boolean;
}
export interface PublishConfirmedInfo extends PublishInfo {
confirmError?: any;
}
export interface ConsumeInfo {
moduleVersion: string | undefined;
msg: ConsumeMessage;
}
export interface ConsumeEndInfo {
msg: ConsumeMessage;
rejected: boolean | null;
endOperation: EndOperation;
}
export interface AmqplibPublishCustomAttributeFunction {
(span: Span, publishInfo: PublishInfo): void;
}
export interface AmqplibPublishConfirmCustomAttributeFunction {
(span: Span, publishConfirmedInto: PublishConfirmedInfo): void;
}
export interface AmqplibConsumeCustomAttributeFunction {
(span: Span, consumeInfo: ConsumeInfo): void;
}
export interface AmqplibConsumeEndCustomAttributeFunction {
(span: Span, consumeEndInfo: ConsumeEndInfo): void;
}
export declare enum EndOperation {
AutoAck = "auto ack",
Ack = "ack",
AckAll = "ackAll",
Reject = "reject",
Nack = "nack",
NackAll = "nackAll",
ChannelClosed = "channel closed",
ChannelError = "channel error",
InstrumentationTimeout = "instrumentation timeout"
}
export interface AmqplibInstrumentationConfig extends InstrumentationConfig {
/** hook for adding custom attributes before publish message is sent */
publishHook?: AmqplibPublishCustomAttributeFunction;
/** hook for adding custom attributes after publish message is confirmed by the broker */
publishConfirmHook?: AmqplibPublishConfirmCustomAttributeFunction;
/** hook for adding custom attributes before consumer message is processed */
consumeHook?: AmqplibConsumeCustomAttributeFunction;
/** hook for adding custom attributes after consumer message is acked to server */
consumeEndHook?: AmqplibConsumeEndCustomAttributeFunction;
/**
* When user is setting up consume callback, it is user's responsibility to call
* ack/nack etc on the msg to resolve it in the server.
* If user is not calling the ack, the message will stay in the queue until
* channel is closed, or until server timeout expires (if configured).
* While we wait for the ack, a reference to the message is stored in plugin, which
* will never be garbage collected.
* To prevent memory leak, plugin has it's own configuration of timeout, which
* will close the span if user did not call ack after this timeout.
* If timeout is not big enough, span might be closed with 'InstrumentationTimeout',
* and then received valid ack from the user later which will not be instrumented.
*
* Default is 1 minute
*/
consumeTimeoutMs?: number;
/** option to use a span link for the consume message instead of continuing a trace */
useLinksForConsume?: boolean;
}
export declare const DEFAULT_CONFIG: AmqplibInstrumentationConfig;
export interface AmqplibPublishOptions {
expiration?: string | number;
userId?: string;
CC?: string | string[];
mandatory?: boolean;
persistent?: boolean;
deliveryMode?: boolean | number;
BCC?: string | string[];
contentType?: string;
contentEncoding?: string;
headers?: any;
priority?: number;
correlationId?: string;
replyTo?: string;
messageId?: string;
timestamp?: number;
type?: string;
appId?: string;
}
export interface Message {
content: Buffer;
fields: MessageFields;
properties: MessageProperties;
}
export interface ConsumeMessage extends Message {
fields: ConsumeMessageFields;
}
export interface CommonMessageFields {
deliveryTag: number;
redelivered: boolean;
exchange: string;
routingKey: string;
}
export interface MessageFields extends CommonMessageFields {
messageCount?: number;
consumerTag?: string;
}
export interface ConsumeMessageFields extends CommonMessageFields {
deliveryTag: number;
}
export interface MessageProperties {
contentType: any | undefined;
contentEncoding: any | undefined;
headers: any;
deliveryMode: any | undefined;
priority: any | undefined;
correlationId: any | undefined;
replyTo: any | undefined;
expiration: any | undefined;
messageId: any | undefined;
timestamp: any | undefined;
type: any | undefined;
userId: any | undefined;
appId: any | undefined;
clusterId: any | undefined;
}
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const AlarmClockMinus = createLucideIcon("AlarmClockMinus", [
["circle", { cx: "12", cy: "13", r: "8", key: "3y4lt7" }],
["path", { d: "M5 3 2 6", key: "18tl5t" }],
["path", { d: "m22 6-3-3", key: "1opdir" }],
["path", { d: "M6.38 18.7 4 21", key: "17xu3x" }],
["path", { d: "M17.64 18.67 20 21", key: "kv2oe2" }],
["path", { d: "M9 13h6", key: "1uhe8q" }]
]);
export { AlarmClockMinus as default };
//# sourceMappingURL=alarm-clock-minus.js.map
@@ -0,0 +1,22 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0;
// this is autogenerated file, see scripts/version-update.js
exports.PACKAGE_VERSION = '0.21.0';
exports.PACKAGE_NAME = '@opentelemetry/instrumentation-undici';
//# sourceMappingURL=version.js.map
@@ -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 './panel-left.js';
//# sourceMappingURL=sidebar.js.map
@@ -0,0 +1,7 @@
import * as React from 'react';
import { ReactElement } from 'react';
import { SingleValueProps } from '../components/SingleValue';
import { GroupBase } from '../types';
export declare type SingleValueComponent = <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: SingleValueProps<Option, IsMulti, Group>) => ReactElement;
declare const AnimatedSingleValue: (WrappedComponent: SingleValueComponent) => <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: SingleValueProps<Option, IsMulti, Group>) => React.JSX.Element;
export default AnimatedSingleValue;
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAgC3E,cAAc,mBAAmB,CAAA;AAEjC,MAAM,MAAM,oBAAoB,GAAG;KAChC,CAAC,IAAI,UAAU,GAAG,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC;CAC1D,GAAG;IACF,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAAC,CAAA;IACpD,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,oBA0B7B,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAA;IAC9C,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAA;IAClC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAA;IAClC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAA;CACnB,GAAG,oBAAoB,CAAA;AAExB,eAAO,MAAM,kBAAkB,EAAE,wBAMhC,CAAA"}
@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ReceiptEuro = createLucideIcon("ReceiptEuro", [
[
"path",
{ d: "M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z", key: "q3az6g" }
],
["path", { d: "M8 12h5", key: "1g6qi8" }],
["path", { d: "M16 9.5a4 4 0 1 0 0 5.2", key: "b2px4r" }]
]);
export { ReceiptEuro as default };
//# sourceMappingURL=receipt-euro.js.map
@@ -0,0 +1,77 @@
{
"name": "@payloadcms/drizzle",
"version": "3.77.0",
"description": "A library of shared functions used by different payload database adapters",
"homepage": "https://payloadcms.com",
"repository": {
"type": "git",
"url": "https://github.com/payloadcms/payload.git",
"directory": "packages/drizzle"
},
"license": "MIT",
"author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
"maintainers": [
{
"name": "Payload",
"email": "info@payloadcms.com",
"url": "https://payloadcms.com"
}
],
"sideEffects": false,
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./postgres": {
"import": "./dist/exports/postgres.js",
"types": "./dist/exports/postgres.d.ts",
"default": "./dist/exports/postgres.js"
},
"./sqlite": {
"import": "./dist/exports/sqlite.js",
"types": "./dist/exports/sqlite.d.ts",
"default": "./dist/exports/sqlite.js"
},
"./types": {
"import": "./dist/exports/types-deprecated.js",
"types": "./dist/exports/types-deprecated.d.ts",
"default": "./dist/exports/types-deprecated.js"
}
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"mock.js"
],
"dependencies": {
"console-table-printer": "2.12.1",
"dequal": "2.0.3",
"drizzle-orm": "0.44.7",
"prompts": "2.4.2",
"to-snake-case": "1.0.0",
"uuid": "9.0.0"
},
"devDependencies": {
"@libsql/client": "0.14.0",
"@types/pg": "8.10.2",
"@types/to-snake-case": "1.0.0",
"@payloadcms/eslint-config": "3.28.0",
"payload": "3.77.0"
},
"peerDependencies": {
"payload": "3.77.0"
},
"scripts": {
"build": "pnpm build:swc && pnpm build:types",
"build:debug": "pnpm build",
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
"build:types": "tsc --emitDeclarationOnly --outDir dist",
"clean": "rimraf -g {dist,*.tsbuildinfo}",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
@@ -0,0 +1,17 @@
/** Used to match wrap detail comments. */
var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
reSplitDetails = /,? & /;
/**
* Extracts wrapper details from the `source` body comment.
*
* @private
* @param {string} source The source to inspect.
* @returns {Array} Returns the wrapper details.
*/
function getWrapDetails(source) {
var match = source.match(reWrapDetails);
return match ? match[1].split(reSplitDetails) : [];
}
module.exports = getWrapDetails;
@@ -0,0 +1,28 @@
import { formatDistance } from "./en-US/_lib/formatDistance.mjs";
import { formatRelative } from "./en-US/_lib/formatRelative.mjs";
import { localize } from "./en-US/_lib/localize.mjs";
import { match } from "./en-US/_lib/match.mjs";
import { formatLong } from "./en-NZ/_lib/formatLong.mjs";
/**
* @category Locales
* @summary English locale (New Zealand).
* @language English
* @iso-639-2 eng
* @author Murray Lucas [@muntact](https://github.com/muntact)
*/
export const enNZ = {
code: "en-NZ",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default enNZ;
@@ -0,0 +1,26 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import type { AnyGelTable } from "../table.cjs";
import { GelColumn, GelColumnBuilder } from "./common.cjs";
export type GelJsonBuilderInitial<TName extends string> = GelJsonBuilder<{
name: TName;
dataType: 'json';
columnType: 'GelJson';
data: unknown;
driverParam: unknown;
enumValues: undefined;
}>;
export declare class GelJsonBuilder<T extends ColumnBuilderBaseConfig<'json', 'GelJson'>> extends GelColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class GelJson<T extends ColumnBaseConfig<'json', 'GelJson'>> extends GelColumn<T> {
static readonly [entityKind]: string;
constructor(table: AnyGelTable<{
name: T['tableName'];
}>, config: GelJsonBuilder<T>['config']);
getSQLType(): string;
}
export declare function json(): GelJsonBuilderInitial<''>;
export declare function json<TName extends string>(name: TName): GelJsonBuilderInitial<TName>;
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('keys', require('../keys'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/auth/baseFields/username.ts"],"sourcesContent":["import type { TextField } from '../../fields/config/types.js'\n\nimport { username } from '../../fields/validations.js'\n\nexport const usernameFieldConfig: TextField = {\n name: 'username',\n type: 'text',\n admin: {\n components: {\n Field: false,\n },\n },\n hooks: {\n beforeChange: [\n ({ value }) => {\n if (value) {\n return value.toLowerCase().trim()\n }\n },\n ],\n },\n label: ({ t }) => t('authentication:username'),\n required: true,\n unique: true,\n validate: username,\n}\n"],"names":["username","usernameFieldConfig","name","type","admin","components","Field","hooks","beforeChange","value","toLowerCase","trim","label","t","required","unique","validate"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,8BAA6B;AAEtD,OAAO,MAAMC,sBAAiC;IAC5CC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,YAAY;YACVC,OAAO;QACT;IACF;IACAC,OAAO;QACLC,cAAc;YACZ,CAAC,EAAEC,KAAK,EAAE;gBACR,IAAIA,OAAO;oBACT,OAAOA,MAAMC,WAAW,GAAGC,IAAI;gBACjC;YACF;SACD;IACH;IACAC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACpBC,UAAU;IACVC,QAAQ;IACRC,UAAUhB;AACZ,EAAC"}
@@ -0,0 +1,90 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://json-schema.org/draft/2019-09/meta/validation",
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/validation": true
},
"$recursiveAnchor": true,
"title": "Validation vocabulary meta-schema",
"type": ["object", "boolean"],
"properties": {
"multipleOf": {
"type": "number",
"exclusiveMinimum": 0
},
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"type": "number"
},
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"type": "number"
},
"maxLength": {"$ref": "#/$defs/nonNegativeInteger"},
"minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
"pattern": {
"type": "string",
"format": "regex"
},
"maxItems": {"$ref": "#/$defs/nonNegativeInteger"},
"minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
"uniqueItems": {
"type": "boolean",
"default": false
},
"maxContains": {"$ref": "#/$defs/nonNegativeInteger"},
"minContains": {
"$ref": "#/$defs/nonNegativeInteger",
"default": 1
},
"maxProperties": {"$ref": "#/$defs/nonNegativeInteger"},
"minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
"required": {"$ref": "#/$defs/stringArray"},
"dependentRequired": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/stringArray"
}
},
"const": true,
"enum": {
"type": "array",
"items": true
},
"type": {
"anyOf": [
{"$ref": "#/$defs/simpleTypes"},
{
"type": "array",
"items": {"$ref": "#/$defs/simpleTypes"},
"minItems": 1,
"uniqueItems": true
}
]
}
},
"$defs": {
"nonNegativeInteger": {
"type": "integer",
"minimum": 0
},
"nonNegativeIntegerDefault0": {
"$ref": "#/$defs/nonNegativeInteger",
"default": 0
},
"simpleTypes": {
"enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
},
"stringArray": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"default": []
}
}
}
@@ -0,0 +1,30 @@
"use strict";
exports.endOfTomorrow = endOfTomorrow; /**
* @name endOfTomorrow
* @category Day Helpers
* @summary Return the end of tomorrow.
* @pure false
*
* @description
* Return the end of tomorrow.
*
* @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).
*
* @returns The end of tomorrow
*
* @example
* // If today is 6 October 2014:
* const result = endOfTomorrow()
* //=> Tue Oct 7 2014 23:59:59.999
*/
function endOfTomorrow() {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth();
const day = now.getDate();
const date = new Date(0);
date.setFullYear(year, month, day + 1);
date.setHours(23, 59, 59, 999);
return date;
}
@@ -0,0 +1,5 @@
export declare const setISOWeekYear: import("./types.js").FPFn2<
Date,
number,
import("../fp.js").DateArg<Date>
>;
@@ -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 SquarePercent = createLucideIcon("SquarePercent", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
["path", { d: "M9 9h.01", key: "1q5me6" }],
["path", { d: "M15 15h.01", key: "lqbp3k" }]
]);
export { SquarePercent as default };
//# sourceMappingURL=square-percent.js.map
@@ -0,0 +1,8 @@
"use strict";
exports.previousMondayWithOptions = void 0;
var _index = require("../previousMonday.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const previousMondayWithOptions = (exports.previousMondayWithOptions = (0,
_index2.convertToFP)(_index.previousMonday, 2));
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_wrap_async_generator.cjs",
"module": "../../esm/_wrap_async_generator.js"
}
@@ -0,0 +1,749 @@
// ==================================================================================================
// JSON Schema Draft 04
// ==================================================================================================
/**
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
*/
export type JSONSchema4TypeName =
| "string" //
| "number"
| "integer"
| "boolean"
| "object"
| "array"
| "null"
| "any";
/**
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
*/
export type JSONSchema4Type =
| string //
| number
| boolean
| JSONSchema4Object
| JSONSchema4Array
| null;
// Workaround for infinite type recursion
export interface JSONSchema4Object {
[key: string]: JSONSchema4Type;
}
// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema4Array extends Array<JSONSchema4Type> {}
/**
* Meta schema
*
* Recommended values:
* - 'http://json-schema.org/schema#'
* - 'http://json-schema.org/hyper-schema#'
* - 'http://json-schema.org/draft-04/schema#'
* - 'http://json-schema.org/draft-04/hyper-schema#'
* - 'http://json-schema.org/draft-03/schema#'
* - 'http://json-schema.org/draft-03/hyper-schema#'
*
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
*/
export type JSONSchema4Version = string;
/**
* JSON Schema V4
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04
*/
export interface JSONSchema4 {
id?: string | undefined;
$ref?: string | undefined;
$schema?: JSONSchema4Version | undefined;
/**
* This attribute is a string that provides a short description of the
* instance property.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
*/
title?: string | undefined;
/**
* This attribute is a string that provides a full description of the of
* purpose the instance property.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
*/
description?: string | undefined;
default?: JSONSchema4Type | undefined;
multipleOf?: number | undefined;
maximum?: number | undefined;
exclusiveMaximum?: boolean | undefined;
minimum?: number | undefined;
exclusiveMinimum?: boolean | undefined;
maxLength?: number | undefined;
minLength?: number | undefined;
pattern?: string | undefined;
/**
* May only be defined when "items" is defined, and is a tuple of JSONSchemas.
*
* This provides a definition for additional items in an array instance
* when tuple definitions of the items is provided. This can be false
* to indicate additional items in the array are not allowed, or it can
* be a schema that defines the schema of the additional items.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
*/
additionalItems?: boolean | JSONSchema4 | undefined;
/**
* This attribute defines the allowed items in an instance array, and
* MUST be a schema or an array of schemas. The default value is an
* empty schema which allows any value for items in the instance array.
*
* When this attribute value is a schema and the instance value is an
* array, then all the items in the array MUST be valid according to the
* schema.
*
* When this attribute value is an array of schemas and the instance
* value is an array, each position in the instance array MUST conform
* to the schema in the corresponding position for this array. This
* called tuple typing. When tuple typing is used, additional items are
* allowed, disallowed, or constrained by the "additionalItems"
* (Section 5.6) attribute using the same rules as
* "additionalProperties" (Section 5.4) for objects.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
*/
items?: JSONSchema4 | JSONSchema4[] | undefined;
maxItems?: number | undefined;
minItems?: number | undefined;
uniqueItems?: boolean | undefined;
maxProperties?: number | undefined;
minProperties?: number | undefined;
/**
* This attribute indicates if the instance must have a value, and not
* be undefined. This is false by default, making the instance
* optional.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
*/
required?: boolean | string[] | undefined;
/**
* This attribute defines a schema for all properties that are not
* explicitly defined in an object type definition. If specified, the
* value MUST be a schema or a boolean. If false is provided, no
* additional properties are allowed beyond the properties defined in
* the schema. The default value is an empty schema which allows any
* value for additional properties.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
*/
additionalProperties?: boolean | JSONSchema4 | undefined;
definitions?: {
[k: string]: JSONSchema4;
} | undefined;
/**
* This attribute is an object with property definitions that define the
* valid values of instance object property values. When the instance
* value is an object, the property values of the instance object MUST
* conform to the property definitions in this object. In this object,
* each property definition's value MUST be a schema, and the property's
* name MUST be the name of the instance property that it defines. The
* instance property value MUST be valid according to the schema from
* the property definition. Properties are considered unordered, the
* order of the instance properties MAY be in any order.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
*/
properties?: {
[k: string]: JSONSchema4;
} | undefined;
/**
* This attribute is an object that defines the schema for a set of
* property names of an object instance. The name of each property of
* this attribute's object is a regular expression pattern in the ECMA
* 262/Perl 5 format, while the value is a schema. If the pattern
* matches the name of a property on the instance object, the value of
* the instance's property MUST be valid against the pattern name's
* schema value.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
*/
patternProperties?: {
[k: string]: JSONSchema4;
} | undefined;
dependencies?: {
[k: string]: JSONSchema4 | string[];
} | undefined;
/**
* This provides an enumeration of all possible values that are valid
* for the instance property. This MUST be an array, and each item in
* the array represents a possible value for the instance value. If
* this attribute is defined, the instance value MUST be one of the
* values in the array in order for the schema to be valid.
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
*/
enum?: JSONSchema4Type[] | undefined;
/**
* A single type, or a union of simple types
*/
type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
allOf?: JSONSchema4[] | undefined;
anyOf?: JSONSchema4[] | undefined;
oneOf?: JSONSchema4[] | undefined;
not?: JSONSchema4 | undefined;
/**
* The value of this property MUST be another schema which will provide
* a base schema which the current schema will inherit from. The
* inheritance rules are such that any instance that is valid according
* to the current schema MUST be valid according to the referenced
* schema. This MAY also be an array, in which case, the instance MUST
* be valid for all the schemas in the array. A schema that extends
* another schema MAY define additional attributes, constrain existing
* attributes, or add other constraints.
*
* Conceptually, the behavior of extends can be seen as validating an
* instance against all constraints in the extending schema as well as
* the extended schema(s).
*
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
*/
extends?: string | string[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
*/
[k: string]: any;
format?: string | undefined;
}
// ==================================================================================================
// JSON Schema Draft 06
// ==================================================================================================
export type JSONSchema6TypeName =
| "string" //
| "number"
| "integer"
| "boolean"
| "object"
| "array"
| "null"
| "any";
export type JSONSchema6Type =
| string //
| number
| boolean
| JSONSchema6Object
| JSONSchema6Array
| null;
// Workaround for infinite type recursion
export interface JSONSchema6Object {
[key: string]: JSONSchema6Type;
}
// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema6Array extends Array<JSONSchema6Type> {}
/**
* Meta schema
*
* Recommended values:
* - 'http://json-schema.org/schema#'
* - 'http://json-schema.org/hyper-schema#'
* - 'http://json-schema.org/draft-06/schema#'
* - 'http://json-schema.org/draft-06/hyper-schema#'
*
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
*/
export type JSONSchema6Version = string;
/**
* JSON Schema V6
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01
*/
export type JSONSchema6Definition = JSONSchema6 | boolean;
export interface JSONSchema6 {
$id?: string | undefined;
$ref?: string | undefined;
$schema?: JSONSchema6Version | undefined;
/**
* Must be strictly greater than 0.
* A numeric instance is valid only if division by this keyword's value results in an integer.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1
*/
multipleOf?: number | undefined;
/**
* Representing an inclusive upper limit for a numeric instance.
* This keyword validates only if the instance is less than or exactly equal to "maximum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2
*/
maximum?: number | undefined;
/**
* Representing an exclusive upper limit for a numeric instance.
* This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3
*/
exclusiveMaximum?: number | undefined;
/**
* Representing an inclusive lower limit for a numeric instance.
* This keyword validates only if the instance is greater than or exactly equal to "minimum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4
*/
minimum?: number | undefined;
/**
* Representing an exclusive lower limit for a numeric instance.
* This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum".
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5
*/
exclusiveMinimum?: number | undefined;
/**
* Must be a non-negative integer.
* A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6
*/
maxLength?: number | undefined;
/**
* Must be a non-negative integer.
* A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7
*/
minLength?: number | undefined;
/**
* Should be a valid regular expression, according to the ECMA 262 regular expression dialect.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8
*/
pattern?: string | undefined;
/**
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9
*/
items?: JSONSchema6Definition | JSONSchema6Definition[] | undefined;
/**
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
* If "items" is an array of schemas, validation succeeds if every instance element
* at a position greater than the size of "items" validates against "additionalItems".
* Otherwise, "additionalItems" MUST be ignored, as the "items" schema
* (possibly the default value of an empty schema) is applied to all elements.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10
*/
additionalItems?: JSONSchema6Definition | undefined;
/**
* Must be a non-negative integer.
* An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11
*/
maxItems?: number | undefined;
/**
* Must be a non-negative integer.
* An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12
*/
minItems?: number | undefined;
/**
* If this keyword has boolean value false, the instance validates successfully.
* If it has boolean value true, the instance validates successfully if all of its elements are unique.
* Omitting this keyword has the same behavior as a value of false.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13
*/
uniqueItems?: boolean | undefined;
/**
* An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14
*/
contains?: JSONSchema6Definition | undefined;
/**
* Must be a non-negative integer.
* An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15
*/
maxProperties?: number | undefined;
/**
* Must be a non-negative integer.
* An object instance is valid against "maxProperties" if its number of properties is greater than,
* or equal to, the value of this keyword.
* Omitting this keyword has the same behavior as a value of 0.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16
*/
minProperties?: number | undefined;
/**
* Elements of this array must be unique.
* An object instance is valid against this keyword if every item in the array is the name of a property in the instance.
* Omitting this keyword has the same behavior as an empty array.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17
*/
required?: string[] | undefined;
/**
* This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.
* Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value,
* the child instance for that name successfully validates against the corresponding schema.
* Omitting this keyword has the same behavior as an empty object.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18
*/
properties?: {
[k: string]: JSONSchema6Definition;
} | undefined;
/**
* This attribute is an object that defines the schema for a set of property names of an object instance.
* The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema.
* If the pattern matches the name of a property on the instance object, the value of the instance's property
* MUST be valid against the pattern name's schema value.
* Omitting this keyword has the same behavior as an empty object.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19
*/
patternProperties?: {
[k: string]: JSONSchema6Definition;
} | undefined;
/**
* This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
* If specified, the value MUST be a schema or a boolean.
* If false is provided, no additional properties are allowed beyond the properties defined in the schema.
* The default value is an empty schema which allows any value for additional properties.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
*/
additionalProperties?: JSONSchema6Definition | undefined;
/**
* This keyword specifies rules that are evaluated if the instance is an object and contains a certain property.
* Each property specifies a dependency.
* If the dependency value is an array, each element in the array must be unique.
* Omitting this keyword has the same behavior as an empty object.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21
*/
dependencies?: {
[k: string]: JSONSchema6Definition | string[];
} | undefined;
/**
* Takes a schema which validates the names of all properties rather than their values.
* Note the property name that the schema is testing will always be a string.
* Omitting this keyword has the same behavior as an empty schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22
*/
propertyNames?: JSONSchema6Definition | undefined;
/**
* This provides an enumeration of all possible values that are valid
* for the instance property. This MUST be an array, and each item in
* the array represents a possible value for the instance value. If
* this attribute is defined, the instance value MUST be one of the
* values in the array in order for the schema to be valid.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
*/
enum?: JSONSchema6Type[] | undefined;
/**
* More readable form of a one-element "enum"
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24
*/
const?: JSONSchema6Type | undefined;
/**
* A single type, or a union of simple types
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25
*/
type?: JSONSchema6TypeName | JSONSchema6TypeName[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
*/
allOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
*/
anyOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
*/
oneOf?: JSONSchema6Definition[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29
*/
not?: JSONSchema6Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
*/
definitions?: {
[k: string]: JSONSchema6Definition;
} | undefined;
/**
* This attribute is a string that provides a short description of the instance property.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
*/
title?: string | undefined;
/**
* This attribute is a string that provides a full description of the of purpose the instance property.
*
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
*/
description?: string | undefined;
/**
* This keyword can be used to supply a default JSON value associated with a particular schema.
* It is RECOMMENDED that a default value be valid against the associated schema.
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3
*/
default?: JSONSchema6Type | undefined;
/**
* Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4
*/
examples?: JSONSchema6Type[] | undefined;
/**
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8
*/
format?: string | undefined;
}
// ==================================================================================================
// JSON Schema Draft 07
// ==================================================================================================
// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
// --------------------------------------------------------------------------------------------------
/**
* Primitive type
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
*/
export type JSONSchema7TypeName =
| "string" //
| "number"
| "integer"
| "boolean"
| "object"
| "array"
| "null";
/**
* Primitive type
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
*/
export type JSONSchema7Type =
| string //
| number
| boolean
| JSONSchema7Object
| JSONSchema7Array
| null;
// Workaround for infinite type recursion
export interface JSONSchema7Object {
[key: string]: JSONSchema7Type;
}
// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema7Array extends Array<JSONSchema7Type> {}
/**
* Meta schema
*
* Recommended values:
* - 'http://json-schema.org/schema#'
* - 'http://json-schema.org/hyper-schema#'
* - 'http://json-schema.org/draft-07/schema#'
* - 'http://json-schema.org/draft-07/hyper-schema#'
*
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
*/
export type JSONSchema7Version = string;
/**
* JSON Schema v7
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
*/
export type JSONSchema7Definition = JSONSchema7 | boolean;
export interface JSONSchema7 {
$id?: string | undefined;
$ref?: string | undefined;
$schema?: JSONSchema7Version | undefined;
$comment?: string | undefined;
/**
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
*/
$defs?: {
[key: string]: JSONSchema7Definition;
} | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
*/
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
enum?: JSONSchema7Type[] | undefined;
const?: JSONSchema7Type | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
*/
multipleOf?: number | undefined;
maximum?: number | undefined;
exclusiveMaximum?: number | undefined;
minimum?: number | undefined;
exclusiveMinimum?: number | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
*/
maxLength?: number | undefined;
minLength?: number | undefined;
pattern?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
*/
items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
additionalItems?: JSONSchema7Definition | undefined;
maxItems?: number | undefined;
minItems?: number | undefined;
uniqueItems?: boolean | undefined;
contains?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
*/
maxProperties?: number | undefined;
minProperties?: number | undefined;
required?: string[] | undefined;
properties?: {
[key: string]: JSONSchema7Definition;
} | undefined;
patternProperties?: {
[key: string]: JSONSchema7Definition;
} | undefined;
additionalProperties?: JSONSchema7Definition | undefined;
dependencies?: {
[key: string]: JSONSchema7Definition | string[];
} | undefined;
propertyNames?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
*/
if?: JSONSchema7Definition | undefined;
then?: JSONSchema7Definition | undefined;
else?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
*/
allOf?: JSONSchema7Definition[] | undefined;
anyOf?: JSONSchema7Definition[] | undefined;
oneOf?: JSONSchema7Definition[] | undefined;
not?: JSONSchema7Definition | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
*/
format?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
*/
contentMediaType?: string | undefined;
contentEncoding?: string | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
*/
definitions?: {
[key: string]: JSONSchema7Definition;
} | undefined;
/**
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
*/
title?: string | undefined;
description?: string | undefined;
default?: JSONSchema7Type | undefined;
readOnly?: boolean | undefined;
writeOnly?: boolean | undefined;
examples?: JSONSchema7Type | undefined;
}
export interface ValidationResult {
valid: boolean;
errors: ValidationError[];
}
export interface ValidationError {
property: string;
message: string;
}
/**
* To use the validator call JSONSchema.validate with an instance object and an optional schema object.
* If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
* that schema will be used to validate and the schema parameter is not necessary (if both exist,
* both validations will occur).
*/
export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult;
/**
* The checkPropertyChange method will check to see if an value can legally be in property with the given schema
* This is slightly different than the validate method in that it will fail if the schema is readonly and it will
* not check for self-validation, it is assumed that the passed in value is already internally valid.
*/
export function checkPropertyChange(
value: any,
schema: JSONSchema4 | JSONSchema6 | JSONSchema7,
property: string,
): ValidationResult;
/**
* This checks to ensure that the result is valid and will throw an appropriate error message if it is not.
*/
export function mustBeValid(result: ValidationResult): void;
@@ -0,0 +1 @@
{"version":3,"file":"user-square-2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { getISOWeekYear as fn } from "../getISOWeekYear.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const getISOWeekYear = convertToFP(fn, 1);
// Fallback for modularized imports:
export default getISOWeekYear;
@@ -0,0 +1,110 @@
### [5.1.2](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2) (2021-03-06)
### Bug Fixes
* eliminate ReDoS ([#36](https://github.com/gulpjs/glob-parent/issues/36)) ([f923116](https://github.com/gulpjs/glob-parent/commit/f9231168b0041fea3f8f954b3cceb56269fc6366))
### [5.1.1](https://github.com/gulpjs/glob-parent/compare/v5.1.0...v5.1.1) (2021-01-27)
### Bug Fixes
* unescape exclamation mark ([#26](https://github.com/gulpjs/glob-parent/issues/26)) ([a98874f](https://github.com/gulpjs/glob-parent/commit/a98874f1a59e407f4fb1beb0db4efa8392da60bb))
## [5.1.0](https://github.com/gulpjs/glob-parent/compare/v5.0.0...v5.1.0) (2021-01-27)
### Features
* add `flipBackslashes` option to disable auto conversion of slashes (closes [#24](https://github.com/gulpjs/glob-parent/issues/24)) ([#25](https://github.com/gulpjs/glob-parent/issues/25)) ([eecf91d](https://github.com/gulpjs/glob-parent/commit/eecf91d5e3834ed78aee39c4eaaae654d76b87b3))
## [5.0.0](https://github.com/gulpjs/glob-parent/compare/v4.0.0...v5.0.0) (2021-01-27)
### ⚠ BREAKING CHANGES
* Drop support for node <6 & bump dependencies
### Miscellaneous Chores
* Drop support for node <6 & bump dependencies ([896c0c0](https://github.com/gulpjs/glob-parent/commit/896c0c00b4e7362f60b96e7fc295ae929245255a))
## [4.0.0](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v4.0.0) (2021-01-27)
### ⚠ BREAKING CHANGES
* question marks are valid path characters on Windows so avoid flagging as a glob when alone
* Update is-glob dependency
### Features
* hoist regexps and strings for performance gains ([4a80667](https://github.com/gulpjs/glob-parent/commit/4a80667c69355c76a572a5892b0f133c8e1f457e))
* question marks are valid path characters on Windows so avoid flagging as a glob when alone ([2a551dd](https://github.com/gulpjs/glob-parent/commit/2a551dd0dc3235e78bf3c94843d4107072d17841))
* Update is-glob dependency ([e41fcd8](https://github.com/gulpjs/glob-parent/commit/e41fcd895d1f7bc617dba45c9d935a7949b9c281))
## [3.1.0](https://github.com/gulpjs/glob-parent/compare/v3.0.1...v3.1.0) (2021-01-27)
### Features
* allow basic win32 backslash use ([272afa5](https://github.com/gulpjs/glob-parent/commit/272afa5fd070fc0f796386a5993d4ee4a846988b))
* handle extglobs (parentheses) containing separators ([7db1bdb](https://github.com/gulpjs/glob-parent/commit/7db1bdb0756e55fd14619e8ce31aa31b17b117fd))
* new approach to braces/brackets handling ([8269bd8](https://github.com/gulpjs/glob-parent/commit/8269bd89290d99fac9395a354fb56fdcdb80f0be))
* pre-process braces/brackets sections ([9ef8a87](https://github.com/gulpjs/glob-parent/commit/9ef8a87f66b1a43d0591e7a8e4fc5a18415ee388))
* preserve escaped brace/bracket at end of string ([8cfb0ba](https://github.com/gulpjs/glob-parent/commit/8cfb0ba84202d51571340dcbaf61b79d16a26c76))
### Bug Fixes
* trailing escaped square brackets ([99ec9fe](https://github.com/gulpjs/glob-parent/commit/99ec9fecc60ee488ded20a94dd4f18b4f55c4ccf))
### [3.0.1](https://github.com/gulpjs/glob-parent/compare/v3.0.0...v3.0.1) (2021-01-27)
### Features
* use path-dirname ponyfill ([cdbea5f](https://github.com/gulpjs/glob-parent/commit/cdbea5f32a58a54e001a75ddd7c0fccd4776aacc))
### Bug Fixes
* unescape glob-escaped dirnames on output ([598c533](https://github.com/gulpjs/glob-parent/commit/598c533bdf49c1428bc063aa9b8db40c5a86b030))
## [3.0.0](https://github.com/gulpjs/glob-parent/compare/v2.0.0...v3.0.0) (2021-01-27)
### ⚠ BREAKING CHANGES
* update is-glob dependency
### Features
* update is-glob dependency ([5c5f8ef](https://github.com/gulpjs/glob-parent/commit/5c5f8efcee362a8e7638cf8220666acd8784f6bd))
## [2.0.0](https://github.com/gulpjs/glob-parent/compare/v1.3.0...v2.0.0) (2021-01-27)
### Features
* move up to dirname regardless of glob characters ([f97fb83](https://github.com/gulpjs/glob-parent/commit/f97fb83be2e0a9fc8d3b760e789d2ecadd6aa0c2))
## [1.3.0](https://github.com/gulpjs/glob-parent/compare/v1.2.0...v1.3.0) (2021-01-27)
## [1.2.0](https://github.com/gulpjs/glob-parent/compare/v1.1.0...v1.2.0) (2021-01-27)
### Reverts
* feat: make regex test strings smaller ([dc80fa9](https://github.com/gulpjs/glob-parent/commit/dc80fa9658dca20549cfeba44bbd37d5246fcce0))
## [1.1.0](https://github.com/gulpjs/glob-parent/compare/v1.0.0...v1.1.0) (2021-01-27)
### Features
* make regex test strings smaller ([cd83220](https://github.com/gulpjs/glob-parent/commit/cd832208638f45169f986d80fcf66e401f35d233))
## 1.0.0 (2021-01-27)
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/gel-core/columns/boolean.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyGelTable } from '~/gel-core/table.ts';\nimport { GelColumn, GelColumnBuilder } from './common.ts';\n\nexport type GelBooleanBuilderInitial<TName extends string> = GelBooleanBuilder<{\n\tname: TName;\n\tdataType: 'boolean';\n\tcolumnType: 'GelBoolean';\n\tdata: boolean;\n\tdriverParam: boolean;\n\tenumValues: undefined;\n}>;\n\nexport class GelBooleanBuilder<T extends ColumnBuilderBaseConfig<'boolean', 'GelBoolean'>> extends GelColumnBuilder<T> {\n\tstatic override readonly [entityKind]: string = 'GelBooleanBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'boolean', 'GelBoolean');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyGelTable<{ name: TTableName }>,\n\t): GelBoolean<MakeColumnConfig<T, TTableName>> {\n\t\treturn new GelBoolean<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);\n\t}\n}\n\nexport class GelBoolean<T extends ColumnBaseConfig<'boolean', 'GelBoolean'>> extends GelColumn<T> {\n\tstatic override readonly [entityKind]: string = 'GelBoolean';\n\n\tgetSQLType(): string {\n\t\treturn 'boolean';\n\t}\n}\n\nexport function boolean(): GelBooleanBuilderInitial<''>;\nexport function boolean<TName extends string>(name: TName): GelBooleanBuilderInitial<TName>;\nexport function boolean(name?: string) {\n\treturn new GelBooleanBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAE3B,oBAA4C;AAWrC,MAAM,0BAAsF,+BAAoB;AAAA,EACtH,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,WAAW,YAAY;AAAA,EACpC;AAAA;AAAA,EAGS,MACR,OAC8C;AAC9C,WAAO,IAAI,WAA4C,OAAO,KAAK,MAA8C;AAAA,EAClH;AACD;AAEO,MAAM,mBAAwE,wBAAa;AAAA,EACjG,QAA0B,wBAAU,IAAY;AAAA,EAEhD,aAAqB;AACpB,WAAO;AAAA,EACR;AACD;AAIO,SAAS,QAAQ,MAAe;AACtC,SAAO,IAAI,kBAAkB,QAAQ,EAAE;AACxC;","names":[]}
@@ -0,0 +1,27 @@
import type { SanitizedCollectionConfig } from '../../../collections/config/types.js';
import type { RequestContext } from '../../../index.js';
import type { JsonObject, PayloadRequest } from '../../../types/index.js';
import type { Field, TabAsField } from '../../config/types.js';
type Args<T> = {
/**
* Data of the nearest parent block. If no parent block exists, this will be the `undefined`
*/
blockData?: JsonObject;
collection: null | SanitizedCollectionConfig;
context: RequestContext;
doc: T;
field: Field | TabAsField;
fieldIndex: number;
id?: number | string;
overrideAccess: boolean;
parentIndexPath: string;
parentIsLocalized: boolean;
parentPath: string;
parentSchemaPath: string;
req: PayloadRequest;
siblingDoc: JsonObject;
siblingFields?: (Field | TabAsField)[];
};
export declare const promise: <T>({ id, blockData, collection, context, doc, field, fieldIndex, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingDoc, siblingFields, }: Args<T>) => Promise<void>;
export {};
//# sourceMappingURL=promise.d.ts.map
@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";import{throwIfCoreCollection as t}from"../../utils/throw-core-collection.js";const n=(n,r,i,a)=>()=>{let o={};return e(String(n),`Collection cannot be empty`),t(n,`Cannot use updateItems for core collections`),Array.isArray(r)?(e(r,`keysOrQuery cannot be empty`),o={keys:r}):(e(Object.keys(r),`keysOrQuery cannot be empty`),o={query:r}),o.data=i,{path:`/items/${n}`,params:a??{},body:JSON.stringify(o),method:`PATCH`}},r=(n,r,i)=>()=>(e(String(n),`Collection cannot be empty`),t(n,`Cannot use updateItems for core collections`),{path:`/items/${n}`,params:i??{},body:JSON.stringify(r),method:`PATCH`}),i=(n,r,i,a)=>()=>(e(String(r),`Key cannot be empty`),e(String(n),`Collection cannot be empty`),t(n,`Cannot use updateItem for core collections`),{path:`/items/${n}/${r}`,params:a??{},body:JSON.stringify(i),method:`PATCH`});export{i as updateItem,n as updateItems,r as updateItemsBatch};
//# sourceMappingURL=items.js.map
@@ -0,0 +1,49 @@
import { HandlerDataFetch } from './types-hoist/instrument';
import { ResponseHookInfo } from './types-hoist/request';
import { Span, SpanOrigin } from './types-hoist/span';
type PolymorphicRequestHeaders = Record<string, string | undefined> | Array<[
string,
string
]> | {
append: (key: string, value: string) => void;
get: (key: string) => string | null | undefined;
};
interface InstrumentFetchRequestOptions {
spanOrigin?: SpanOrigin;
propagateTraceparent?: boolean;
onRequestSpanEnd?: (span: Span, responseInformation: ResponseHookInfo) => void;
}
/**
* Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.
*
* @deprecated pass an options object instead of the spanOrigin parameter
*
* @returns Span if a span was created, otherwise void.
*/
export declare function instrumentFetchRequest(handlerData: HandlerDataFetch, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>, spanOrigin: SpanOrigin): Span | undefined;
/**
* Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.
*
* @returns Span if a span was created, otherwise void.
*/
export declare function instrumentFetchRequest(handlerData: HandlerDataFetch, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>, instrumentFetchRequestOptions: InstrumentFetchRequestOptions): Span | undefined;
/**
* Calls the onRequestSpanEnd callback if it is defined.
*/
export declare function _callOnRequestSpanEnd(span: Span, handlerData: HandlerDataFetch, spanOriginOrOptions?: SpanOrigin | InstrumentFetchRequestOptions): void;
/**
* Adds sentry-trace and baggage headers to the various forms of fetch headers.
* exported only for testing purposes
*
* When we determine if we should add a baggage header, there are 3 cases:
* 1. No previous baggage header -> add baggage
* 2. Previous baggage header has no sentry baggage values -> add our baggage
* 3. Previous baggage header has sentry baggage values -> do nothing (might have been added manually by users)
*/
export declare function _addTracingHeadersToFetchRequest(request: string | Request, fetchOptionsObj: {
headers?: {
[key: string]: string[] | string | undefined;
} | PolymorphicRequestHeaders;
}, span?: Span, propagateTraceparent?: boolean): PolymorphicRequestHeaders | undefined;
export {};
//# sourceMappingURL=fetch.d.ts.map
@@ -0,0 +1,368 @@
import { printBlockString } from './blockString.mjs';
import { printString } from './printString.mjs';
import { visit } from './visitor.mjs';
/**
* Converts an AST into a string, using one set of reasonable
* formatting rules.
*/
export function print(ast) {
return visit(ast, printDocASTReducer);
}
const MAX_LINE_LENGTH = 80;
const printDocASTReducer = {
Name: {
leave: (node) => node.value,
},
Variable: {
leave: (node) => '$' + node.name,
},
// Document
Document: {
leave: (node) => join(node.definitions, '\n\n'),
},
OperationDefinition: {
leave(node) {
const varDefs = hasMultilineItems(node.variableDefinitions)
? wrap('(\n', join(node.variableDefinitions, '\n'), '\n)')
: wrap('(', join(node.variableDefinitions, ', '), ')');
const prefix =
wrap('', node.description, '\n') +
join(
[
node.operation,
join([node.name, varDefs]),
join(node.directives, ' '),
],
' ',
); // Anonymous queries with no directives or variable definitions can use
// the query short form.
return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet;
},
},
VariableDefinition: {
leave: ({ variable, type, defaultValue, directives, description }) =>
wrap('', description, '\n') +
variable +
': ' +
type +
wrap(' = ', defaultValue) +
wrap(' ', join(directives, ' ')),
},
SelectionSet: {
leave: ({ selections }) => block(selections),
},
Field: {
leave({ alias, name, arguments: args, directives, selectionSet }) {
const prefix = wrap('', alias, ': ') + name;
let argsLine = prefix + wrap('(', join(args, ', '), ')');
if (argsLine.length > MAX_LINE_LENGTH) {
argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)');
}
return join([argsLine, join(directives, ' '), selectionSet], ' ');
},
},
Argument: {
leave: ({ name, value }) => name + ': ' + value,
},
// Fragments
FragmentSpread: {
leave: ({ name, directives }) =>
'...' + name + wrap(' ', join(directives, ' ')),
},
InlineFragment: {
leave: ({ typeCondition, directives, selectionSet }) =>
join(
[
'...',
wrap('on ', typeCondition),
join(directives, ' '),
selectionSet,
],
' ',
),
},
FragmentDefinition: {
leave: ({
name,
typeCondition,
variableDefinitions,
directives,
selectionSet,
description,
}) =>
wrap('', description, '\n') + // Note: fragment variable definitions are experimental and may be changed
// or removed in the future.
`fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` +
`on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` +
selectionSet,
},
// Value
IntValue: {
leave: ({ value }) => value,
},
FloatValue: {
leave: ({ value }) => value,
},
StringValue: {
leave: ({ value, block: isBlockString }) =>
isBlockString ? printBlockString(value) : printString(value),
},
BooleanValue: {
leave: ({ value }) => (value ? 'true' : 'false'),
},
NullValue: {
leave: () => 'null',
},
EnumValue: {
leave: ({ value }) => value,
},
ListValue: {
leave: ({ values }) => '[' + join(values, ', ') + ']',
},
ObjectValue: {
leave: ({ fields }) => '{' + join(fields, ', ') + '}',
},
ObjectField: {
leave: ({ name, value }) => name + ': ' + value,
},
// Directive
Directive: {
leave: ({ name, arguments: args }) =>
'@' + name + wrap('(', join(args, ', '), ')'),
},
// Type
NamedType: {
leave: ({ name }) => name,
},
ListType: {
leave: ({ type }) => '[' + type + ']',
},
NonNullType: {
leave: ({ type }) => type + '!',
},
// Type System Definitions
SchemaDefinition: {
leave: ({ description, directives, operationTypes }) =>
wrap('', description, '\n') +
join(['schema', join(directives, ' '), block(operationTypes)], ' '),
},
OperationTypeDefinition: {
leave: ({ operation, type }) => operation + ': ' + type,
},
ScalarTypeDefinition: {
leave: ({ description, name, directives }) =>
wrap('', description, '\n') +
join(['scalar', name, join(directives, ' ')], ' '),
},
ObjectTypeDefinition: {
leave: ({ description, name, interfaces, directives, fields }) =>
wrap('', description, '\n') +
join(
[
'type',
name,
wrap('implements ', join(interfaces, ' & ')),
join(directives, ' '),
block(fields),
],
' ',
),
},
FieldDefinition: {
leave: ({ description, name, arguments: args, type, directives }) =>
wrap('', description, '\n') +
name +
(hasMultilineItems(args)
? wrap('(\n', indent(join(args, '\n')), '\n)')
: wrap('(', join(args, ', '), ')')) +
': ' +
type +
wrap(' ', join(directives, ' ')),
},
InputValueDefinition: {
leave: ({ description, name, type, defaultValue, directives }) =>
wrap('', description, '\n') +
join(
[name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],
' ',
),
},
InterfaceTypeDefinition: {
leave: ({ description, name, interfaces, directives, fields }) =>
wrap('', description, '\n') +
join(
[
'interface',
name,
wrap('implements ', join(interfaces, ' & ')),
join(directives, ' '),
block(fields),
],
' ',
),
},
UnionTypeDefinition: {
leave: ({ description, name, directives, types }) =>
wrap('', description, '\n') +
join(
['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],
' ',
),
},
EnumTypeDefinition: {
leave: ({ description, name, directives, values }) =>
wrap('', description, '\n') +
join(['enum', name, join(directives, ' '), block(values)], ' '),
},
EnumValueDefinition: {
leave: ({ description, name, directives }) =>
wrap('', description, '\n') + join([name, join(directives, ' ')], ' '),
},
InputObjectTypeDefinition: {
leave: ({ description, name, directives, fields }) =>
wrap('', description, '\n') +
join(['input', name, join(directives, ' '), block(fields)], ' '),
},
DirectiveDefinition: {
leave: ({ description, name, arguments: args, repeatable, locations }) =>
wrap('', description, '\n') +
'directive @' +
name +
(hasMultilineItems(args)
? wrap('(\n', indent(join(args, '\n')), '\n)')
: wrap('(', join(args, ', '), ')')) +
(repeatable ? ' repeatable' : '') +
' on ' +
join(locations, ' | '),
},
SchemaExtension: {
leave: ({ directives, operationTypes }) =>
join(
['extend schema', join(directives, ' '), block(operationTypes)],
' ',
),
},
ScalarTypeExtension: {
leave: ({ name, directives }) =>
join(['extend scalar', name, join(directives, ' ')], ' '),
},
ObjectTypeExtension: {
leave: ({ name, interfaces, directives, fields }) =>
join(
[
'extend type',
name,
wrap('implements ', join(interfaces, ' & ')),
join(directives, ' '),
block(fields),
],
' ',
),
},
InterfaceTypeExtension: {
leave: ({ name, interfaces, directives, fields }) =>
join(
[
'extend interface',
name,
wrap('implements ', join(interfaces, ' & ')),
join(directives, ' '),
block(fields),
],
' ',
),
},
UnionTypeExtension: {
leave: ({ name, directives, types }) =>
join(
[
'extend union',
name,
join(directives, ' '),
wrap('= ', join(types, ' | ')),
],
' ',
),
},
EnumTypeExtension: {
leave: ({ name, directives, values }) =>
join(['extend enum', name, join(directives, ' '), block(values)], ' '),
},
InputObjectTypeExtension: {
leave: ({ name, directives, fields }) =>
join(['extend input', name, join(directives, ' '), block(fields)], ' '),
},
// Schema Coordinates
TypeCoordinate: {
leave: ({ name }) => name,
},
MemberCoordinate: {
leave: ({ name, memberName }) => join([name, wrap('.', memberName)]),
},
ArgumentCoordinate: {
leave: ({ name, fieldName, argumentName }) =>
join([name, wrap('.', fieldName), wrap('(', argumentName, ':)')]),
},
DirectiveCoordinate: {
leave: ({ name }) => join(['@', name]),
},
DirectiveArgumentCoordinate: {
leave: ({ name, argumentName }) =>
join(['@', name, wrap('(', argumentName, ':)')]),
},
};
/**
* Given maybeArray, print an empty string if it is null or empty, otherwise
* print all items together separated by separator if provided
*/
function join(maybeArray, separator = '') {
var _maybeArray$filter$jo;
return (_maybeArray$filter$jo =
maybeArray === null || maybeArray === void 0
? void 0
: maybeArray.filter((x) => x).join(separator)) !== null &&
_maybeArray$filter$jo !== void 0
? _maybeArray$filter$jo
: '';
}
/**
* Given array, print each item on its own line, wrapped in an indented `{ }` block.
*/
function block(array) {
return wrap('{\n', indent(join(array, '\n')), '\n}');
}
/**
* If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.
*/
function wrap(start, maybeString, end = '') {
return maybeString != null && maybeString !== ''
? start + maybeString + end
: '';
}
function indent(str) {
return wrap(' ', str.replace(/\n/g, '\n '));
}
function hasMultilineItems(maybeArray) {
var _maybeArray$some;
// FIXME: https://github.com/graphql/graphql-js/issues/2203
/* c8 ignore next */
return (_maybeArray$some =
maybeArray === null || maybeArray === void 0
? void 0
: maybeArray.some((str) => str.includes('\n'))) !== null &&
_maybeArray$some !== void 0
? _maybeArray$some
: false;
}
@@ -0,0 +1,250 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import { useRouter } from 'next/navigation.js';
import { formatAdminURL, formatFilesize } from 'payload/shared';
import React, { Fragment, useEffect } from 'react';
import { useBulkUpload } from '../../elements/BulkUpload/index.js';
import { Button } from '../../elements/Button/index.js';
import { Gutter } from '../../elements/Gutter/index.js';
import { ListControls } from '../../elements/ListControls/index.js';
import { useListDrawerContext } from '../../elements/ListDrawer/Provider.js';
import { useModal } from '../../elements/Modal/index.js';
import { NoListResults } from '../../elements/NoListResults/index.js';
import { PageControls } from '../../elements/PageControls/index.js';
import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js';
import { SelectMany } from '../../elements/SelectMany/index.js';
import { useStepNav } from '../../elements/StepNav/index.js';
import { StickyToolbar } from '../../elements/StickyToolbar/index.js';
import { RelationshipProvider } from '../../elements/Table/RelationshipProvider/index.js';
import { ViewDescription } from '../../elements/ViewDescription/index.js';
import { useControllableState } from '../../hooks/useControllableState.js';
import { useConfig } from '../../providers/Config/index.js';
import { useListQuery } from '../../providers/ListQuery/index.js';
import { SelectionProvider } from '../../providers/Selection/index.js';
import { TableColumnsProvider } from '../../providers/TableColumns/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { useWindowInfo } from '../../providers/WindowInfo/index.js';
import { ListSelection } from '../../views/List/ListSelection/index.js';
import { CollectionListHeader } from './ListHeader/index.js';
import './index.scss';
const baseClass = 'collection-list';
export function DefaultListView(props) {
const {
AfterList,
AfterListTable,
beforeActions,
BeforeList,
BeforeListTable,
collectionSlug,
columnState,
Description,
disableBulkDelete,
disableBulkEdit,
disableQueryPresets,
enableRowSelections,
hasCreatePermission: hasCreatePermissionFromProps,
hasDeletePermission,
listMenuItems,
newDocumentURL,
queryPreset,
queryPresetPermissions,
renderedFilters,
resolvedFilterOptions,
Table: InitialTable,
viewType
} = props;
const [Table] = useControllableState(InitialTable);
const {
allowCreate,
createNewDrawerSlug,
isInDrawer,
onBulkSelect
} = useListDrawerContext();
const hasCreatePermission = allowCreate !== undefined ? allowCreate && hasCreatePermissionFromProps : hasCreatePermissionFromProps;
const {
config: {
routes: {
admin: adminRoute
},
serverURL
},
getEntityConfig
} = useConfig();
const router = useRouter();
const {
data,
isGroupingBy
} = useListQuery();
const {
openModal
} = useModal();
const {
drawerSlug: bulkUploadDrawerSlug,
setCollectionSlug,
setOnSuccess
} = useBulkUpload();
const collectionConfig = getEntityConfig({
collectionSlug
});
const {
labels,
upload
} = collectionConfig;
const isUploadCollection = Boolean(upload);
const isBulkUploadEnabled = isUploadCollection && collectionConfig.upload.bulkUpload;
const isTrashEnabled = Boolean(collectionConfig.trash);
const {
i18n
} = useTranslation();
const {
setStepNav
} = useStepNav();
const {
breakpoints: {
s: smallBreak
}
} = useWindowInfo();
const docs = React.useMemo(() => {
if (isUploadCollection) {
return data.docs.map(doc => {
return {
...doc,
filesize: formatFilesize(doc.filesize)
};
});
} else {
return data?.docs;
}
}, [data?.docs, isUploadCollection]);
const openBulkUpload = React.useCallback(() => {
setCollectionSlug(collectionSlug);
openModal(bulkUploadDrawerSlug);
setOnSuccess(() => router.refresh());
}, [router, collectionSlug, bulkUploadDrawerSlug, openModal, setCollectionSlug, setOnSuccess]);
useEffect(() => {
if (!isInDrawer) {
const baseLabel = {
label: getTranslation(labels?.plural, i18n),
url: isTrashEnabled && viewType === 'trash' ? formatAdminURL({
adminRoute,
path: `/collections/${collectionSlug}`
}) : undefined
};
const trashLabel = {
label: i18n.t('general:trash')
};
const navItems = isTrashEnabled && viewType === 'trash' ? [baseLabel, trashLabel] : [baseLabel];
setStepNav(navItems);
}
}, [adminRoute, setStepNav, serverURL, labels, isInDrawer, isTrashEnabled, viewType, i18n, collectionSlug]);
return /*#__PURE__*/_jsxs(Fragment, {
children: [/*#__PURE__*/_jsx(TableColumnsProvider, {
collectionSlug: collectionSlug,
columnState: columnState,
children: /*#__PURE__*/_jsx("div", {
className: `${baseClass} ${baseClass}--${collectionSlug}`,
children: /*#__PURE__*/_jsxs(SelectionProvider, {
docs: docs,
totalDocs: data?.totalDocs,
children: [BeforeList, /*#__PURE__*/_jsxs(Gutter, {
className: `${baseClass}__wrap`,
children: [/*#__PURE__*/_jsx(CollectionListHeader, {
collectionConfig: collectionConfig,
Description: Description || collectionConfig?.admin?.description ? /*#__PURE__*/_jsx("div", {
className: `${baseClass}__sub-header`,
children: /*#__PURE__*/_jsx(RenderCustomComponent, {
CustomComponent: Description,
Fallback: /*#__PURE__*/_jsx(ViewDescription, {
collectionSlug: collectionSlug,
description: collectionConfig?.admin?.description
})
})
}) : undefined,
disableBulkDelete: disableBulkDelete,
disableBulkEdit: disableBulkEdit,
hasCreatePermission: hasCreatePermission,
hasDeletePermission: hasDeletePermission,
i18n: i18n,
isBulkUploadEnabled: isBulkUploadEnabled && !upload.hideFileInputOnCreate,
isTrashEnabled: isTrashEnabled,
newDocumentURL: newDocumentURL,
openBulkUpload: openBulkUpload,
smallBreak: smallBreak,
viewType: viewType
}), /*#__PURE__*/_jsx(ListControls, {
beforeActions: enableRowSelections && typeof onBulkSelect === 'function' ? beforeActions ? [...beforeActions, /*#__PURE__*/_jsx(SelectMany, {
onClick: onBulkSelect
}, "select-many")] : [/*#__PURE__*/_jsx(SelectMany, {
onClick: onBulkSelect
}, "select-many")] : beforeActions,
collectionConfig: collectionConfig,
collectionSlug: collectionSlug,
disableQueryPresets: collectionConfig?.enableQueryPresets !== true || disableQueryPresets,
listMenuItems: listMenuItems,
queryPreset: queryPreset,
queryPresetPermissions: queryPresetPermissions,
renderedFilters: renderedFilters,
resolvedFilterOptions: resolvedFilterOptions
}), BeforeListTable, docs?.length > 0 && /*#__PURE__*/_jsx("div", {
className: `${baseClass}__tables`,
children: /*#__PURE__*/_jsx(RelationshipProvider, {
children: Table
})
}), docs?.length === 0 && /*#__PURE__*/_jsx(NoListResults, {
Actions: hasCreatePermission && newDocumentURL && viewType !== 'trash' ? [isInDrawer ? /*#__PURE__*/_jsx(Button, {
el: "button",
onClick: () => openModal(createNewDrawerSlug),
children: i18n.t('general:createNewLabel', {
label: getTranslation(labels?.singular, i18n)
})
}, "create") : /*#__PURE__*/_jsx(Button, {
el: "link",
to: newDocumentURL,
children: i18n.t('general:createNewLabel', {
label: getTranslation(labels?.singular, i18n)
})
}, "create")] : [],
Message: viewType === 'trash' ? /*#__PURE__*/_jsx("p", {
children: i18n.t('general:noTrashResults', {
label: getTranslation(labels?.plural, i18n)
})
}) : /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx("h3", {
children: i18n.t('general:noResultsFound')
}), /*#__PURE__*/_jsx("p", {
children: i18n.t('general:noResultsDescription')
})]
})
}), AfterListTable, docs?.length > 0 && !isGroupingBy && /*#__PURE__*/_jsx(PageControls, {
AfterPageControls: smallBreak ? /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__list-selection`,
children: [/*#__PURE__*/_jsx(ListSelection, {
collectionConfig: collectionConfig,
disableBulkDelete: disableBulkDelete,
disableBulkEdit: disableBulkEdit,
label: getTranslation(collectionConfig.labels.plural, i18n),
showSelectAllAcrossPages: !isGroupingBy
}), /*#__PURE__*/_jsx("div", {
className: `${baseClass}__list-selection-actions`,
children: enableRowSelections && typeof onBulkSelect === 'function' ? beforeActions ? [...beforeActions, /*#__PURE__*/_jsx(SelectMany, {
onClick: onBulkSelect
}, "select-many")] : [/*#__PURE__*/_jsx(SelectMany, {
onClick: onBulkSelect
}, "select-many")] : beforeActions
})]
}) : null,
collectionConfig: collectionConfig
})]
}), AfterList]
})
})
}), docs?.length > 0 && isGroupingBy && data.totalPages > 1 && /*#__PURE__*/_jsx(StickyToolbar, {
children: /*#__PURE__*/_jsx(PageControls, {
collectionConfig: collectionConfig
})
})]
});
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","baseClass","Page","isCurrent","isFirstPage","isLastPage","page","updatePage","classes","filter","Boolean","join","_jsx","className","onClick","type"],"sources":["../../../../src/elements/Pagination/Page/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nexport type PageProps = {\n isCurrent?: boolean\n isFirstPage?: boolean\n isLastPage?: boolean\n page?: number\n updatePage?: (page) => void\n}\n\nconst baseClass = 'paginator__page'\n\nexport const Page: React.FC<PageProps> = ({\n isCurrent,\n isFirstPage = false,\n isLastPage = false,\n page = 1,\n updatePage,\n}) => {\n const classes = [\n baseClass,\n isCurrent && `${baseClass}--is-current`,\n isFirstPage && `${baseClass}--is-first-page`,\n isLastPage && `${baseClass}--is-last-page`,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <button className={classes} onClick={() => updatePage(page)} type=\"button\">\n {page}\n </button>\n )\n}\n"],"mappings":"AAAA;;;AACA,OAAOA,KAAA,MAAW;AAUlB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,IAAA,GAA4BA,CAAC;EACxCC,SAAS;EACTC,WAAA,GAAc,KAAK;EACnBC,UAAA,GAAa,KAAK;EAClBC,IAAA,GAAO,CAAC;EACRC;AAAU,CACX;EACC,MAAMC,OAAA,GAAU,CACdP,SAAA,EACAE,SAAA,IAAa,GAAGF,SAAA,cAAuB,EACvCG,WAAA,IAAe,GAAGH,SAAA,iBAA0B,EAC5CI,UAAA,IAAc,GAAGJ,SAAA,gBAAyB,CAC3C,CACEQ,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;EAER,oBACEC,IAAA,CAAC;IAAOC,SAAA,EAAWL,OAAA;IAASM,OAAA,EAASA,CAAA,KAAMP,UAAA,CAAWD,IAAA;IAAOS,IAAA,EAAK;cAC/DT;;AAGP","ignoreList":[]}
@@ -0,0 +1 @@
export { _ as default } from "../esm/_async_to_generator.js";
@@ -0,0 +1,194 @@
import { NoopCache } from "../cache/core/index.js";
import { entityKind } from "../entity.js";
import { NoopLogger } from "../logger.js";
import { fillPlaceholders, sql } from "../sql/sql.js";
import { SQLiteTransaction } from "../sqlite-core/index.js";
import { SQLitePreparedQuery, SQLiteSession } from "../sqlite-core/session.js";
import { mapResultRow } from "../utils.js";
class SQLiteD1Session extends SQLiteSession {
constructor(client, dialect, schema, options = {}) {
super(dialect);
this.client = client;
this.schema = schema;
this.options = options;
this.logger = options.logger ?? new NoopLogger();
this.cache = options.cache ?? new NoopCache();
}
static [entityKind] = "SQLiteD1Session";
logger;
cache;
prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) {
const stmt = this.client.prepare(query.sql);
return new D1PreparedQuery(
stmt,
query,
this.logger,
this.cache,
queryMetadata,
cacheConfig,
fields,
executeMethod,
isResponseInArrayMode,
customResultMapper
);
}
async batch(queries) {
const preparedQueries = [];
const builtQueries = [];
for (const query of queries) {
const preparedQuery = query._prepare();
const builtQuery = preparedQuery.getQuery();
preparedQueries.push(preparedQuery);
if (builtQuery.params.length > 0) {
builtQueries.push(preparedQuery.stmt.bind(...builtQuery.params));
} else {
const builtQuery2 = preparedQuery.getQuery();
builtQueries.push(
this.client.prepare(builtQuery2.sql).bind(...builtQuery2.params)
);
}
}
const batchResults = await this.client.batch(builtQueries);
return batchResults.map((result, i) => preparedQueries[i].mapResult(result, true));
}
extractRawAllValueFromBatchResult(result) {
return result.results;
}
extractRawGetValueFromBatchResult(result) {
return result.results[0];
}
extractRawValuesValueFromBatchResult(result) {
return d1ToRawMapping(result.results);
}
async transaction(transaction, config) {
const tx = new D1Transaction("async", this.dialect, this, this.schema);
await this.run(sql.raw(`begin${config?.behavior ? " " + config.behavior : ""}`));
try {
const result = await transaction(tx);
await this.run(sql`commit`);
return result;
} catch (err) {
await this.run(sql`rollback`);
throw err;
}
}
}
class D1Transaction extends SQLiteTransaction {
static [entityKind] = "D1Transaction";
async transaction(transaction) {
const savepointName = `sp${this.nestedIndex}`;
const tx = new D1Transaction("async", this.dialect, this.session, this.schema, this.nestedIndex + 1);
await this.session.run(sql.raw(`savepoint ${savepointName}`));
try {
const result = await transaction(tx);
await this.session.run(sql.raw(`release savepoint ${savepointName}`));
return result;
} catch (err) {
await this.session.run(sql.raw(`rollback to savepoint ${savepointName}`));
throw err;
}
}
}
function d1ToRawMapping(results) {
const rows = [];
for (const row of results) {
const entry = Object.keys(row).map((k) => row[k]);
rows.push(entry);
}
return rows;
}
class D1PreparedQuery extends SQLitePreparedQuery {
constructor(stmt, query, logger, cache, queryMetadata, cacheConfig, fields, executeMethod, _isResponseInArrayMode, customResultMapper) {
super("async", executeMethod, query, cache, queryMetadata, cacheConfig);
this.logger = logger;
this._isResponseInArrayMode = _isResponseInArrayMode;
this.customResultMapper = customResultMapper;
this.fields = fields;
this.stmt = stmt;
}
static [entityKind] = "D1PreparedQuery";
/** @internal */
customResultMapper;
/** @internal */
fields;
/** @internal */
stmt;
async run(placeholderValues) {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
return await this.queryWithCache(this.query.sql, params, async () => {
return this.stmt.bind(...params).run();
});
}
async all(placeholderValues) {
const { fields, query, logger, stmt, customResultMapper } = this;
if (!fields && !customResultMapper) {
const params = fillPlaceholders(query.params, placeholderValues ?? {});
logger.logQuery(query.sql, params);
return await this.queryWithCache(query.sql, params, async () => {
return stmt.bind(...params).all().then(({ results }) => this.mapAllResult(results));
});
}
const rows = await this.values(placeholderValues);
return this.mapAllResult(rows);
}
mapAllResult(rows, isFromBatch) {
if (isFromBatch) {
rows = d1ToRawMapping(rows.results);
}
if (!this.fields && !this.customResultMapper) {
return rows;
}
if (this.customResultMapper) {
return this.customResultMapper(rows);
}
return rows.map((row) => mapResultRow(this.fields, row, this.joinsNotNullableMap));
}
async get(placeholderValues) {
const { fields, joinsNotNullableMap, query, logger, stmt, customResultMapper } = this;
if (!fields && !customResultMapper) {
const params = fillPlaceholders(query.params, placeholderValues ?? {});
logger.logQuery(query.sql, params);
return await this.queryWithCache(query.sql, params, async () => {
return stmt.bind(...params).all().then(({ results }) => results[0]);
});
}
const rows = await this.values(placeholderValues);
if (!rows[0]) {
return void 0;
}
if (customResultMapper) {
return customResultMapper(rows);
}
return mapResultRow(fields, rows[0], joinsNotNullableMap);
}
mapGetResult(result, isFromBatch) {
if (isFromBatch) {
result = d1ToRawMapping(result.results)[0];
}
if (!this.fields && !this.customResultMapper) {
return result;
}
if (this.customResultMapper) {
return this.customResultMapper([result]);
}
return mapResultRow(this.fields, result, this.joinsNotNullableMap);
}
async values(placeholderValues) {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
return await this.queryWithCache(this.query.sql, params, async () => {
return this.stmt.bind(...params).raw();
});
}
/** @internal */
isResponseInArrayMode() {
return this._isResponseInArrayMode;
}
}
export {
D1PreparedQuery,
D1Transaction,
SQLiteD1Session
};
//# sourceMappingURL=session.js.map
@@ -0,0 +1,120 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ALPHABET =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const CONTINUATION_BIT = 0x20;
const END_SEGMENT_BIT = 0x40;
const NEXT_LINE = END_SEGMENT_BIT | 0x01;
const INVALID = END_SEGMENT_BIT | 0x02;
const DATA_MASK = 0x1f;
const ccToValue = new Uint8Array("z".charCodeAt(0) + 1);
ccToValue.fill(INVALID);
for (let i = 0; i < ALPHABET.length; i++) {
ccToValue[ALPHABET.charCodeAt(i)] = i;
}
ccToValue[",".charCodeAt(0)] = END_SEGMENT_BIT;
ccToValue[";".charCodeAt(0)] = NEXT_LINE;
const ccMax = ccToValue.length - 1;
/** @typedef {(generatedLine: number, generatedColumn: number, sourceIndex: number, originalLine: number, originalColumn: number, nameIndex: number) => void} OnMapping */
/**
* @param {string} mappings the mappings string
* @param {OnMapping} onMapping called for each mapping
* @returns {void}
*/
const readMappings = (mappings, onMapping) => {
// generatedColumn, [sourceIndex, originalLine, orignalColumn, [nameIndex]]
const currentData = new Uint32Array([0, 0, 1, 0, 0]);
let currentDataPos = 0;
// currentValue will include a sign bit at bit 0
let currentValue = 0;
let currentValuePos = 0;
let generatedLine = 1;
let generatedColumn = -1;
for (let i = 0; i < mappings.length; i++) {
const cc = mappings.charCodeAt(i);
if (cc > ccMax) continue;
const value = ccToValue[cc];
if ((value & END_SEGMENT_BIT) !== 0) {
// End current segment
if (currentData[0] > generatedColumn) {
if (currentDataPos === 1) {
onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
} else if (currentDataPos === 4) {
onMapping(
generatedLine,
currentData[0],
currentData[1],
currentData[2],
currentData[3],
-1,
);
} else if (currentDataPos === 5) {
onMapping(
generatedLine,
currentData[0],
currentData[1],
currentData[2],
currentData[3],
currentData[4],
);
}
[generatedColumn] = currentData;
}
currentDataPos = 0;
if (value === NEXT_LINE) {
// Start new line
generatedLine++;
currentData[0] = 0;
generatedColumn = -1;
}
} else if ((value & CONTINUATION_BIT) === 0) {
// last sextet
currentValue |= value << currentValuePos;
const finalValue =
currentValue & 1 ? -(currentValue >> 1) : currentValue >> 1;
currentData[currentDataPos++] += finalValue;
currentValuePos = 0;
currentValue = 0;
} else {
currentValue |= (value & DATA_MASK) << currentValuePos;
currentValuePos += 5;
}
}
// End current segment
if (currentDataPos === 1) {
onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
} else if (currentDataPos === 4) {
onMapping(
generatedLine,
currentData[0],
currentData[1],
currentData[2],
currentData[3],
-1,
);
} else if (currentDataPos === 5) {
onMapping(
generatedLine,
currentData[0],
currentData[1],
currentData[2],
currentData[3],
currentData[4],
);
}
};
module.exports = readMappings;
@@ -0,0 +1,219 @@
import {List, ValueObject} from 'immutable';
import {SassBoolean} from './boolean';
import {SassCalculation} from './calculation';
import {SassColor} from './color';
import {SassFunction} from './function';
import {ListSeparator} from './list';
import {SassMap} from './map';
import {SassMixin} from './mixin';
import {SassNumber} from './number';
import {SassString} from './string';
export {SassArgumentList} from './argument_list';
export {SassBoolean, sassTrue, sassFalse} from './boolean';
export {
SassCalculation,
CalculationValue,
CalculationOperator,
CalculationOperation,
CalculationInterpolation,
} from './calculation';
export {
SassColor,
ColorSpaceHsl,
ChannelNameHsl,
ColorSpaceHwb,
ChannelNameHwb,
ColorSpaceLab,
ChannelNameLab,
ColorSpaceLch,
ChannelNameLch,
ColorSpaceRgb,
ChannelNameRgb,
ColorSpaceXyz,
ChannelNameXyz,
ChannelName,
GamutMapMethod,
KnownColorSpace,
PolarColorSpace,
RectangularColorSpace,
HueInterpolationMethod,
} from './color';
export {SassFunction} from './function';
export {SassList, ListSeparator} from './list';
export {SassMap} from './map';
export {SassMixin} from './mixin';
export {SassNumber} from './number';
export {SassString} from './string';
/**
* Sass's [`null` value](https://sass-lang.com/documentation/values/null).
*
* @category Custom Function
*/
export const sassNull: Value;
/**
* The abstract base class of Sass's value types.
*
* This is passed to and returned by {@link CustomFunction}s, which are passed
* into the Sass implementation using {@link Options.functions}.
*
* @category Custom Function
*/
export abstract class Value implements ValueObject {
protected constructor();
/**
* This value as a list.
*
* All SassScript values can be used as lists. Maps count as lists of pairs,
* and all other values count as single-value lists.
*
* @returns An immutable {@link List} from the [`immutable`
* package](https://immutable-js.com/).
*/
get asList(): List<Value>;
/**
* Whether this value as a list has brackets.
*
* All SassScript values can be used as lists. Maps count as lists of pairs,
* and all other values count as single-value lists.
*/
get hasBrackets(): boolean;
/**
* Whether the value counts as `true` in an `@if` statement and other
* contexts.
*/
get isTruthy(): boolean;
/**
* Returns JavaScript's `null` value if this is {@link sassNull}, and returns
* `this` otherwise.
*/
get realNull(): null | Value;
/**
* The separator for this value as a list.
*
* All SassScript values can be used as lists. Maps count as lists of pairs,
* and all other values count as single-value lists.
*/
get separator(): ListSeparator;
/**
* Converts `sassIndex` into a JavaScript-style index into the list returned
* by {@link asList}.
*
* Sass indexes are one-based, while JavaScript indexes are zero-based. Sass
* indexes may also be negative in order to index from the end of the list.
*
* @param sassIndex - The Sass-style index into this as a list.
* @param name - The name of the function argument `sassIndex` came from
* (without the `$`) if it came from an argument. Used for error reporting.
* @throws `Error` If `sassIndex` isn't a number, if that number isn't an
* integer, or if that integer isn't a valid index for {@link asList}.
*/
sassIndexToListIndex(sassIndex: Value, name?: string): number;
/**
* Returns the value at index `index` in this value as a list, or `undefined`
* if `index` isn't valid for this list.
*
* All SassScript values can be used as lists. Maps count as lists of pairs,
* and all other values count as single-value lists.
*
* This is a shorthand for `this.asList.get(index)`, although it may be more
* efficient in some cases.
*
* **Heads up!** This method uses the same indexing conventions as the
* `immutable` package: unlike Sass the index of the first element is 0, but
* like Sass negative numbers index from the end of the list.
*/
get(index: number): Value | undefined;
/**
* Throws if `this` isn't a {@link SassBoolean}.
*
* **Heads up!** Functions should generally use {@link isTruthy} rather than
* requiring a literal boolean.
*
* @param name - The name of the function argument `this` came from (without
* the `$`) if it came from an argument. Used for error reporting.
*/
assertBoolean(name?: string): SassBoolean;
/**
* Throws if `this` isn't a {@link SassCalculation}.
*
* @param name - The name of the function argument `this` came from (without
* the `$`) if it came from an argument. Used for error reporting.
*/
assertCalculation(name?: string): SassCalculation;
/**
* Throws if `this` isn't a {@link SassColor}.
*
* @param name - The name of the function argument `this` came from (without
* the `$`) if it came from an argument. Used for error reporting.
*/
assertColor(name?: string): SassColor;
/**
* Throws if `this` isn't a {@link SassFunction}.
*
* @param name - The name of the function argument `this` came from (without
* the `$`) if it came from an argument. Used for error reporting.
*/
assertFunction(name?: string): SassFunction;
/**
* Throws if `this` isn't a {@link SassMap}.
*
* @param name - The name of the function argument `this` came from (without
* the `$`) if it came from an argument. Used for error reporting.
*/
assertMap(name?: string): SassMap;
/**
* Throws if `this` isn't a {@link SassMixin}.
*
* @param name - The name of the function argument `this` came from (without
* the `$`) if it came from an argument. Used for error reporting.
*/
assertMixin(name?: string): SassMixin;
/**
* Throws if `this` isn't a {@link SassNumber}.
*
* @param name - The name of the function argument `this` came from (without
* the `$`) if it came from an argument. Used for error reporting.
*/
assertNumber(name?: string): SassNumber;
/**
* Throws if `this` isn't a {@link SassString}.
*
* @param name - The name of the function argument `this` came from (without
* the `$`) if it came from an argument. Used for error reporting.
*/
assertString(name?: string): SassString;
/**
* Returns `this` as a map if it counts as one (empty lists count as empty
* maps) or `null` if it doesn't.
*/
tryMap(): SassMap | null;
/** Returns whether `this` represents the same value as `other`. */
equals(other: Value): boolean;
/** Returns a hash code that can be used to store `this` in a hash map. */
hashCode(): number;
/** @hidden */
toString(): string;
}
@@ -0,0 +1 @@
{"version":3,"file":"move-diagonal.js","sources":["../../../src/icons/move-diagonal.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MoveDiagonal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxMyA1IDE5IDUgMTkgMTEiIC8+CiAgPHBvbHlsaW5lIHBvaW50cz0iMTEgMTkgNSAxOSA1IDEzIiAvPgogIDxsaW5lIHgxPSIxOSIgeDI9IjUiIHkxPSI1IiB5Mj0iMTkiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/move-diagonal\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 MoveDiagonal = createLucideIcon('MoveDiagonal', [\n ['polyline', { points: '13 5 19 5 19 11', key: '11219e' }],\n ['polyline', { points: '11 19 5 19 5 13', key: 'sfq3wq' }],\n ['line', { x1: '19', x2: '5', y1: '5', y2: '19', key: '1x9vlm' }],\n]);\n\nexport default MoveDiagonal;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzD,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,212 @@
(function (global, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
factory(module, require('@jridgewell/gen-mapping'), require('@jridgewell/trace-mapping'));
module.exports = def(module);
} else if (typeof define === 'function' && define.amd) {
define(['module', '@jridgewell/gen-mapping', '@jridgewell/trace-mapping'], function(mod) {
factory.apply(this, arguments);
mod.exports = def(mod);
});
} else {
const mod = { exports: {} };
factory(mod, global.genMapping, global.traceMapping);
global = typeof globalThis !== 'undefined' ? globalThis : global || self;
global.remapping = def(mod);
}
function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; }
})(this, (function (module, require_genMapping, require_traceMapping) {
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// umd:@jridgewell/trace-mapping
var require_trace_mapping = __commonJS({
"umd:@jridgewell/trace-mapping"(exports, module2) {
module2.exports = require_traceMapping;
}
});
// umd:@jridgewell/gen-mapping
var require_gen_mapping = __commonJS({
"umd:@jridgewell/gen-mapping"(exports, module2) {
module2.exports = require_genMapping;
}
});
// src/remapping.ts
var remapping_exports = {};
__export(remapping_exports, {
default: () => remapping
});
module.exports = __toCommonJS(remapping_exports);
// src/build-source-map-tree.ts
var import_trace_mapping2 = __toESM(require_trace_mapping());
// src/source-map-tree.ts
var import_gen_mapping = __toESM(require_gen_mapping());
var import_trace_mapping = __toESM(require_trace_mapping());
var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
var EMPTY_SOURCES = [];
function SegmentObject(source, line, column, name, content, ignore) {
return { source, line, column, name, content, ignore };
}
function Source(map, sources, source, content, ignore) {
return {
map,
sources,
source,
content,
ignore
};
}
function MapSource(map, sources) {
return Source(map, sources, "", null, false);
}
function OriginalSource(source, content, ignore) {
return Source(null, EMPTY_SOURCES, source, content, ignore);
}
function traceMappings(tree) {
const gen = new import_gen_mapping.GenMapping({ file: tree.map.file });
const { sources: rootSources, map } = tree;
const rootNames = map.names;
const rootMappings = (0, import_trace_mapping.decodedMappings)(map);
for (let i = 0; i < rootMappings.length; i++) {
const segments = rootMappings[i];
for (let j = 0; j < segments.length; j++) {
const segment = segments[j];
const genCol = segment[0];
let traced = SOURCELESS_MAPPING;
if (segment.length !== 1) {
const source2 = rootSources[segment[1]];
traced = originalPositionFor(
source2,
segment[2],
segment[3],
segment.length === 5 ? rootNames[segment[4]] : ""
);
if (traced == null) continue;
}
const { column, line, name, content, source, ignore } = traced;
(0, import_gen_mapping.maybeAddSegment)(gen, i, genCol, source, line, column, name);
if (source && content != null) (0, import_gen_mapping.setSourceContent)(gen, source, content);
if (ignore) (0, import_gen_mapping.setIgnore)(gen, source, true);
}
}
return gen;
}
function originalPositionFor(source, line, column, name) {
if (!source.map) {
return SegmentObject(source.source, line, column, name, source.content, source.ignore);
}
const segment = (0, import_trace_mapping.traceSegment)(source.map, line, column);
if (segment == null) return null;
if (segment.length === 1) return SOURCELESS_MAPPING;
return originalPositionFor(
source.sources[segment[1]],
segment[2],
segment[3],
segment.length === 5 ? source.map.names[segment[4]] : name
);
}
// src/build-source-map-tree.ts
function asArray(value) {
if (Array.isArray(value)) return value;
return [value];
}
function buildSourceMapTree(input, loader) {
const maps = asArray(input).map((m) => new import_trace_mapping2.TraceMap(m, ""));
const map = maps.pop();
for (let i = 0; i < maps.length; i++) {
if (maps[i].sources.length > 1) {
throw new Error(
`Transformation map ${i} must have exactly one source file.
Did you specify these with the most recent transformation maps first?`
);
}
}
let tree = build(map, loader, "", 0);
for (let i = maps.length - 1; i >= 0; i--) {
tree = MapSource(maps[i], [tree]);
}
return tree;
}
function build(map, loader, importer, importerDepth) {
const { resolvedSources, sourcesContent, ignoreList } = map;
const depth = importerDepth + 1;
const children = resolvedSources.map((sourceFile, i) => {
const ctx = {
importer,
depth,
source: sourceFile || "",
content: void 0,
ignore: void 0
};
const sourceMap = loader(ctx.source, ctx);
const { source, content, ignore } = ctx;
if (sourceMap) return build(new import_trace_mapping2.TraceMap(sourceMap, source), loader, source, depth);
const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null;
const ignored = ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false;
return OriginalSource(source, sourceContent, ignored);
});
return MapSource(map, children);
}
// src/source-map.ts
var import_gen_mapping2 = __toESM(require_gen_mapping());
var SourceMap = class {
constructor(map, options) {
const out = options.decodedMappings ? (0, import_gen_mapping2.toDecodedMap)(map) : (0, import_gen_mapping2.toEncodedMap)(map);
this.version = out.version;
this.file = out.file;
this.mappings = out.mappings;
this.names = out.names;
this.ignoreList = out.ignoreList;
this.sourceRoot = out.sourceRoot;
this.sources = out.sources;
if (!options.excludeContent) {
this.sourcesContent = out.sourcesContent;
}
}
toString() {
return JSON.stringify(this);
}
};
// src/remapping.ts
function remapping(input, loader, options) {
const opts = typeof options === "object" ? options : { excludeContent: !!options, decodedMappings: false };
const tree = buildSourceMapTree(input, loader);
return new SourceMap(traceMappings(tree), opts);
}
}));
//# sourceMappingURL=remapping.umd.js.map
@@ -0,0 +1,78 @@
import {
getDefaultOptions,
setDefaultOptions as setInternalDefaultOptions,
} from "./_lib/defaultOptions.js";
/**
* @name setDefaultOptions
* @category Common Helpers
* @summary Set default options including locale.
* @pure false
*
* @description
* Sets the defaults for
* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
* arguments for all functions.
*
* @param options - An object with options
*
* @example
* // Set global locale:
* import { es } from 'date-fns/locale'
* setDefaultOptions({ locale: es })
* const result = format(new Date(2014, 8, 2), 'PPPP')
* //=> 'martes, 2 de septiembre de 2014'
*
* @example
* // Start of the week for 2 September 2014:
* const result = startOfWeek(new Date(2014, 8, 2))
* //=> Sun Aug 31 2014 00:00:00
*
* @example
* // Start of the week for 2 September 2014,
* // when we set that week starts on Monday by default:
* setDefaultOptions({ weekStartsOn: 1 })
* const result = startOfWeek(new Date(2014, 8, 2))
* //=> Mon Sep 01 2014 00:00:00
*
* @example
* // Manually set options take priority over default options:
* setDefaultOptions({ weekStartsOn: 1 })
* const result = startOfWeek(new Date(2014, 8, 2), { weekStartsOn: 0 })
* //=> Sun Aug 31 2014 00:00:00
*
* @example
* // Remove the option by setting it to `undefined`:
* setDefaultOptions({ weekStartsOn: 1 })
* setDefaultOptions({ weekStartsOn: undefined })
* const result = startOfWeek(new Date(2014, 8, 2))
* //=> Sun Aug 31 2014 00:00:00
*/
export function setDefaultOptions(options) {
const result = {};
const defaultOptions = getDefaultOptions();
for (const property in defaultOptions) {
if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) {
// [TODO] I challenge you to fix the type
result[property] = defaultOptions[property];
}
}
for (const property in options) {
if (Object.prototype.hasOwnProperty.call(options, property)) {
if (options[property] === undefined) {
// [TODO] I challenge you to fix the type
delete result[property];
} else {
// [TODO] I challenge you to fix the type
result[property] = options[property];
}
}
}
setInternalDefaultOptions(result);
}
// Fallback for modularized imports:
export default setDefaultOptions;

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