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

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

View File

@@ -0,0 +1,45 @@
'use strict'
module.exports = filterLog
const { createCopier } = require('fast-copy')
const fastCopy = createCopier({})
const deleteLogProperty = require('./delete-log-property')
/**
* @typedef {object} FilterLogParams
* @property {object} log The log object to be modified.
* @property {PrettyContext} context The context object built from parsing
* the options.
*/
/**
* Filter a log object by removing or including keys accordingly.
* When `includeKeys` is passed, `ignoredKeys` will be ignored.
* One of ignoreKeys or includeKeys must be pass in.
*
* @param {FilterLogParams} input
*
* @returns {object} A new `log` object instance that
* either only includes the keys in ignoreKeys
* or does not include those in ignoredKeys.
*/
function filterLog ({ log, context }) {
const { ignoreKeys, includeKeys } = context
const logCopy = fastCopy(log)
if (includeKeys) {
const logIncluded = {}
includeKeys.forEach((key) => {
logIncluded[key] = logCopy[key]
})
return logIncluded
}
ignoreKeys.forEach((ignoreKey) => {
deleteLogProperty(logCopy, ignoreKey)
})
return logCopy
}

View File

@@ -0,0 +1,55 @@
"use strict";
exports.parseJSON = parseJSON; /**
* @name parseJSON
* @category Common Helpers
* @summary Parse a JSON date string
*
* @description
* Converts a complete ISO date string in UTC time, the typical format for transmitting
* a date in JSON, to a JavaScript `Date` instance.
*
* This is a minimal implementation for converting dates retrieved from a JSON API to
* a `Date` instance which can be used with other functions in the `date-fns` library.
* The following formats are supported:
*
* - `2000-03-15T05:20:10.123Z`: The output of `.toISOString()` and `JSON.stringify(new Date())`
* - `2000-03-15T05:20:10Z`: Without milliseconds
* - `2000-03-15T05:20:10+00:00`: With a zero offset, the default JSON encoded format in some other languages
* - `2000-03-15T05:20:10+05:45`: With a positive or negative offset, the default JSON encoded format in some other languages
* - `2000-03-15T05:20:10+0000`: With a zero offset without a colon
* - `2000-03-15T05:20:10`: Without a trailing 'Z' symbol
* - `2000-03-15T05:20:10.1234567`: Up to 7 digits in milliseconds field. Only first 3 are taken into account since JS does not allow fractional milliseconds
* - `2000-03-15 05:20:10`: With a space instead of a 'T' separator for APIs returning a SQL date without reformatting
*
* For convenience and ease of use these other input types are also supported
* via [toDate](https://date-fns.org/docs/toDate):
*
* - A `Date` instance will be cloned
* - A `number` will be treated as a timestamp
*
* Any other input type or invalid date strings will return an `Invalid Date`.
*
* @param dateStr - A fully formed ISO8601 date string to convert
*
* @returns The parsed date in the local time zone
*/
function parseJSON(dateStr) {
const parts = dateStr.match(
/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/,
);
if (parts) {
// Group 8 matches the sign
return new Date(
Date.UTC(
+parts[1],
+parts[2] - 1,
+parts[3],
+parts[4] - (+parts[9] || 0) * (parts[8] == "-" ? -1 : 1),
+parts[5] - (+parts[10] || 0) * (parts[8] == "-" ? -1 : 1),
+parts[6],
+((parts[7] || "0") + "00").substring(0, 3),
),
);
}
return new Date(NaN);
}

View File

@@ -0,0 +1,39 @@
import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from "./common.js";
class MySqlRealBuilder extends MySqlColumnBuilderWithAutoIncrement {
static [entityKind] = "MySqlRealBuilder";
constructor(name, config) {
super(name, "number", "MySqlReal");
this.config.precision = config?.precision;
this.config.scale = config?.scale;
}
/** @internal */
build(table) {
return new MySqlReal(table, this.config);
}
}
class MySqlReal extends MySqlColumnWithAutoIncrement {
static [entityKind] = "MySqlReal";
precision = this.config.precision;
scale = this.config.scale;
getSQLType() {
if (this.precision !== void 0 && this.scale !== void 0) {
return `real(${this.precision}, ${this.scale})`;
} else if (this.precision === void 0) {
return "real";
} else {
return `real(${this.precision})`;
}
}
}
function real(a, b = {}) {
const { name, config } = getColumnNameAndConfig(a, b);
return new MySqlRealBuilder(name, config);
}
export {
MySqlReal,
MySqlRealBuilder,
real
};
//# sourceMappingURL=real.js.map

View File

@@ -0,0 +1,339 @@
import { getClient } from '../../currentScopes.js';
import { captureException } from '../../exports.js';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes.js';
import { SPAN_STATUS_ERROR } from '../spanstatus.js';
import { startSpan, startSpanManual } from '../trace.js';
import { handleCallbackErrors } from '../../utils/handleCallbackErrors.js';
import { GEN_AI_OPERATION_NAME_ATTRIBUTE, GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE, GEN_AI_REQUEST_MODEL_ATTRIBUTE, GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE, GEN_AI_REQUEST_TOP_P_ATTRIBUTE, GEN_AI_REQUEST_STREAM_ATTRIBUTE, GEN_AI_REQUEST_TOP_K_ATTRIBUTE, GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE, GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE, GEN_AI_PROMPT_ATTRIBUTE, GEN_AI_SYSTEM_ATTRIBUTE, GEN_AI_RESPONSE_TEXT_ATTRIBUTE, GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, GEN_AI_RESPONSE_MODEL_ATTRIBUTE, GEN_AI_RESPONSE_ID_ATTRIBUTE, ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE } from '../ai/gen-ai-attributes.js';
import { getFinalOperationName, getSpanOperation, setTokenUsageAttributes, buildMethodPath } from '../ai/utils.js';
import { instrumentAsyncIterableStream, instrumentMessageStream } from './streaming.js';
import { shouldInstrument, messagesFromParams, setMessagesAttribute, handleResponseError } from './utils.js';
/**
* Extract request attributes from method arguments
*/
function extractRequestAttributes(args, methodPath) {
const attributes = {
[GEN_AI_SYSTEM_ATTRIBUTE]: 'anthropic',
[GEN_AI_OPERATION_NAME_ATTRIBUTE]: getFinalOperationName(methodPath),
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.anthropic',
};
if (args.length > 0 && typeof args[0] === 'object' && args[0] !== null) {
const params = args[0] ;
if (params.tools && Array.isArray(params.tools)) {
attributes[GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE] = JSON.stringify(params.tools);
}
attributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE] = params.model ?? 'unknown';
if ('temperature' in params) attributes[GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE] = params.temperature;
if ('top_p' in params) attributes[GEN_AI_REQUEST_TOP_P_ATTRIBUTE] = params.top_p;
if ('stream' in params) attributes[GEN_AI_REQUEST_STREAM_ATTRIBUTE] = params.stream;
if ('top_k' in params) attributes[GEN_AI_REQUEST_TOP_K_ATTRIBUTE] = params.top_k;
if ('frequency_penalty' in params)
attributes[GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE] = params.frequency_penalty;
if ('max_tokens' in params) attributes[GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE] = params.max_tokens;
} else {
if (methodPath === 'models.retrieve' || methodPath === 'models.get') {
// models.retrieve(model-id) and models.get(model-id)
attributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE] = args[0];
} else {
attributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE] = 'unknown';
}
}
return attributes;
}
/**
* Add private request attributes to spans.
* This is only recorded if recordInputs is true.
*/
function addPrivateRequestAttributes(span, params) {
const messages = messagesFromParams(params);
setMessagesAttribute(span, messages);
if ('prompt' in params) {
span.setAttributes({ [GEN_AI_PROMPT_ATTRIBUTE]: JSON.stringify(params.prompt) });
}
}
/**
* Add content attributes when recordOutputs is enabled
*/
function addContentAttributes(span, response) {
// Messages.create
if ('content' in response) {
if (Array.isArray(response.content)) {
span.setAttributes({
[GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: response.content
.map((item) => item.text)
.filter(text => !!text)
.join(''),
});
const toolCalls = [];
for (const item of response.content) {
if (item.type === 'tool_use' || item.type === 'server_tool_use') {
toolCalls.push(item);
}
}
if (toolCalls.length > 0) {
span.setAttributes({ [GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]: JSON.stringify(toolCalls) });
}
}
}
// Completions.create
if ('completion' in response) {
span.setAttributes({ [GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: response.completion });
}
// Models.countTokens
if ('input_tokens' in response) {
span.setAttributes({ [GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: JSON.stringify(response.input_tokens) });
}
}
/**
* Add basic metadata attributes from the response
*/
function addMetadataAttributes(span, response) {
if ('id' in response && 'model' in response) {
span.setAttributes({
[GEN_AI_RESPONSE_ID_ATTRIBUTE]: response.id,
[GEN_AI_RESPONSE_MODEL_ATTRIBUTE]: response.model,
});
if ('created' in response && typeof response.created === 'number') {
span.setAttributes({
[ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE]: new Date(response.created * 1000).toISOString(),
});
}
if ('created_at' in response && typeof response.created_at === 'number') {
span.setAttributes({
[ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE]: new Date(response.created_at * 1000).toISOString(),
});
}
if ('usage' in response && response.usage) {
setTokenUsageAttributes(
span,
response.usage.input_tokens,
response.usage.output_tokens,
response.usage.cache_creation_input_tokens,
response.usage.cache_read_input_tokens,
);
}
}
}
/**
* Add response attributes to spans
*/
function addResponseAttributes(span, response, recordOutputs) {
if (!response || typeof response !== 'object') return;
// capture error, do not add attributes if error (they shouldn't exist)
if ('type' in response && response.type === 'error') {
handleResponseError(span, response);
return;
}
// Private response attributes that are only recorded if recordOutputs is true.
if (recordOutputs) {
addContentAttributes(span, response);
}
// Add basic metadata attributes
addMetadataAttributes(span, response);
}
/**
* Handle common error catching and reporting for streaming requests
*/
function handleStreamingError(error, span, methodPath) {
captureException(error, {
mechanism: { handled: false, type: 'auto.ai.anthropic', data: { function: methodPath } },
});
if (span.isRecording()) {
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
span.end();
}
throw error;
}
/**
* Handle streaming cases with common logic
*/
function handleStreamingRequest(
originalMethod,
target,
context,
args,
requestAttributes,
operationName,
methodPath,
params,
options,
isStreamRequested,
isStreamingMethod,
) {
const model = requestAttributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE] ?? 'unknown';
const spanConfig = {
name: `${operationName} ${model} stream-response`,
op: getSpanOperation(methodPath),
attributes: requestAttributes ,
};
// messages.stream() always returns a sync MessageStream, even with stream: true param
if (isStreamRequested && !isStreamingMethod) {
return startSpanManual(spanConfig, async span => {
try {
if (options.recordInputs && params) {
addPrivateRequestAttributes(span, params);
}
const result = await originalMethod.apply(context, args);
return instrumentAsyncIterableStream(
result ,
span,
options.recordOutputs ?? false,
) ;
} catch (error) {
return handleStreamingError(error, span, methodPath);
}
});
} else {
return startSpanManual(spanConfig, span => {
try {
if (options.recordInputs && params) {
addPrivateRequestAttributes(span, params);
}
const messageStream = target.apply(context, args);
return instrumentMessageStream(messageStream, span, options.recordOutputs ?? false);
} catch (error) {
return handleStreamingError(error, span, methodPath);
}
});
}
}
/**
* Instrument a method with Sentry spans
* Following Sentry AI Agents Manual Instrumentation conventions
* @see https://docs.sentry.io/platforms/javascript/guides/node/tracing/instrumentation/ai-agents-module/#manual-instrumentation
*/
function instrumentMethod(
originalMethod,
methodPath,
context,
options,
) {
return new Proxy(originalMethod, {
apply(target, thisArg, args) {
const requestAttributes = extractRequestAttributes(args, methodPath);
const model = requestAttributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE] ?? 'unknown';
const operationName = getFinalOperationName(methodPath);
const params = typeof args[0] === 'object' ? (args[0] ) : undefined;
const isStreamRequested = Boolean(params?.stream);
const isStreamingMethod = methodPath === 'messages.stream';
if (isStreamRequested || isStreamingMethod) {
return handleStreamingRequest(
originalMethod,
target,
context,
args,
requestAttributes,
operationName,
methodPath,
params,
options,
isStreamRequested,
isStreamingMethod,
);
}
return startSpan(
{
name: `${operationName} ${model}`,
op: getSpanOperation(methodPath),
attributes: requestAttributes ,
},
span => {
if (options.recordInputs && params) {
addPrivateRequestAttributes(span, params);
}
return handleCallbackErrors(
() => target.apply(context, args),
error => {
captureException(error, {
mechanism: {
handled: false,
type: 'auto.ai.anthropic',
data: {
function: methodPath,
},
},
});
},
() => {},
result => addResponseAttributes(span, result , options.recordOutputs),
);
},
);
},
}) ;
}
/**
* Create a deep proxy for Anthropic AI client instrumentation
*/
function createDeepProxy(target, currentPath = '', options) {
return new Proxy(target, {
get(obj, prop) {
const value = (obj )[prop];
const methodPath = buildMethodPath(currentPath, String(prop));
if (typeof value === 'function' && shouldInstrument(methodPath)) {
return instrumentMethod(value , methodPath, obj, options);
}
if (typeof value === 'function') {
// Bind non-instrumented functions to preserve the original `this` context,
return value.bind(obj);
}
if (value && typeof value === 'object') {
return createDeepProxy(value, methodPath, options);
}
return value;
},
}) ;
}
/**
* Instrument an Anthropic AI client with Sentry tracing
* Can be used across Node.js, Cloudflare Workers, and Vercel Edge
*
* @template T - The type of the client that extends object
* @param client - The Anthropic AI client to instrument
* @param options - Optional configuration for recording inputs and outputs
* @returns The instrumented client with the same type as the input
*/
function instrumentAnthropicAiClient(anthropicAiClient, options) {
const sendDefaultPii = Boolean(getClient()?.getOptions().sendDefaultPii);
const _options = {
recordInputs: sendDefaultPii,
recordOutputs: sendDefaultPii,
...options,
};
return createDeepProxy(anthropicAiClient, '', _options);
}
export { instrumentAnthropicAiClient };
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,11 @@
/**
* 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'
const LexicalLink = process.env.NODE_ENV !== 'production' ? require('./LexicalLink.dev.js') : require('./LexicalLink.prod.js');
module.exports = LexicalLink;

View File

@@ -0,0 +1,31 @@
import type { ColumnBuilderBaseConfig, GeneratedColumnConfig, HasGenerated } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import type { SQL } from "../../sql/index.js";
import { type Writable } from "../../utils.js";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
export type SingleStoreEnumColumnBuilderInitial<TName extends string, TEnum extends [string, ...string[]]> = SingleStoreEnumColumnBuilder<{
name: TName;
dataType: 'string';
columnType: 'SingleStoreEnumColumn';
data: TEnum[number];
driverParam: string;
enumValues: TEnum;
generated: undefined;
}>;
export declare class SingleStoreEnumColumnBuilder<T extends ColumnBuilderBaseConfig<'string', 'SingleStoreEnumColumn'>> extends SingleStoreColumnBuilder<T, {
enumValues: T['enumValues'];
}> {
generatedAlwaysAs(as: SQL<unknown> | (() => SQL) | T['data'], config?: Partial<GeneratedColumnConfig<unknown>>): HasGenerated<this, {}>;
static readonly [entityKind]: string;
constructor(name: T['name'], values: T['enumValues']);
}
export declare class SingleStoreEnumColumn<T extends ColumnBaseConfig<'string', 'SingleStoreEnumColumn'>> extends SingleStoreColumn<T, {
enumValues: T['enumValues'];
}> {
static readonly [entityKind]: string;
readonly enumValues: T["enumValues"];
getSQLType(): string;
}
export declare function singlestoreEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T | Writable<T>): SingleStoreEnumColumnBuilderInitial<'', Writable<T>>;
export declare function singlestoreEnum<TName extends string, U extends string, T extends Readonly<[U, ...U[]]>>(name: TName, values: T | Writable<T>): SingleStoreEnumColumnBuilderInitial<TName, Writable<T>>;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O 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"},C:{"1":"0 1 2 3 4 5 6 7 8 BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"9 0C VC J bB K D E F A B C L M G N O P cB AB 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 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 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"},E:{"1":"A B C L M G 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 F 6C bC 7C 8C 9C AD"},F:{"1":"0 1 2 3 4 5 6 7 8 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 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 JD KD LD MD PC xC ND QC"},G:{"1":"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 TD UD"},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 tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:6,C:"Arrow functions",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"file":"space.js","sources":["../../../src/icons/space.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Space\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjIgMTd2MWMwIC41LS41IDEtMSAxSDNjLS41IDAtMS0uNS0xLTF2LTEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/space\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 Space = createLucideIcon('Space', [\n ['path', { d: 'M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1', key: 'lt2kga' }],\n]);\n\nexport default Space;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,4 @@
import type { UrlObject } from 'url';
export declare function urlQueryToSearchParams(urlQuery: UrlObject['query']): URLSearchParams;
export declare function formatUrl(urlObj: UrlObject): string;
//# sourceMappingURL=formatUrl.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../../src/fields/baseFields/slug/countVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,cAAc,EAEf,MAAM,mBAAmB,CAAA;AAE1B;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAAgB;IACxC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,qBAAqB,CAAA;IAChC,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,OAAO,CAAC,MAAM,CA8BjB,CAAA"}

View File

@@ -0,0 +1,758 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
const empty = z.templateLiteral([]);
const hello = z.templateLiteral(["hello"]);
const world = z.templateLiteral(["", z.literal("world")]);
const one = z.templateLiteral([1]);
const two = z.templateLiteral(["", z.literal(2)]);
const truee = z.templateLiteral([true]);
const anotherTrue = z.templateLiteral(["", z.literal(true)]);
const falsee = z.templateLiteral([false]);
const anotherFalse = z.templateLiteral(["", z.literal(false)]);
const nulll = z.templateLiteral([null]);
const anotherNull = z.templateLiteral(["", z.null()]);
const undefinedd = z.templateLiteral([undefined]);
const anotherUndefined = z.templateLiteral(["", z.undefined()]);
const anyString = z.templateLiteral(["", z.string()]);
const lazyString = z.templateLiteral(["", z.lazy(() => z.string())]);
const anyNumber = z.templateLiteral(["", z.number()]);
const anyInt = z.templateLiteral(["", z.number().int()]);
// const anyFiniteNumber = z.templateLiteral(["", z.number().finite()]);
// const anyNegativeNumber = z.templateLiteral(["", z.number().negative()]);
// const anyPositiveNumber = z.templateLiteral(["", z.number().positive()]);
// const zeroButInADumbWay = z.templateLiteral(["", z.number().nonnegative().nonpositive()]);
// const finiteButInADumbWay = z.templateLiteral(["", z.number().min(5).max(10)]);
const bool = z.templateLiteral(["", z.boolean()]);
const bigone = z.templateLiteral(["", z.literal(BigInt(1))]);
const anyBigint = z.templateLiteral(["", z.bigint()]);
const nullableYo = z.templateLiteral(["", z.nullable(z.literal("yo"))]);
const nullableString = z.templateLiteral(["", z.nullable(z.string())]);
const optionalYeah = z.templateLiteral(["", z.literal("yeah").optional()]);
const optionalString = z.templateLiteral(["", z.string().optional()]);
const optionalNumber = z.templateLiteral(["", z.number().optional()]);
const nullishBruh = z.templateLiteral(["", z.literal("bruh").nullish()]);
const nullishString = z.templateLiteral(["", z.string().nullish()]);
const cuid = z.templateLiteral(["", z.string().cuid()]);
const cuidZZZ = z.templateLiteral(["", z.string().cuid(), "ZZZ"]);
const cuid2 = z.templateLiteral(["", z.string().cuid2()]);
const datetime = z.templateLiteral(["", z.string().datetime()]);
const email = z.templateLiteral(["", z.string().email()]);
// const ip = z.templateLiteral(["", z.string().ip()]);
const ipv4 = z.templateLiteral(["", z.string().ipv4()]);
const ipv6 = z.templateLiteral(["", z.string().ipv6()]);
const ulid = z.templateLiteral(["", z.string().ulid()]);
const uuid = z.templateLiteral(["", z.string().uuid()]);
const stringAToZ = z.templateLiteral(["", z.string().regex(/^[a-z]+$/)]);
const stringStartsWith = z.templateLiteral(["", z.string().startsWith("hello")]);
const stringEndsWith = z.templateLiteral(["", z.string().endsWith("world")]);
const stringMax5 = z.templateLiteral(["", z.string().max(5)]);
const stringMin5 = z.templateLiteral(["", z.string().min(5)]);
const stringLen5 = z.templateLiteral(["", z.string().length(5)]);
const stringMin5Max10 = z.templateLiteral(["", z.string().min(5).max(10)]);
const stringStartsWithMax5 = z.templateLiteral(["", z.string().startsWith("hello").max(5)]);
const brandedString = z.templateLiteral(["", z.string().min(1).brand("myBrand")]);
// const anything = z.templateLiteral(["", z.any()]);
const url = z.templateLiteral(["https://", z.string().regex(/\w+/), ".", z.enum(["com", "net"])]);
const measurement = z.templateLiteral([
"",
z.number().finite(),
z.enum(["px", "em", "rem", "vh", "vw", "vmin", "vmax"]).optional(),
]);
const connectionString = z.templateLiteral([
"mongodb://",
z
.templateLiteral([
"",
z.string().regex(/\w+/).describe("username"),
":",
z.string().regex(/\w+/).describe("password"),
"@",
])
.optional(),
z.string().regex(/\w+/).describe("host"),
":",
z.number().finite().int().positive().describe("port"),
z
.templateLiteral([
"/",
z.string().regex(/\w+/).optional().describe("defaultauthdb"),
z
.templateLiteral([
"?",
z
.string()
.regex(/^\w+=\w+(&\w+=\w+)*$/)
.optional()
.describe("options"),
])
.optional(),
])
.optional(),
]);
test("template literal type inference", () => {
expectTypeOf<z.infer<typeof empty>>().toEqualTypeOf<``>();
expectTypeOf<z.infer<typeof hello>>().toEqualTypeOf<`hello`>();
expectTypeOf<z.infer<typeof world>>().toEqualTypeOf<`world`>();
expectTypeOf<z.infer<typeof one>>().toEqualTypeOf<`1`>();
expectTypeOf<z.infer<typeof two>>().toEqualTypeOf<`2`>();
expectTypeOf<z.infer<typeof truee>>().toEqualTypeOf<`true`>();
expectTypeOf<z.infer<typeof anotherTrue>>().toEqualTypeOf<`true`>();
expectTypeOf<z.infer<typeof falsee>>().toEqualTypeOf<`false`>();
expectTypeOf<z.infer<typeof anotherFalse>>().toEqualTypeOf<`false`>();
expectTypeOf<z.infer<typeof nulll>>().toEqualTypeOf<`null`>();
expectTypeOf<z.infer<typeof anotherNull>>().toEqualTypeOf<`null`>();
expectTypeOf<z.infer<typeof undefinedd>>().toEqualTypeOf<``>();
expectTypeOf<z.infer<typeof anotherUndefined>>().toEqualTypeOf<``>();
expectTypeOf<z.infer<typeof anyString>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof lazyString>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof anyNumber>>().toEqualTypeOf<`${number}`>();
expectTypeOf<z.infer<typeof anyInt>>().toEqualTypeOf<`${number}`>();
// expectTypeOf<z.infer<typeof anyFiniteNumber>>().toEqualTypeOf<`${number}`>();
// expectTypeOf<z.infer<typeof anyNegativeNumber>>().toEqualTypeOf<`${number}`>();
// expectTypeOf<z.infer<typeof anyPositiveNumber>>().toEqualTypeOf<`${number}`>();
// expectTypeOf<z.infer<typeof zeroButInADumbWay>>().toEqualTypeOf<`${number}`>();
// expectTypeOf<z.infer<typeof finiteButInADumbWay>>().toEqualTypeOf<`${number}`>();
expectTypeOf<z.infer<typeof bool>>().toEqualTypeOf<`true` | `false`>();
expectTypeOf<z.infer<typeof bigone>>().toEqualTypeOf<`${bigint}`>();
expectTypeOf<z.infer<typeof anyBigint>>().toEqualTypeOf<`${bigint}`>();
expectTypeOf<z.infer<typeof nullableYo>>().toEqualTypeOf<`yo` | `null`>();
expectTypeOf<z.infer<typeof nullableString>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof optionalYeah>>().toEqualTypeOf<`yeah` | ``>();
expectTypeOf<z.infer<typeof optionalString>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof optionalNumber>>().toEqualTypeOf<`${number}` | ``>();
expectTypeOf<z.infer<typeof nullishBruh>>().toEqualTypeOf<`bruh` | `null` | ``>();
expectTypeOf<z.infer<typeof nullishString>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof cuid>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof cuidZZZ>>().toEqualTypeOf<`${string}ZZZ`>();
expectTypeOf<z.infer<typeof cuid2>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof datetime>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof email>>().toEqualTypeOf<string>();
// expectTypeOf<z.infer<typeof ip>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof ipv4>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof ipv6>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof ulid>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof uuid>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof stringAToZ>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof stringStartsWith>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof stringEndsWith>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof stringMax5>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof stringMin5>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof stringLen5>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof stringMin5Max10>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof stringStartsWithMax5>>().toEqualTypeOf<string>();
expectTypeOf<z.infer<typeof brandedString>>().toEqualTypeOf<`${string & z.core.$brand<"myBrand">}`>();
// expectTypeOf<z.infer<typeof anything>>().toEqualTypeOf<`${any}`>();
expectTypeOf<z.infer<typeof url>>().toEqualTypeOf<`https://${string}.com` | `https://${string}.net`>();
expectTypeOf<z.infer<typeof measurement>>().toEqualTypeOf<
| `${number}`
| `${number}px`
| `${number}em`
| `${number}rem`
| `${number}vh`
| `${number}vw`
| `${number}vmin`
| `${number}vmax`
>();
expectTypeOf<z.infer<typeof connectionString>>().toEqualTypeOf<
| `mongodb://${string}:${number}`
| `mongodb://${string}:${number}/${string}`
| `mongodb://${string}:${number}/${string}?${string}`
| `mongodb://${string}:${string}@${string}:${number}`
| `mongodb://${string}:${string}@${string}:${number}/${string}`
| `mongodb://${string}:${string}@${string}:${number}/${string}?${string}`
>();
});
test("template literal unsupported args", () => {
expect(() =>
// @ts-expect-error
z.templateLiteral([z.object({})])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.array(z.object({}))])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.union([z.object({}), z.string()])])
).toThrow();
// @ts-expect-error
expect(() => z.templateLiteral([z.date()])).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.custom<object>((_) => true)])
).toThrow();
expect(() =>
z.templateLiteral([
// @ts-expect-error
z.discriminatedUnion("discriminator", [z.object({}), z.object({})]),
])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.function()])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.instanceof(class MyClass {})])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.intersection(z.object({}), z.object({}))])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.map(z.string(), z.string())])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.nullable(z.object({}))])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.optional(z.object({}))])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.promise()])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.record(z.unknown())])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.set(z.string())])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.symbol()])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.tuple([z.string()])])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.unknown()])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.void()])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.never()])
).toThrow();
// @ts-expect-error
expect(() => z.templateLiteral([z.nan()])).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.pipe(z.string(), z.string())])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.preprocess(() => true, z.boolean())])
).toThrow();
expect(() =>
// @ts-expect-error
z.templateLiteral([z.object({}).brand("brand")])
).toThrow();
// these constraints aren't enforced but they shouldn't throw
z.templateLiteral([z.number().multipleOf(2)]);
z.templateLiteral([z.string().emoji()]);
z.templateLiteral([z.string().url()]);
z.templateLiteral([z.string().url()]);
z.templateLiteral([z.string().trim()]);
z.templateLiteral([z.string().includes("train")]);
z.templateLiteral([z.string().toLowerCase()]);
z.templateLiteral([z.string().toUpperCase()]);
});
test("template literal parsing - success - basic cases", () => {
expect(() => z.templateLiteral([]).parse(7)).toThrow();
empty.parse("");
hello.parse("hello");
world.parse("world");
one.parse("1");
two.parse("2");
truee.parse("true");
anotherTrue.parse("true");
falsee.parse("false");
anotherFalse.parse("false");
nulll.parse("null");
anotherNull.parse("null");
undefinedd.parse("undefined");
anotherUndefined.parse("undefined");
anyString.parse("blahblahblah");
anyString.parse("");
lazyString.parse("blahblahblah");
lazyString.parse("");
anyNumber.parse("123");
anyNumber.parse("1.23");
anyNumber.parse("0");
anyNumber.parse("-1.23");
anyNumber.parse("-123");
// anyNumber.parse("Infinity");
// anyNumber.parse("-Infinity");
anyInt.parse("123");
// anyInt.parse("-123");
// anyFiniteNumber.parse("123");
// anyFiniteNumber.parse("1.23");
// anyFiniteNumber.parse("0");
// anyFiniteNumber.parse("-1.23");
// anyFiniteNumber.parse("-123");
// anyNegativeNumber.parse("-123");
// anyNegativeNumber.parse("-1.23");
// anyNegativeNumber.parse("-Infinity");
// anyPositiveNumber.parse("123");
// anyPositiveNumber.parse("1.23");
// anyPositiveNumber.parse("Infinity");
// zeroButInADumbWay.parse("0");
// zeroButInADumbWay.parse("00000");
// finiteButInADumbWay.parse("5");
// finiteButInADumbWay.parse("10");
// finiteButInADumbWay.parse("6.66");
bool.parse("true");
bool.parse("false");
bigone.parse("1");
anyBigint.parse("123456");
anyBigint.parse("0");
// anyBigint.parse("-123456");
nullableYo.parse("yo");
nullableYo.parse("null");
nullableString.parse("abc");
nullableString.parse("null");
optionalYeah.parse("yeah");
optionalYeah.parse("");
optionalString.parse("abc");
optionalString.parse("");
optionalNumber.parse("123");
optionalNumber.parse("1.23");
optionalNumber.parse("0");
optionalNumber.parse("-1.23");
optionalNumber.parse("-123");
// optionalNumber.parse("Infinity");
// optionalNumber.parse("-Infinity");
nullishBruh.parse("bruh");
nullishBruh.parse("null");
nullishBruh.parse("");
cuid.parse("cjld2cyuq0000t3rmniod1foy");
cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZZ");
cuid2.parse("tz4a98xxat96iws9zmbrgj3a");
datetime.parse(new Date().toISOString());
email.parse("info@example.com");
// ip.parse("213.174.246.205");
// ip.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452");
ipv4.parse("213.174.246.205");
ipv6.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452");
ulid.parse("01GW3D2QZJBYB6P1Z1AE997VPW");
uuid.parse("808989fd-3a6e-4af2-b607-737323a176f6");
stringAToZ.parse("asudgaskhdgashd");
stringStartsWith.parse("hello world");
stringEndsWith.parse("hello world");
stringMax5.parse("hello");
stringMin5.parse("hello");
stringLen5.parse("hello");
stringMin5Max10.parse("hello worl");
stringStartsWithMax5.parse("hello");
brandedString.parse("branded string");
});
test("template literal parsing - failure - basic cases", () => {
expect(() => empty.parse("a")).toThrow();
expect(() => hello.parse("hello!")).toThrow();
expect(() => hello.parse("!hello")).toThrow();
expect(() => world.parse("world!")).toThrow();
expect(() => world.parse("!world")).toThrow();
expect(() => one.parse("2")).toThrow();
expect(() => one.parse("12")).toThrow();
expect(() => one.parse("21")).toThrow();
expect(() => two.parse("1")).toThrow();
expect(() => two.parse("21")).toThrow();
expect(() => two.parse("12")).toThrow();
expect(() => truee.parse("false")).toThrow();
expect(() => truee.parse("1true")).toThrow();
expect(() => truee.parse("true1")).toThrow();
expect(() => anotherTrue.parse("false")).toThrow();
expect(() => anotherTrue.parse("1true")).toThrow();
expect(() => anotherTrue.parse("true1")).toThrow();
expect(() => falsee.parse("true")).toThrow();
expect(() => falsee.parse("1false")).toThrow();
expect(() => falsee.parse("false1")).toThrow();
expect(() => anotherFalse.parse("true")).toThrow();
expect(() => anotherFalse.parse("1false")).toThrow();
expect(() => anotherFalse.parse("false1")).toThrow();
expect(() => nulll.parse("123")).toThrow();
expect(() => nulll.parse("null1")).toThrow();
expect(() => nulll.parse("1null")).toThrow();
expect(() => anotherNull.parse("123")).toThrow();
expect(() => anotherNull.parse("null1")).toThrow();
expect(() => anotherNull.parse("1null")).toThrow();
expect(() => undefinedd.parse("123")).toThrow();
expect(() => undefinedd.parse("undefined1")).toThrow();
expect(() => undefinedd.parse("1undefined")).toThrow();
expect(() => anotherUndefined.parse("123")).toThrow();
expect(() => anotherUndefined.parse("undefined1")).toThrow();
expect(() => anotherUndefined.parse("1undefined")).toThrow();
expect(() => anyNumber.parse("2a")).toThrow();
expect(() => anyNumber.parse("a2")).toThrow();
expect(() => anyNumber.parse("-2a")).toThrow();
expect(() => anyNumber.parse("a-2")).toThrow();
expect(() => anyNumber.parse("2.5a")).toThrow();
expect(() => anyNumber.parse("a2.5")).toThrow();
expect(() => anyNumber.parse("Infinitya")).toThrow();
expect(() => anyNumber.parse("aInfinity")).toThrow();
expect(() => anyNumber.parse("-Infinitya")).toThrow();
expect(() => anyNumber.parse("a-Infinity")).toThrow();
expect(() => anyNumber.parse("2e5")).toThrow();
expect(() => anyNumber.parse("2e-5")).toThrow();
expect(() => anyNumber.parse("2e+5")).toThrow();
expect(() => anyNumber.parse("-2e5")).toThrow();
expect(() => anyNumber.parse("-2e-5")).toThrow();
expect(() => anyNumber.parse("-2e+5")).toThrow();
expect(() => anyNumber.parse("2.1e5")).toThrow();
expect(() => anyNumber.parse("2.1e-5")).toThrow();
expect(() => anyNumber.parse("2.1e+5")).toThrow();
expect(() => anyNumber.parse("-2.1e5")).toThrow();
expect(() => anyNumber.parse("-2.1e-5")).toThrow();
expect(() => anyNumber.parse("-2.1e+5")).toThrow();
expect(() => anyNumber.parse("-Infinity")).toThrow();
expect(() => anyNumber.parse("Infinity")).toThrow();
expect(() => anyInt.parse("1.23")).toThrow();
expect(() => anyInt.parse("-1.23")).toThrow();
expect(() => anyInt.parse("d1")).toThrow();
expect(() => anyInt.parse("1d")).toThrow();
// expect(() => anyFiniteNumber.parse("Infinity")).toThrow();
// expect(() => anyFiniteNumber.parse("-Infinity")).toThrow();
// expect(() => anyFiniteNumber.parse("123a")).toThrow();
// expect(() => anyFiniteNumber.parse("a123")).toThrow();
// expect(() => anyNegativeNumber.parse("0")).toThrow();
// expect(() => anyNegativeNumber.parse("1")).toThrow();
// expect(() => anyNegativeNumber.parse("Infinity")).toThrow();
// expect(() => anyPositiveNumber.parse("0")).toThrow();
// expect(() => anyPositiveNumber.parse("-1")).toThrow();
// expect(() => anyPositiveNumber.parse("-Infinity")).toThrow();
// expect(() => zeroButInADumbWay.parse("1")).toThrow();
// expect(() => zeroButInADumbWay.parse("-1")).toThrow();
// expect(() => finiteButInADumbWay.parse("Infinity")).toThrow();
// expect(() => finiteButInADumbWay.parse("-Infinity")).toThrow();
// expect(() => finiteButInADumbWay.parse("-5")).toThrow();
// expect(() => finiteButInADumbWay.parse("10a")).toThrow();
// expect(() => finiteButInADumbWay.parse("a10")).toThrow();
expect(() => bool.parse("123")).toThrow();
expect(() => bigone.parse("2")).toThrow();
expect(() => bigone.parse("c1")).toThrow();
expect(() => anyBigint.parse("1.23")).toThrow();
expect(() => anyBigint.parse("-1.23")).toThrow();
expect(() => anyBigint.parse("c123")).toThrow();
expect(() => nullableYo.parse("yo1")).toThrow();
expect(() => nullableYo.parse("1yo")).toThrow();
expect(() => nullableYo.parse("null1")).toThrow();
expect(() => nullableYo.parse("1null")).toThrow();
expect(() => optionalYeah.parse("yeah1")).toThrow();
expect(() => optionalYeah.parse("1yeah")).toThrow();
expect(() => optionalYeah.parse("undefined")).toThrow();
expect(() => optionalNumber.parse("123a")).toThrow();
expect(() => optionalNumber.parse("a123")).toThrow();
// expect(() => optionalNumber.parse("Infinitya")).toThrow();
// expect(() => optionalNumber.parse("aInfinity")).toThrow();
expect(() => nullishBruh.parse("bruh1")).toThrow();
expect(() => nullishBruh.parse("1bruh")).toThrow();
expect(() => nullishBruh.parse("null1")).toThrow();
expect(() => nullishBruh.parse("1null")).toThrow();
expect(() => nullishBruh.parse("undefined")).toThrow();
expect(() => cuid.parse("bjld2cyuq0000t3rmniod1foy")).toThrow();
expect(() => cuid.parse("cjld2cyu")).toThrow();
expect(() => cuid.parse("cjld2 cyu")).toThrow();
expect(() => cuid.parse("cjld2cyuq0000t3rmniod1foy ")).toThrow();
expect(() => cuid.parse("1cjld2cyuq0000t3rmniod1foy")).toThrow();
expect(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foy")).toThrow();
expect(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZY")).toThrow();
expect(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZZ1")).toThrow();
expect(() => cuidZZZ.parse("1cjld2cyuq0000t3rmniod1foyZZZ")).toThrow();
expect(() => cuid2.parse("A9z4a98xxat96iws9zmbrgj3a")).toThrow();
expect(() => cuid2.parse("tz4a98xxat96iws9zmbrgj3!")).toThrow();
expect(() => datetime.parse("2022-01-01 00:00:00")).toThrow();
expect(() => email.parse("info@example.com@")).toThrow();
// expect(() => ip.parse("213.174.246:205")).toThrow();
// expect(() => ip.parse("c359.f57c:21e5:39eb:1187:e501:f936:b452")).toThrow();
expect(() => ipv4.parse("1213.174.246.205")).toThrow();
expect(() => ipv4.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452")).toThrow();
expect(() => ipv6.parse("c359:f57c:21e5:39eb:1187:e501:f936:b4521")).toThrow();
expect(() => ipv6.parse("213.174.246.205")).toThrow();
expect(() => ulid.parse("01GW3D2QZJBYB6P1Z1AE997VPW!")).toThrow();
expect(() => uuid.parse("808989fd-3a6e-4af2-b607-737323a176f6Z")).toThrow();
expect(() => uuid.parse("Z808989fd-3a6e-4af2-b607-737323a176f6")).toThrow();
expect(() => stringAToZ.parse("asdasdasd1")).toThrow();
expect(() => stringAToZ.parse("1asdasdasd")).toThrow();
expect(() => stringStartsWith.parse("ahello")).toThrow();
expect(() => stringEndsWith.parse("worlda")).toThrow();
expect(() => stringMax5.parse("123456")).toThrow();
expect(() => stringMin5.parse("1234")).toThrow();
expect(() => stringLen5.parse("123456")).toThrow();
expect(() => stringLen5.parse("1234")).toThrow();
expect(() => stringMin5Max10.parse("1234")).toThrow();
expect(() => stringMin5Max10.parse("12345678901")).toThrow();
// the "startswith" overrides the max length
// expect(() => stringStartsWithMax5.parse("hello1")).toThrow();
expect(() => stringStartsWithMax5.parse("1hell")).toThrow();
expect(() => brandedString.parse("")).toThrow();
});
test("regexes", () => {
expect(empty._zod.pattern.source).toMatchInlineSnapshot(`"^$"`);
expect(hello._zod.pattern.source).toMatchInlineSnapshot(`"^hello$"`);
expect(world._zod.pattern.source).toMatchInlineSnapshot(`"^(world)$"`);
expect(one._zod.pattern.source).toMatchInlineSnapshot(`"^1$"`);
expect(two._zod.pattern.source).toMatchInlineSnapshot(`"^(2)$"`);
expect(truee._zod.pattern.source).toMatchInlineSnapshot(`"^true$"`);
expect(anotherTrue._zod.pattern.source).toMatchInlineSnapshot(`"^(true)$"`);
expect(falsee._zod.pattern.source).toMatchInlineSnapshot(`"^false$"`);
expect(anotherFalse._zod.pattern.source).toMatchInlineSnapshot(`"^(false)$"`);
expect(nulll._zod.pattern.source).toMatchInlineSnapshot(`"^null$"`);
expect(anotherNull._zod.pattern.source).toMatchInlineSnapshot(`"^null$"`);
expect(undefinedd._zod.pattern.source).toMatchInlineSnapshot(`"^undefined$"`);
expect(anotherUndefined._zod.pattern.source).toMatchInlineSnapshot(`"^undefined$"`);
expect(anyString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,}$"`);
expect(lazyString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,}$"`);
expect(anyNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
expect(anyInt._zod.pattern.source).toMatchInlineSnapshot(`"^\\d+$"`);
// expect(anyFiniteNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
// expect(anyNegativeNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
// expect(anyPositiveNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
// expect(zeroButInADumbWay._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
// expect(finiteButInADumbWay._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
expect(bool._zod.pattern.source).toMatchInlineSnapshot(`"^true|false$"`);
expect(bigone._zod.pattern.source).toMatchInlineSnapshot(`"^(1)$"`);
expect(anyBigint._zod.pattern.source).toMatchInlineSnapshot(`"^\\d+n?$"`);
expect(nullableYo._zod.pattern.source).toMatchInlineSnapshot(`"^((yo)|null)$"`);
expect(nullableString._zod.pattern.source).toMatchInlineSnapshot(`"^([\\s\\S]{0,}|null)$"`);
expect(optionalYeah._zod.pattern.source).toMatchInlineSnapshot(`"^((yeah))?$"`);
expect(optionalString._zod.pattern.source).toMatchInlineSnapshot(`"^([\\s\\S]{0,})?$"`);
expect(optionalNumber._zod.pattern.source).toMatchInlineSnapshot(`"^(-?\\d+(?:\\.\\d+)?)?$"`);
expect(nullishBruh._zod.pattern.source).toMatchInlineSnapshot(`"^(((bruh)|null))?$"`);
expect(nullishString._zod.pattern.source).toMatchInlineSnapshot(`"^(([\\s\\S]{0,}|null))?$"`);
expect(cuid._zod.pattern.source).toMatchInlineSnapshot(`"^[cC][^\\s-]{8,}$"`);
expect(cuidZZZ._zod.pattern.source).toMatchInlineSnapshot(`"^[cC][^\\s-]{8,}ZZZ$"`);
expect(cuid2._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9a-z]+$"`);
expect(datetime._zod.pattern.source).toMatchInlineSnapshot(
`"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"`
);
expect(email._zod.pattern.source).toMatchInlineSnapshot(
`"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"`
);
// expect(ip._zod.pattern.source).toMatchInlineSnapshot(
// `"^(^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$)|(^(([a-fA-F0-9]{1,4}:){7}|::([a-fA-F0-9]{1,4}:){0,6}|([a-fA-F0-9]{1,4}:){1}:([a-fA-F0-9]{1,4}:){0,5}|([a-fA-F0-9]{1,4}:){2}:([a-fA-F0-9]{1,4}:){0,4}|([a-fA-F0-9]{1,4}:){3}:([a-fA-F0-9]{1,4}:){0,3}|([a-fA-F0-9]{1,4}:){4}:([a-fA-F0-9]{1,4}:){0,2}|([a-fA-F0-9]{1,4}:){5}:([a-fA-F0-9]{1,4}:){0,1})([a-fA-F0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$)$"`
// );
expect(ipv4._zod.pattern.source).toMatchInlineSnapshot(
`"^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$"`
);
expect(ipv6._zod.pattern.source).toMatchInlineSnapshot(
`"^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$"`
);
expect(ulid._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"`);
expect(uuid._zod.pattern.source).toMatchInlineSnapshot(
`"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"`
);
expect(stringAToZ._zod.pattern.source).toMatchInlineSnapshot(`"^[a-z]+$"`);
expect(stringStartsWith._zod.pattern.source).toMatchInlineSnapshot(`"^hello.*$"`);
expect(stringEndsWith._zod.pattern.source).toMatchInlineSnapshot(`"^.*world$"`);
expect(stringMax5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,5}$"`);
expect(stringMin5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,}$"`);
expect(stringLen5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,5}$"`);
expect(stringMin5Max10._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,10}$"`);
expect(brandedString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{1,}$"`);
expect(url._zod.pattern.source).toMatchInlineSnapshot(`"^https:\\/\\/\\w+\\.(com|net)$"`);
expect(measurement._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?((px|em|rem|vh|vw|vmin|vmax))?$"`);
expect(connectionString._zod.pattern.source).toMatchInlineSnapshot(
`"^mongodb:\\/\\/(\\w+:\\w+@)?\\w+:\\d+(\\/(\\w+)?(\\?(\\w+=\\w+(&\\w+=\\w+)*)?)?)?$"`
);
});
test("template literal parsing - success - complex cases", () => {
url.parse("https://example.com");
url.parse("https://speedtest.net");
// measurement.parse(1);
// measurement.parse(1.1);
// measurement.parse(0);
// measurement.parse(-1.1);
// measurement.parse(-1);
measurement.parse("1");
measurement.parse("1.1");
measurement.parse("0");
measurement.parse("-1");
measurement.parse("-1.1");
measurement.parse("1px");
measurement.parse("1.1px");
measurement.parse("0px");
measurement.parse("-1px");
measurement.parse("-1.1px");
measurement.parse("1em");
measurement.parse("1.1em");
measurement.parse("0em");
measurement.parse("-1em");
measurement.parse("-1.1em");
measurement.parse("1rem");
measurement.parse("1.1rem");
measurement.parse("0rem");
measurement.parse("-1rem");
measurement.parse("-1.1rem");
measurement.parse("1vh");
measurement.parse("1.1vh");
measurement.parse("0vh");
measurement.parse("-1vh");
measurement.parse("-1.1vh");
measurement.parse("1vw");
measurement.parse("1.1vw");
measurement.parse("0vw");
measurement.parse("-1vw");
measurement.parse("-1.1vw");
measurement.parse("1vmin");
measurement.parse("1.1vmin");
measurement.parse("0vmin");
measurement.parse("-1vmin");
measurement.parse("-1.1vmin");
measurement.parse("1vmax");
measurement.parse("1.1vmax");
measurement.parse("0vmax");
measurement.parse("-1vmax");
measurement.parse("-1.1vmax");
connectionString.parse("mongodb://host:1234");
connectionString.parse("mongodb://host:1234/");
connectionString.parse("mongodb://host:1234/defaultauthdb");
connectionString.parse("mongodb://host:1234/defaultauthdb?authSource=admin");
connectionString.parse("mongodb://host:1234/defaultauthdb?authSource=admin&connectTimeoutMS=300000");
connectionString.parse("mongodb://host:1234/?authSource=admin");
connectionString.parse("mongodb://host:1234/?authSource=admin&connectTimeoutMS=300000");
connectionString.parse("mongodb://username:password@host:1234");
connectionString.parse("mongodb://username:password@host:1234/");
connectionString.parse("mongodb://username:password@host:1234/defaultauthdb");
connectionString.parse("mongodb://username:password@host:1234/defaultauthdb?authSource=admin");
connectionString.parse(
"mongodb://username:password@host:1234/defaultauthdb?authSource=admin&connectTimeoutMS=300000"
);
connectionString.parse("mongodb://username:password@host:1234/?authSource=admin");
connectionString.parse("mongodb://username:password@host:1234/?authSource=admin&connectTimeoutMS=300000");
});
test("template literal parsing - failure - complex cases", () => {
expect(() => url.parse("http://example.com")).toThrow();
expect(() => url.parse("https://.com")).toThrow();
expect(() => url.parse("https://examplecom")).toThrow();
expect(() => url.parse("https://example.org")).toThrow();
expect(() => url.parse("https://example.net.il")).toThrow();
expect(() => measurement.parse("1.1.1")).toThrow();
expect(() => measurement.parse("Infinity")).toThrow();
expect(() => measurement.parse("-Infinity")).toThrow();
expect(() => measurement.parse("NaN")).toThrow();
expect(() => measurement.parse("1%")).toThrow();
expect(() => connectionString.parse("mongod://host:1234")).toThrow();
expect(() => connectionString.parse("mongodb://:1234")).toThrow();
expect(() => connectionString.parse("mongodb://host1234")).toThrow();
expect(() => connectionString.parse("mongodb://host:d234")).toThrow();
expect(() => connectionString.parse("mongodb://host:12.34")).toThrow();
expect(() => connectionString.parse("mongodb://host:-1234")).toThrow();
expect(() => connectionString.parse("mongodb://host:-12.34")).toThrow();
expect(() => connectionString.parse("mongodb://host:")).toThrow();
expect(() => connectionString.parse("mongodb://:password@host:1234")).toThrow();
expect(() => connectionString.parse("mongodb://usernamepassword@host:1234")).toThrow();
expect(() => connectionString.parse("mongodb://username:@host:1234")).toThrow();
expect(() => connectionString.parse("mongodb://@host:1234")).toThrow();
expect(() => connectionString.parse("mongodb://host:1234/defaultauthdb?authSourceadmin")).toThrow();
expect(() => connectionString.parse("mongodb://host:1234/?authSourceadmin")).toThrow();
expect(() => connectionString.parse("mongodb://host:1234/defaultauthdb?&authSource=admin")).toThrow();
expect(() => connectionString.parse("mongodb://host:1234/?&authSource=admin")).toThrow();
});
test("template literal parsing - failure - issue format", () => {
expect(anotherNull.safeParse("1null")).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_format",
"format": "template_literal",
"pattern": "^null$",
"path": [],
"message": "Invalid input"
}
]],
"success": false,
}
`);
expect(cuidZZZ.safeParse("1cjld2cyuq0000t3rmniod1foyZZZ")).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_format",
"format": "template_literal",
"pattern": "^[cC][^\\\\s-]{8,}ZZZ$",
"path": [],
"message": "Invalid input"
}
]],
"success": false,
}
`);
expect(stringMin5Max10.safeParse("1234")).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_format",
"format": "template_literal",
"pattern": "^[\\\\s\\\\S]{5,10}$",
"path": [],
"message": "Invalid input"
}
]],
"success": false,
}
`);
expect(connectionString.safeParse("mongodb://host:1234/defaultauthdb?authSourceadmin")).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_format",
"format": "template_literal",
"pattern": "^mongodb:\\\\/\\\\/(\\\\w+:\\\\w+@)?\\\\w+:\\\\d+(\\\\/(\\\\w+)?(\\\\?(\\\\w+=\\\\w+(&\\\\w+=\\\\w+)*)?)?)?$",
"path": [],
"message": "Invalid input"
}
]],
"success": false,
}
`);
expect(stringStartsWithMax5.safeParse("1hell")).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "invalid_format",
"format": "template_literal",
"pattern": "^hello.*$",
"path": [],
"message": "Invalid input"
}
]],
"success": false,
}
`);
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"setsAreEqual.d.ts","sourceRoot":"","sources":["../../src/utilities/setsAreEqual.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,YAEvD,CAAA"}

View File

@@ -0,0 +1,4 @@
import type { ServerProps } from 'payload';
import type React from 'react';
export declare const Logo: React.FC<ServerProps>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,79 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "NIL", {
enumerable: true,
get: function get() {
return _nil.default;
}
});
Object.defineProperty(exports, "parse", {
enumerable: true,
get: function get() {
return _parse.default;
}
});
Object.defineProperty(exports, "stringify", {
enumerable: true,
get: function get() {
return _stringify.default;
}
});
Object.defineProperty(exports, "v1", {
enumerable: true,
get: function get() {
return _v.default;
}
});
Object.defineProperty(exports, "v3", {
enumerable: true,
get: function get() {
return _v2.default;
}
});
Object.defineProperty(exports, "v4", {
enumerable: true,
get: function get() {
return _v3.default;
}
});
Object.defineProperty(exports, "v5", {
enumerable: true,
get: function get() {
return _v4.default;
}
});
Object.defineProperty(exports, "validate", {
enumerable: true,
get: function get() {
return _validate.default;
}
});
Object.defineProperty(exports, "version", {
enumerable: true,
get: function get() {
return _version.default;
}
});
var _v = _interopRequireDefault(require("./v1.js"));
var _v2 = _interopRequireDefault(require("./v3.js"));
var _v3 = _interopRequireDefault(require("./v4.js"));
var _v4 = _interopRequireDefault(require("./v5.js"));
var _nil = _interopRequireDefault(require("./nil.js"));
var _version = _interopRequireDefault(require("./version.js"));
var _validate = _interopRequireDefault(require("./validate.js"));
var _stringify = _interopRequireDefault(require("./stringify.js"));
var _parse = _interopRequireDefault(require("./parse.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

View File

@@ -0,0 +1 @@
{"version":3,"file":"errorMessages.d.ts","sourceRoot":"","sources":["../../../src/forms/Form/errorMessages.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa;;CAEzB,CAAA"}

View File

@@ -0,0 +1,89 @@
{
"name": "strtok3",
"version": "8.1.0",
"description": "A promise based streaming tokenizer",
"author": {
"name": "Borewit",
"url": "https://github.com/Borewit"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Borewit"
},
"scripts": {
"clean": "del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map'",
"compile-src": "tsc -p lib",
"compile-test": "tsc -p test",
"compile": "yarn run compile-src && yarn run compile-test",
"build": "yarn run clean && yarn run compile",
"eslint": "eslint lib test",
"lint-md": "remark -u preset-lint-recommended .",
"lint-ts": "biome check",
"lint": "yarn run lint-md && yarn run lint-ts",
"fix": "yarn run biome lint --write",
"test": "mocha",
"test-coverage": "c8 yarn run test",
"send-codacy": "c8 report --reporter=text-lcov | codacy-coverage",
"start": "yarn run compile && yarn run lint && yarn run cover-test"
},
"engines": {
"node": ">=16"
},
"repository": {
"type": "git",
"url": "https://github.com/Borewit/strtok3.git"
},
"license": "MIT",
"type": "module",
"exports": {
".": {
"node": "./lib/index.js",
"default": "./lib/core.js"
},
"./core": "./lib/core.js"
},
"types": "lib/index.d.ts",
"files": [
"lib/**/*.js",
"lib/**/*.d.ts"
],
"bugs": {
"url": "https://github.com/Borewit/strtok3/issues"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@types/chai": "^4.3.17",
"@types/debug": "^4.1.12",
"@types/mocha": "^10.0.7",
"@types/node": "^22.2.0",
"c8": "^10.1.2",
"chai": "^5.1.1",
"del-cli": "^5.1.0",
"mocha": "^10.7.3",
"remark-cli": "^12.0.1",
"remark-preset-lint-recommended": "^7.0.0",
"token-types": "^6.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"uint8array-extras": "^1.4.0"
},
"dependencies": {
"@tokenizer/token": "^0.3.0",
"peek-readable": "^5.1.4"
},
"keywords": [
"tokenizer",
"reader",
"token",
"async",
"promise",
"parser",
"decoder",
"binary",
"endian",
"uint",
"stream",
"streaming"
],
"packageManager": "yarn@4.3.1"
}

View File

@@ -0,0 +1,15 @@
export {
CacheProvider,
ClassNames,
Global,
ThemeContext,
ThemeProvider,
__unsafe_useEmotionCache,
createElement,
css,
jsx,
keyframes,
useTheme,
withEmotionCache,
withTheme
} from "./emotion-react.edge-light.cjs.js";

View File

@@ -0,0 +1 @@
{"version":3,"file":"distDirRewriteFramesIntegration.js","sources":["../../../src/edge/distDirRewriteFramesIntegration.ts"],"sourcesContent":["import { defineIntegration, escapeStringForRegex, rewriteFramesIntegration } from '@sentry/core';\n\nexport const distDirRewriteFramesIntegration = defineIntegration(({ distDirName }: { distDirName: string }) => {\n const distDirAbsPath = distDirName.replace(/(\\/|\\\\)$/, ''); // We strip trailing slashes because \"app:///_next\" also doesn't have one\n\n // Normally we would use `path.resolve` to obtain the absolute path we will strip from the stack frame to align with\n // the uploaded artifacts, however we don't have access to that API in edge so we need to be a bit more lax.\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- user input is escaped\n const SOURCEMAP_FILENAME_REGEX = new RegExp(`.*${escapeStringForRegex(distDirAbsPath)}`);\n\n const rewriteFramesIntegrationInstance = rewriteFramesIntegration({\n iteratee: frame => {\n frame.filename = frame.filename?.replace(SOURCEMAP_FILENAME_REGEX, 'app:///_next');\n return frame;\n },\n });\n\n return {\n ...rewriteFramesIntegrationInstance,\n name: 'DistDirRewriteFrames',\n };\n});\n"],"names":[],"mappings":";;AAEO,MAAM,+BAAA,GAAkC,iBAAiB,CAAC,CAAC,EAAE,WAAA,EAAa,KAA8B;AAC/G,EAAE,MAAM,cAAA,GAAiB,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;;AAE5D;AACA;AACA;AACA,EAAE,MAAM,wBAAA,GAA2B,IAAI,MAAM,CAAC,CAAC,EAAE,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC,CAAA,CAAA;;AAEA,EAAA,MAAA,gCAAA,GAAA,wBAAA,CAAA;AACA,IAAA,QAAA,EAAA,KAAA,IAAA;AACA,MAAA,KAAA,CAAA,QAAA,GAAA,KAAA,CAAA,QAAA,EAAA,OAAA,CAAA,wBAAA,EAAA,cAAA,CAAA;AACA,MAAA,OAAA,KAAA;AACA,IAAA,CAAA;AACA,GAAA,CAAA;;AAEA,EAAA,OAAA;AACA,IAAA,GAAA,gCAAA;AACA,IAAA,IAAA,EAAA,sBAAA;AACA,GAAA;AACA,CAAA;;;;"}

View File

@@ -0,0 +1,9 @@
import type { CollectionSlug } from 'payload';
import React from 'react';
export type ListSelectionProps = {
disableBulkDelete?: boolean;
disableBulkEdit?: boolean;
folderAssignedCollections: CollectionSlug[];
};
export declare const ListSelection: React.FC<ListSelectionProps>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,11 @@
import * as fs from 'node:fs'
import { once } from 'node:events'
async function run (opts: { destination?: fs.PathLike }): Promise<fs.WriteStream> {
if (!opts.destination) throw new Error('kaboom')
const stream = fs.createWriteStream(opts.destination, { encoding: 'utf8' })
await once(stream, 'open')
return stream
}
export default run

View File

@@ -0,0 +1,67 @@
"use strict";
exports.roundToNearestMinutes = roundToNearestMinutes;
var _index = require("./_lib/getRoundingMethod.cjs");
var _index2 = require("./constructFrom.cjs");
var _index3 = require("./toDate.cjs");
/**
* The {@link roundToNearestMinutes} function options.
*/
/**
* @name roundToNearestMinutes
* @category Minute Helpers
* @summary Rounds the given date to the nearest minute
*
* @description
* Rounds the given date to the nearest minute (or number of minutes).
* Rounds up when the given date is exactly between the nearest round minutes.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to round
* @param options - An object with options.
*
* @returns The new date rounded to the closest minute
*
* @example
* // Round 10 July 2014 12:12:34 to nearest minute:
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))
* //=> Thu Jul 10 2014 12:13:00
*
* @example
* // Round 10 July 2014 12:12:34 to nearest quarter hour:
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 })
* //=> Thu Jul 10 2014 12:15:00
*
* @example
* // Floor (rounds down) 10 July 2014 12:12:34 to nearest minute:
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'floor' })
* //=> Thu Jul 10 2014 12:12:00
*
* @example
* // Ceil (rounds up) 10 July 2014 12:12:34 to nearest half hour:
* const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { roundingMethod: 'ceil', nearestTo: 30 })
* //=> Thu Jul 10 2014 12:30:00
*/
function roundToNearestMinutes(date, options) {
const nearestTo = options?.nearestTo ?? 1;
if (nearestTo < 1 || nearestTo > 30)
return (0, _index2.constructFrom)(date, NaN);
const date_ = (0, _index3.toDate)(date, options?.in);
const fractionalSeconds = date_.getSeconds() / 60;
const fractionalMilliseconds = date_.getMilliseconds() / 1000 / 60;
const minutes =
date_.getMinutes() + fractionalSeconds + fractionalMilliseconds;
const method = options?.roundingMethod ?? "round";
const roundingMethod = (0, _index.getRoundingMethod)(method);
const roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo;
date_.setMinutes(roundedMinutes, 0, 0);
return date_;
}

View File

@@ -0,0 +1,166 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["P", "M"],
abbreviated: ["PK", "MK"],
wide: ["Para Krishtit", "Mbas Krishtit"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["4-mujori I", "4-mujori II", "4-mujori III", "4-mujori IV"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["J", "S", "M", "P", "M", "Q", "K", "G", "S", "T", "N", "D"],
abbreviated: [
"Jan",
"Shk",
"Mar",
"Pri",
"Maj",
"Qer",
"Kor",
"Gus",
"Sht",
"Tet",
"Nën",
"Dhj",
],
wide: [
"Janar",
"Shkurt",
"Mars",
"Prill",
"Maj",
"Qershor",
"Korrik",
"Gusht",
"Shtator",
"Tetor",
"Nëntor",
"Dhjetor",
],
};
const dayValues = {
narrow: ["D", "H", "M", "M", "E", "P", "S"],
short: ["Di", "Hë", "Ma", "Më", "En", "Pr", "Sh"],
abbreviated: ["Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Sht"],
wide: ["Dielë", "Hënë", "Martë", "Mërkurë", "Enjte", "Premte", "Shtunë"],
};
const dayPeriodValues = {
narrow: {
am: "p",
pm: "m",
midnight: "m",
noon: "d",
morning: "mëngjes",
afternoon: "dite",
evening: "mbrëmje",
night: "natë",
},
abbreviated: {
am: "PD",
pm: "MD",
midnight: "mesnëtë",
noon: "drek",
morning: "mëngjes",
afternoon: "mbasdite",
evening: "mbrëmje",
night: "natë",
},
wide: {
am: "p.d.",
pm: "m.d.",
midnight: "mesnëtë",
noon: "drek",
morning: "mëngjes",
afternoon: "mbasdite",
evening: "mbrëmje",
night: "natë",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "p",
pm: "m",
midnight: "m",
noon: "d",
morning: "në mëngjes",
afternoon: "në mbasdite",
evening: "në mbrëmje",
night: "në mesnatë",
},
abbreviated: {
am: "PD",
pm: "MD",
midnight: "mesnatë",
noon: "drek",
morning: "në mëngjes",
afternoon: "në mbasdite",
evening: "në mbrëmje",
night: "në mesnatë",
},
wide: {
am: "p.d.",
pm: "m.d.",
midnight: "mesnatë",
noon: "drek",
morning: "në mëngjes",
afternoon: "në mbasdite",
evening: "në mbrëmje",
night: "në mesnatë",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
if (options?.unit === "hour") return String(number);
if (number === 1) return number + "-rë";
if (number === 4) return number + "t";
return number + "-të";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/aws-data-api/pg/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { AwsDataApiPgDatabase } from './driver.ts';\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: AwsDataApiPgDatabase<TSchema>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAmC;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,iBAAa,oCAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]}

View File

@@ -0,0 +1,54 @@
"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.getTracedCreateStreamTrace = exports.getTracedCreateClient = exports.endSpan = void 0;
const api_1 = require("@opentelemetry/api");
const endSpan = (span, err) => {
if (err) {
span.setStatus({
code: api_1.SpanStatusCode.ERROR,
message: err.message,
});
}
span.end();
};
exports.endSpan = endSpan;
const getTracedCreateClient = (original) => {
return function createClientTrace() {
const client = original.apply(this, arguments);
return api_1.context.bind(api_1.context.active(), client);
};
};
exports.getTracedCreateClient = getTracedCreateClient;
const getTracedCreateStreamTrace = (original) => {
return function create_stream_trace() {
if (!Object.prototype.hasOwnProperty.call(this, 'stream')) {
Object.defineProperty(this, 'stream', {
get() {
return this._patched_redis_stream;
},
set(val) {
api_1.context.bind(api_1.context.active(), val);
this._patched_redis_stream = val;
},
});
}
return original.apply(this, arguments);
};
};
exports.getTracedCreateStreamTrace = getTracedCreateStreamTrace;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1,137 @@
<p align="center">
<a href="https://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>
# glob-parent
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
Extract the non-magic parent path from a glob string.
## Usage
```js
var globParent = require('glob-parent');
globParent('path/to/*.js'); // 'path/to'
globParent('/root/path/to/*.js'); // '/root/path/to'
globParent('/*.js'); // '/'
globParent('*.js'); // '.'
globParent('**/*.js'); // '.'
globParent('path/{to,from}'); // 'path'
globParent('path/!(to|from)'); // 'path'
globParent('path/?(to|from)'); // 'path'
globParent('path/+(to|from)'); // 'path'
globParent('path/*(to|from)'); // 'path'
globParent('path/@(to|from)'); // 'path'
globParent('path/**/*'); // 'path'
// if provided a non-glob path, returns the nearest dir
globParent('path/foo/bar.js'); // 'path/foo'
globParent('path/foo/'); // 'path/foo'
globParent('path/foo'); // 'path' (see issue #3 for details)
```
## API
### `globParent(maybeGlobString, [options])`
Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below.
#### options
```js
{
// Disables the automatic conversion of slashes for Windows
flipBackslashes: true
}
```
## Escaping
The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters:
- `?` (question mark) unless used as a path segment alone
- `*` (asterisk)
- `|` (pipe)
- `(` (opening parenthesis)
- `)` (closing parenthesis)
- `{` (opening curly brace)
- `}` (closing curly brace)
- `[` (opening bracket)
- `]` (closing bracket)
**Example**
```js
globParent('foo/[bar]/') // 'foo'
globParent('foo/\\[bar]/') // 'foo/[bar]'
```
## Limitations
### Braces & Brackets
This library attempts a quick and imperfect method of determining which path
parts have glob magic without fully parsing/lexing the pattern. There are some
advanced use cases that can trip it up, such as nested braces where the outer
pair is escaped and the inner one contains a path separator. If you find
yourself in the unlikely circumstance of being affected by this or need to
ensure higher-fidelity glob handling in your library, it is recommended that you
pre-process your input with [expand-braces] and/or [expand-brackets].
### Windows
Backslashes are not valid path separators for globs. If a path with backslashes
is provided anyway, for simple cases, glob-parent will replace the path
separator for you and return the non-glob parent path (now with
forward-slashes, which are still valid as Windows path separators).
This cannot be used in conjunction with escape characters.
```js
// BAD
globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)'
// GOOD
globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)'
```
If you are using escape characters for a pattern without path parts (i.e.
relative to `cwd`), prefix with `./` to avoid confusing glob-parent.
```js
// BAD
globParent('foo \\[bar]') // 'foo '
globParent('foo \\[bar]*') // 'foo '
// GOOD
globParent('./foo \\[bar]') // 'foo [bar]'
globParent('./foo \\[bar]*') // '.'
```
## License
ISC
[expand-braces]: https://github.com/jonschlinkert/expand-braces
[expand-brackets]: https://github.com/jonschlinkert/expand-brackets
[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg
[npm-url]: https://www.npmjs.com/package/glob-parent
[npm-image]: https://img.shields.io/npm/v/glob-parent.svg
[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master
[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master
[travis-url]: https://travis-ci.org/gulpjs/glob-parent
[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci
[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor
[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg
[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg

View File

@@ -0,0 +1 @@
{"version":3,"file":"escapeStringForRegex.d.ts","sourceRoot":"","sources":["../../../src/vendor/escapeStringForRegex.ts"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAIhE"}

View File

@@ -0,0 +1,68 @@
{
"name": "@payloadcms/translations",
"version": "3.77.0",
"homepage": "https://payloadcms.com",
"repository": {
"type": "git",
"url": "https://github.com/payloadcms/payload.git",
"directory": "packages/translations"
},
"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/exports/index.js",
"types": "./dist/exports/index.d.ts",
"default": "./dist/exports/index.js"
},
"./all": {
"import": "./dist/exports/all.js",
"types": "./dist/exports/all.d.ts",
"default": "./dist/exports/all.js"
},
"./utilities": {
"import": "./dist/exports/utilities.js",
"types": "./dist/exports/utilities.d.ts",
"default": "./dist/exports/utilities.js"
},
"./languages/*": {
"import": "./dist/languages/*.js",
"types": "./dist/languages/*.d.ts",
"default": "./dist/languages/*.js"
}
},
"main": "./dist/exports/index.js",
"types": "./dist/exports/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"date-fns": "4.1.0"
},
"devDependencies": {
"@types/react": "19.2.9",
"@types/react-dom": "19.2.3",
"dotenv": "16.4.7",
"prettier": "3.5.3",
"typescript": "5.7.3",
"@payloadcms/eslint-config": "3.28.0"
},
"scripts": {
"build": "pnpm build:types && pnpm build:swc",
"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"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,YAAY,GAAG,6CAA6C,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const PACKAGE_VERSION = '0.55.0';\nexport const PACKAGE_NAME = '@opentelemetry/instrumentation-lru-memoizer';\n"]}

View File

@@ -0,0 +1,7 @@
var getNative = require('./_getNative'),
root = require('./_root');
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;

View File

@@ -0,0 +1 @@
{"version":3,"file":"route-off.js","sources":["../../../src/icons/route-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name RouteOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI2IiBjeT0iMTkiIHI9IjMiIC8+CiAgPHBhdGggZD0iTTkgMTloOC41Yy40IDAgLjktLjEgMS4zLS4yIiAvPgogIDxwYXRoIGQ9Ik01LjIgNS4yQTMuNSAzLjUzIDAgMCAwIDYuNSAxMkgxMiIgLz4KICA8cGF0aCBkPSJtMiAyIDIwIDIwIiAvPgogIDxwYXRoIGQ9Ik0yMSAxNS4zYTMuNSAzLjUgMCAwIDAtMy4zLTMuMyIgLz4KICA8cGF0aCBkPSJNMTUgNWgtNC4zIiAvPgogIDxjaXJjbGUgY3g9IjE4IiBjeT0iNSIgcj0iMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/route-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst RouteOff = createLucideIcon('RouteOff', [\n ['circle', { cx: '6', cy: '19', r: '3', key: '1kj8tv' }],\n ['path', { d: 'M9 19h8.5c.4 0 .9-.1 1.3-.2', key: '1effex' }],\n ['path', { d: 'M5.2 5.2A3.5 3.53 0 0 0 6.5 12H12', key: 'k9y2ds' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M21 15.3a3.5 3.5 0 0 0-3.3-3.3', key: '11nlu2' }],\n ['path', { d: 'M15 5h-4.3', key: '6537je' }],\n ['circle', { cx: '18', cy: '5', r: '3', key: 'gq8acd' }],\n]);\n\nexport default RouteOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC3C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACzD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,73 @@
import { type Cache } from "../cache/core/cache.js";
import type { WithCacheConfig } from "../cache/core/types.js";
import { entityKind } from "../entity.js";
import type { TablesRelationalConfig } from "../relations.js";
import type { PreparedQuery } from "../session.js";
import { type Query, type SQL } from "../sql/index.js";
import type { NeonAuthToken } from "../utils.js";
import { PgDatabase } from "./db.js";
import type { PgDialect } from "./dialect.js";
import type { SelectedFieldsOrdered } from "./query-builders/select.types.js";
export interface PreparedQueryConfig {
execute: unknown;
all: unknown;
values: unknown;
}
export declare abstract class PgPreparedQuery<T extends PreparedQueryConfig> implements PreparedQuery {
protected query: Query;
private cache;
private queryMetadata;
private cacheConfig?;
constructor(query: Query, cache: Cache | undefined, queryMetadata: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
} | undefined, cacheConfig?: WithCacheConfig | undefined);
protected authToken?: NeonAuthToken;
getQuery(): Query;
mapResult(response: unknown, _isFromBatch?: boolean): unknown;
static readonly [entityKind]: string;
abstract execute(placeholderValues?: Record<string, unknown>): Promise<T['execute']>;
}
export interface PgTransactionConfig {
isolationLevel?: 'read uncommitted' | 'read committed' | 'repeatable read' | 'serializable';
accessMode?: 'read only' | 'read write';
deferrable?: boolean;
}
export declare abstract class PgSession<TQueryResult extends PgQueryResultHKT = PgQueryResultHKT, TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = Record<string, never>> {
protected dialect: PgDialect;
static readonly [entityKind]: string;
constructor(dialect: PgDialect);
abstract prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => T['execute'], queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
}, cacheConfig?: WithCacheConfig): PgPreparedQuery<T>;
execute<T>(query: SQL): Promise<T>;
all<T = unknown>(query: SQL): Promise<T[]>;
count(sql: SQL): Promise<number>;
abstract transaction<T>(transaction: (tx: PgTransaction<TQueryResult, TFullSchema, TSchema>) => Promise<T>, config?: PgTransactionConfig): Promise<T>;
}
export declare abstract class PgTransaction<TQueryResult extends PgQueryResultHKT, TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = Record<string, never>> extends PgDatabase<TQueryResult, TFullSchema, TSchema> {
protected schema: {
fullSchema: Record<string, unknown>;
schema: TSchema;
tableNamesMap: Record<string, string>;
} | undefined;
protected readonly nestedIndex: number;
static readonly [entityKind]: string;
constructor(dialect: PgDialect, session: PgSession<any, any, any>, schema: {
fullSchema: Record<string, unknown>;
schema: TSchema;
tableNamesMap: Record<string, string>;
} | undefined, nestedIndex?: number);
rollback(): never;
setTransaction(config: PgTransactionConfig): Promise<void>;
abstract transaction<T>(transaction: (tx: PgTransaction<TQueryResult, TFullSchema, TSchema>) => Promise<T>): Promise<T>;
}
export interface PgQueryResultHKT {
readonly $brand: 'PgQueryResultHKT';
readonly row: unknown;
readonly type: unknown;
}
export type PgQueryResultKind<TKind extends PgQueryResultHKT, TRow> = (TKind & {
readonly row: TRow;
})['type'];

View File

@@ -0,0 +1,24 @@
/**
* @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 FileChartPie = createLucideIcon("FileChartPie", [
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["path", { d: "M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3.5", key: "13ddob" }],
["path", { d: "M4.017 11.512a6 6 0 1 0 8.466 8.475", key: "s6vs5t" }],
[
"path",
{
d: "M9 16a1 1 0 0 1-1-1v-4c0-.552.45-1.008.995-.917a6 6 0 0 1 4.922 4.922c.091.544-.365.995-.917.995z",
key: "1dl6s6"
}
]
]);
export { FileChartPie as default };
//# sourceMappingURL=file-chart-pie.js.map

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').detect;

View File

@@ -0,0 +1,11 @@
import { Context } from '@opentelemetry/api';
import { AbstractAsyncHooksContextManager } from './AbstractAsyncHooksContextManager';
export declare class AsyncLocalStorageContextManager extends AbstractAsyncHooksContextManager {
private _asyncLocalStorage;
constructor();
active(): Context;
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
enable(): this;
disable(): this;
}
//# sourceMappingURL=AsyncLocalStorageContextManager.d.ts.map

View File

@@ -0,0 +1,27 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link isSaturday} function options.
*/
export interface IsSaturdayOptions extends ContextOptions<Date> {}
/**
* @name isSaturday
* @category Weekday Helpers
* @summary Is the given date Saturday?
*
* @description
* Is the given date Saturday?
*
* @param date - The date to check
* @param options - An object with options
*
* @returns The date is Saturday
*
* @example
* // Is 27 September 2014 Saturday?
* const result = isSaturday(new Date(2014, 8, 27))
* //=> true
*/
export declare function isSaturday(
date: DateArg<Date> & {},
options?: IsSaturdayOptions | undefined,
): boolean;

View File

@@ -0,0 +1,28 @@
import { entityKind } from "../../entity.js";
import { GelColumn } from "./common.js";
import { GelIntColumnBaseBuilder } from "./int.common.js";
class GelIntegerBuilder extends GelIntColumnBaseBuilder {
static [entityKind] = "GelIntegerBuilder";
constructor(name) {
super(name, "number", "GelInteger");
}
/** @internal */
build(table) {
return new GelInteger(table, this.config);
}
}
class GelInteger extends GelColumn {
static [entityKind] = "GelInteger";
getSQLType() {
return "integer";
}
}
function integer(name) {
return new GelIntegerBuilder(name ?? "");
}
export {
GelInteger,
GelIntegerBuilder,
integer
};
//# sourceMappingURL=integer.js.map

View File

@@ -0,0 +1,34 @@
import { GraphQLError } from '../../error/GraphQLError.mjs';
import { Kind } from '../../language/kinds.mjs';
/**
* Lone anonymous operation
*
* A GraphQL document is only valid if when it contains an anonymous operation
* (the query short-hand) that it contains only that one operation definition.
*
* See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation
*/
export function LoneAnonymousOperationRule(context) {
let operationCount = 0;
return {
Document(node) {
operationCount = node.definitions.filter(
(definition) => definition.kind === Kind.OPERATION_DEFINITION,
).length;
},
OperationDefinition(node) {
if (!node.name && operationCount > 1) {
context.reportError(
new GraphQLError(
'This anonymous operation must be the only defined operation.',
{
nodes: node,
},
),
);
}
},
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"growthbook.js","sources":["../../../../src/integrations/featureFlagShims/growthbook.ts"],"sourcesContent":["import { growthbookIntegration as coreGrowthbookIntegration } from '@sentry/core';\n\n/**\n * Re-export the core GrowthBook integration for Node.js usage.\n * The core integration is runtime-agnostic and works in both browser and Node environments.\n */\nexport const growthbookIntegrationShim = coreGrowthbookIntegration;\n"],"names":["coreGrowthbookIntegration"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACO,MAAM,yBAAA,GAA4BA;;;;"}

View File

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

View File

@@ -0,0 +1,14 @@
import type { NextConfigObject } from '../types';
/**
* Resolves the tunnel route based on the user's configuration and the environment.
* @param tunnelRoute - The user-provided tunnel route option
*/
export declare function resolveTunnelRoute(tunnelRoute: string | true): string;
/**
* Injects rewrite rules into the Next.js config provided by the user to tunnel
* requests from the `tunnelPath` to Sentry.
*
* See https://nextjs.org/docs/api-reference/next.config.js/rewrites.
*/
export declare function setUpTunnelRewriteRules(userNextConfig: NextConfigObject, tunnelPath: string): void;
//# sourceMappingURL=tunnel.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../src/exports/all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AA+CrD,eAAO,MAAM,YAAY,EA8CpB,kBAAkB,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"triangle-alert.js","sources":["../../../src/icons/triangle-alert.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TriangleAlert\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEuNzMgMTgtOC0xNGEyIDIgMCAwIDAtMy40OCAwbC04IDE0QTIgMiAwIDAgMCA0IDIxaDE2YTIgMiAwIDAgMCAxLjczLTMiIC8+CiAgPHBhdGggZD0iTTEyIDl2NCIgLz4KICA8cGF0aCBkPSJNMTIgMTdoLjAxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/triangle-alert\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 TriangleAlert = createLucideIcon('TriangleAlert', [\n [\n 'path',\n {\n d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3',\n key: 'wmoenq',\n },\n ],\n ['path', { d: 'M12 9v4', key: 'juzpu7' }],\n ['path', { d: 'M12 17h.01', key: 'p32p05' }],\n]);\n\nexport default TriangleAlert;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CACtD,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;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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,44 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.JSONSchema = exports.locales = exports.regexes = exports.util = void 0;
__exportStar(require("./core.cjs"), exports);
__exportStar(require("./parse.cjs"), exports);
__exportStar(require("./errors.cjs"), exports);
__exportStar(require("./schemas.cjs"), exports);
__exportStar(require("./checks.cjs"), exports);
__exportStar(require("./versions.cjs"), exports);
exports.util = __importStar(require("./util.cjs"));
exports.regexes = __importStar(require("./regexes.cjs"));
exports.locales = __importStar(require("../locales/index.cjs"));
__exportStar(require("./registries.cjs"), exports);
__exportStar(require("./doc.cjs"), exports);
__exportStar(require("./function.cjs"), exports);
__exportStar(require("./api.cjs"), exports);
__exportStar(require("./to-json-schema.cjs"), exports);
exports.JSONSchema = __importStar(require("./json-schema.cjs"));

View File

@@ -0,0 +1,630 @@
# memoize-one
A memoization library that only caches the result of the most recent arguments.
[![npm](https://img.shields.io/npm/v/memoize-one.svg)](https://www.npmjs.com/package/memoize-one)
![types](https://img.shields.io/badge/types-typescript%20%7C%20flow-blueviolet)
[![minzip](https://img.shields.io/bundlephobia/minzip/memoize-one.svg)](https://www.npmjs.com/package/memoize-one)
[![Downloads per month](https://img.shields.io/npm/dm/memoize-one.svg)](https://www.npmjs.com/package/memoize-one)
## Rationale
Unlike other memoization libraries, `memoize-one` only remembers the latest arguments and result. No need to worry about cache busting mechanisms such as `maxAge`, `maxSize`, `exclusions` and so on, which can be prone to memory leaks. A function memoized with `memoize-one` simply remembers the last arguments, and if the memoized function is next called with the same arguments then it returns the previous result.
> For working with promises, [@Kikobeats](https://github.com/Kikobeats) has built [async-memoize-one](https://github.com/microlinkhq/async-memoize-one).
## Usage
```js
// memoize-one uses the default import
import memoizeOne from 'memoize-one';
function add(a, b) {
return a + b;
}
const memoizedAdd = memoizeOne(add);
memoizedAdd(1, 2);
// add function: is called
// [new value returned: 3]
memoizedAdd(1, 2);
// add function: not called
// [cached result is returned: 3]
memoizedAdd(2, 3);
// add function: is called
// [new value returned: 5]
memoizedAdd(2, 3);
// add function: not called
// [cached result is returned: 5]
memoizedAdd(1, 2);
// add function: is called
// [new value returned: 3]
// 👇
// While the result of `add(1, 2)` was previously cached
// `(1, 2)` was not the *latest* arguments (the last call was `(2, 3)`)
// so the previous cached result of `(1, 3)` was lost
```
## Installation
```bash
# yarn
yarn add memoize-one
# npm
npm install memoize-one --save
```
## Function argument equality
By default, we apply our own _fast_ and _relatively naive_ equality function to determine whether the arguments provided to your function are equal. You can see the full code here: [are-inputs-equal.ts](https://github.com/alexreardon/memoize-one/blob/master/src/are-inputs-equal.ts).
(By default) function arguments are considered equal if:
1. there is same amount of arguments
2. each new argument has strict equality (`===`) with the previous argument
3. **[special case]** if two arguments are not `===` and they are both `NaN` then the two arguments are treated as equal
What this looks like in practice:
```js
import memoizeOne from 'memoize-one';
// add all numbers provided to the function
const add = (...args = []) =>
args.reduce((current, value) => {
return current + value;
}, 0);
const memoizedAdd = memoizeOne(add);
```
> 1. there is same amount of arguments
```js
memoizedAdd(1, 2);
// the amount of arguments has changed, so underlying add function is called
memoizedAdd(1, 2, 3);
```
> 2. new arguments have strict equality (`===`) with the previous argument
```js
memoizedAdd(1, 2);
// each argument is `===` to the last argument, so cache is used
memoizedAdd(1, 2);
// second argument has changed, so add function is called again
memoizedAdd(1, 3);
// the first value is not `===` to the previous first value (1 !== 3)
// so add function is called again
memoizedAdd(3, 1);
```
> 3. **[special case]** if the arguments are not `===` and they are both `NaN` then the argument is treated as equal
```js
memoizedAdd(NaN);
// Even though NaN !== NaN these arguments are
// treated as equal as they are both `NaN`
memoizedAdd(NaN);
```
## Custom equality function
You can also pass in a custom function for checking the equality of two sets of arguments
```js
const memoized = memoizeOne(fn, isEqual);
```
An equality function should return `true` if the arguments are equal. If `true` is returned then the wrapped function will not be called.
**Tip**: A custom equality function needs to compare `Arrays`. The `newArgs` array will be a new reference every time so a simple `newArgs === lastArgs` will always return `false`.
Equality functions are not called if the `this` context of the function has changed (see below).
Here is an example that uses a [lodash.isEqual](https://lodash.com/docs/4.17.15#isEqual) deep equal equality check
> `lodash.isequal` correctly handles deep comparing two arrays
```js
import memoizeOne from 'memoize-one';
import isDeepEqual from 'lodash.isequal';
const identity = (x) => x;
const shallowMemoized = memoizeOne(identity);
const deepMemoized = memoizeOne(identity, isDeepEqual);
const result1 = shallowMemoized({ foo: 'bar' });
const result2 = shallowMemoized({ foo: 'bar' });
result1 === result2; // false - different object reference
const result3 = deepMemoized({ foo: 'bar' });
const result4 = deepMemoized({ foo: 'bar' });
result3 === result4; // true - arguments are deep equal
```
The equality function needs to conform to the `EqualityFn` `type`:
```ts
// TFunc is the function being memoized
type EqualityFn<TFunc extends (...args: any[]) => any> = (
newArgs: Parameters<TFunc>,
lastArgs: Parameters<TFunc>,
) => boolean;
// You can import this type
import type { EqualityFn } from 'memoize-one';
```
The `EqualityFn` type allows you to create equality functions that are extremely typesafe. You are welcome to provide your own less type safe equality functions.
Here are some examples of equality functions which are ordered by most type safe, to least type safe:
<details>
<summary>Example equality function types</summary>
<p>
```ts
// the function we are going to memoize
function add(first: number, second: number): number {
return first + second;
}
// Some options for our equality function
// ↑ stronger types
// ↓ weaker types
// ✅ exact parameters of `add`
{
const isEqual = function (first: Parameters<typeof add>, second: Parameters<typeof add>) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ tuple of the correct types
{
const isEqual = function (first: [number, number], second: [number, number]) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ❌ tuple of incorrect types
{
const isEqual = function (first: [number, string], second: [number, number]) {
return true;
};
expectTypeOf<typeof isEqual>().not.toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ array of the correct types
{
const isEqual = function (first: number[], second: number[]) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ❌ array of incorrect types
{
const isEqual = function (first: string[], second: number[]) {
return true;
};
expectTypeOf<typeof isEqual>().not.toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ tuple of 'unknown'
{
const isEqual = function (first: [unknown, unknown], second: [unknown, unknown]) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ❌ tuple of 'unknown' of incorrect length
{
const isEqual = function (first: [unknown, unknown, unknown], second: [unknown, unknown]) {
return true;
};
expectTypeOf<typeof isEqual>().not.toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ array of 'unknown'
{
const isEqual = function (first: unknown[], second: unknown[]) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ spread of 'unknown'
{
const isEqual = function (...first: unknown[]) {
return !!first;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ tuple of 'any'
{
const isEqual = function (first: [any, any], second: [any, any]) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ❌ tuple of 'any' or incorrect size
{
const isEqual = function (first: [any, any, any], second: [any, any]) {
return true;
};
expectTypeOf<typeof isEqual>().not.toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ array of 'any'
{
const isEqual = function (first: any[], second: any[]) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ two arguments of type any
{
const isEqual = function (first: any, second: any) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ a single argument of type any
{
const isEqual = function (first: any) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
// ✅ spread of any type
{
const isEqual = function (...first: any[]) {
return true;
};
expectTypeOf<typeof isEqual>().toMatchTypeOf<EqualityFn<typeof add>>();
}
```
</p>
</details>
## `this`
### `memoize-one` correctly respects `this` control
This library takes special care to maintain, and allow control over the the `this` context for **both** the original function being memoized as well as the returned memoized function. Both the original function and the memoized function's `this` context respect [all the `this` controlling techniques](https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md):
- new bindings (`new`)
- explicit binding (`call`, `apply`, `bind`);
- implicit binding (call site: `obj.foo()`);
- default binding (`window` or `undefined` in `strict mode`);
- fat arrow binding (binding to lexical `this`)
- ignored this (pass `null` as `this` to explicit binding)
### Changes to `this` is considered an argument change
Changes to the running context (`this`) of a function can result in the function returning a different value even though its arguments have stayed the same:
```js
function getA() {
return this.a;
}
const temp1 = {
a: 20,
};
const temp2 = {
a: 30,
};
getA.call(temp1); // 20
getA.call(temp2); // 30
```
Therefore, in order to prevent against unexpected results, `memoize-one` takes into account the current execution context (`this`) of the memoized function. If `this` is different to the previous invocation then it is considered a change in argument. [further discussion](https://github.com/alexreardon/memoize-one/issues/3).
Generally this will be of no impact if you are not explicity controlling the `this` context of functions you want to memoize with [explicit binding](https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md#explicit-binding) or [implicit binding](https://github.com/getify/You-Dont-Know-JS/blob/master/this%20%26%20object%20prototypes/ch2.md#implicit-binding). `memoize-One` will detect when you are manipulating `this` and will then consider the `this` context as an argument. If `this` changes, it will re-execute the original function even if the arguments have not changed.
## Clearing the memoization cache
A `.clear()` property is added to memoized functions to allow you to clear it's memoization cache.
This is helpful if you want to:
- Release memory
- Allow the underlying function to be called again without having to change arguments
```ts
import memoizeOne from 'memoize-one';
function add(a: number, b: number): number {
return a + b;
}
const memoizedAdd = memoizeOne(add);
// first call - not memoized
const first = memoizedAdd(1, 2);
// second call - cache hit (underlying function not called)
const second = memoizedAdd(1, 2);
// 👋 clearing memoization cache
memoizedAdd.clear();
// third call - not memoized (cache was cleared)
const third = memoizedAdd(1, 2);
```
## When your result function `throw`s
> There is no caching when your result function throws
If your result function `throw`s then the memoized function will also throw. The throw will not break the memoized functions existing argument cache. It means the memoized function will pretend like it was never called with arguments that made it `throw`.
```js
const canThrow = (name: string) => {
console.log('called');
if (name === 'throw') {
throw new Error(name);
}
return { name };
};
const memoized = memoizeOne(canThrow);
const value1 = memoized('Alex');
// console.log => 'called'
const value2 = memoized('Alex');
// result function not called
console.log(value1 === value2);
// console.log => true
try {
memoized('throw');
// console.log => 'called'
} catch (e) {
firstError = e;
}
try {
memoized('throw');
// console.log => 'called'
// the result function was called again even though it was called twice
// with the 'throw' string
} catch (e) {
secondError = e;
}
console.log(firstError !== secondError);
const value3 = memoized('Alex');
// result function not called as the original memoization cache has not been busted
console.log(value1 === value3);
// console.log => true
```
## Function properties
Functions memoized with `memoize-one` do not preserve any properties on the function object.
> This behaviour correctly reflected in the TypeScript types
```ts
import memoizeOne from 'memoize-one';
function add(a, b) {
return a + b;
}
add.hello = 'hi';
console.log(typeof add.hello); // string
const memoized = memoizeOne(add);
// hello property on the `add` was not preserved
console.log(typeof memoized.hello); // undefined
```
If you feel strongly that `memoize-one` _should_ preserve function properties, please raise an issue. This decision was made in order to keep `memoize-one` as light as possible.
For _now_, the `.length` property of a function is not preserved on the memoized function
```ts
import memoizeOne from 'memoize-one';
function add(a, b) {
return a + b;
}
console.log(add.length); // 2
const memoized = memoizeOne(add);
console.log(memoized.length); // 0
```
There is no (great) way to correctly set the `.length` property of the memoized function while also supporting ie11. Once we [remove ie11 support](https://github.com/alexreardon/memoize-one/issues/125) then we will set the `.length` property of the memoized function to match the original function
[→ discussion](https://github.com/alexreardon/memoize-one/pull/124).
## Memoized function `type`
The resulting function you get back from `memoize-one` has *almost* the same `type` as the function that you are memoizing
```ts
declare type MemoizedFn<TFunc extends (this: any, ...args: any[]) => any> = {
clear: () => void;
(this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>): ReturnType<TFunc>;
};
```
- the same call signature as the function being memoized
- a `.clear()` function property added
- other function object properties on `TFunc` as not carried over
You are welcome to use the `MemoizedFn` generic directly from `memoize-one` if you like:
```ts
import memoize, { MemoizedFn } from 'memoize-one';
import isDeepEqual from 'lodash.isequal';
import { expectTypeOf } from 'expect-type';
// Takes any function: TFunc, and returns a Memoized<TFunc>
function withDeepEqual<TFunc extends (...args: any[]) => any>(fn: TFunc): MemoizedFn<TFunc> {
return memoize(fn, isDeepEqual);
}
function add(first: number, second: number): number {
return first + second;
}
const memoized = withDeepEqual(add);
expectTypeOf<typeof memoized>().toEqualTypeOf<MemoizedFn<typeof add>>();
```
In this specific example, this type would have been correctly inferred too
```ts
import memoize, { MemoizedFn } from 'memoize-one';
import isDeepEqual from 'lodash.isequal';
import { expectTypeOf } from 'expect-type';
// return type of MemoizedFn<TFunc> is inferred
function withDeepEqual<TFunc extends (...args: any[]) => any>(fn: TFunc) {
return memoize(fn, isDeepEqual);
}
function add(first: number, second: number): number {
return first + second;
}
const memoized = withDeepEqual(add);
// type test still passes
expectTypeOf<typeof memoized>().toEqualTypeOf<MemoizedFn<typeof add>>();
```
## Performance 🚀
### Tiny
`memoize-one` is super lightweight at [![min](https://img.shields.io/bundlephobia/min/memoize-one.svg?label=)](https://www.npmjs.com/package/memoize-one) minified and [![minzip](https://img.shields.io/bundlephobia/minzip/memoize-one.svg?label=)](https://www.npmjs.com/package/memoize-one) gzipped. (`1KB` = `1,024 Bytes`)
### Extremely fast
`memoize-one` performs better or on par with than other popular memoization libraries for the purpose of remembering the latest invocation.
The comparisons are not exhaustive and are primarily to show that `memoize-one` accomplishes remembering the latest invocation really fast. There is variability between runs. The benchmarks do not take into account the differences in feature sets, library sizes, parse time, and so on.
<details>
<summary>Expand for results</summary>
<p>
node version `16.11.1`
You can run this test in the repo by:
1. Add `"type": "module"` to the `package.json` (why is things so hard)
2. Run `yarn perf:library-comparison`
**no arguments**
| Position | Library | Operations per second |
| -------- | -------------------------------------------- | --------------------- |
| 1 | memoize-one | 80,112,981 |
| 2 | moize | 72,885,631 |
| 3 | memoizee | 35,550,009 |
| 4 | mem (JSON.stringify strategy) | 4,610,532 |
| 5 | lodash.memoize (JSON.stringify key resolver) | 3,708,945 |
| 6 | no memoization | 505 |
| 7 | fast-memoize | 504 |
**single primitive argument**
| Position | Library | Operations per second |
| -------- | -------------------------------------------- | --------------------- |
| 1 | fast-memoize | 45,482,711 |
| 2 | moize | 34,810,659 |
| 3 | memoize-one | 29,030,828 |
| 4 | memoizee | 23,467,065 |
| 5 | mem (JSON.stringify strategy) | 3,985,223 |
| 6 | lodash.memoize (JSON.stringify key resolver) | 3,369,297 |
| 7 | no memoization | 507 |
**single complex argument**
| Position | Library | Operations per second |
| -------- | -------------------------------------------- | --------------------- |
| 1 | moize | 27,660,856 |
| 2 | memoize-one | 22,407,916 |
| 3 | memoizee | 19,546,835 |
| 4 | mem (JSON.stringify strategy) | 2,068,038 |
| 5 | lodash.memoize (JSON.stringify key resolver) | 1,911,335 |
| 6 | fast-memoize | 1,633,855 |
| 7 | no memoization | 504 |
**multiple primitive arguments**
| Position | Library | Operations per second |
| -------- | -------------------------------------------- | --------------------- |
| 1 | moize | 22,366,497 |
| 2 | memoize-one | 17,241,995 |
| 3 | memoizee | 9,789,442 |
| 4 | mem (JSON.stringify strategy) | 3,065,328 |
| 5 | lodash.memoize (JSON.stringify key resolver) | 2,663,599 |
| 6 | fast-memoize | 1,219,548 |
| 7 | no memoization | 504 |
**multiple complex arguments**
| Position | Library | Operations per second |
| -------- | -------------------------------------------- | --------------------- |
| 1 | moize | 21,788,081 |
| 2 | memoize-one | 17,321,248 |
| 3 | memoizee | 9,595,420 |
| 4 | lodash.memoize (JSON.stringify key resolver) | 873,283 |
| 5 | mem (JSON.stringify strategy) | 850,779 |
| 6 | fast-memoize | 687,863 |
| 7 | no memoization | 504 |
**multiple complex arguments (spreading arguments)**
| Position | Library | Operations per second |
| -------- | -------------------------------------------- | --------------------- |
| 1 | moize | 21,701,537 |
| 2 | memoizee | 19,463,942 |
| 3 | memoize-one | 17,027,544 |
| 4 | lodash.memoize (JSON.stringify key resolver) | 887,816 |
| 5 | mem (JSON.stringify strategy) | 849,244 |
| 6 | fast-memoize | 691,512 |
| 7 | no memoization | 504 |
</p>
</details>
## Code health 👍
- Tested with all built in [JavaScript types](https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/types%20%26%20grammar/ch1.md)
- Written in `Typescript`
- Correct typing for `Typescript` and `flow` type systems
- No dependencies

View File

@@ -0,0 +1,12 @@
import { motionComponentSymbol } from './symbol.mjs';
/**
* Checks if a component is a `motion` component.
*/
function isMotionComponent(component) {
return (component !== null &&
typeof component === "object" &&
motionComponentSymbol in component);
}
export { isMotionComponent };

View File

@@ -0,0 +1,3 @@
export * from './common.mjs';
export * from './server.mjs';
export * from './render.mjs';

View File

@@ -0,0 +1,8 @@
declare function sanitize(
input: string,
options?: {
replacement?: string | ((substring: string) => string);
}
): string;
export = sanitize;

View File

@@ -0,0 +1,17 @@
import { Client } from './client';
import { ClientOptions } from './types-hoist/options';
/** A class object that can instantiate Client objects. */
export type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;
/**
* Internal function to create a new SDK client instance. The client is
* installed and then bound to the current scope.
*
* @param clientClass The client class to instantiate.
* @param options Options to pass to the client.
*/
export declare function initAndBind<F extends Client, O extends ClientOptions>(clientClass: ClientClass<F, O>, options: O): Client;
/**
* Make the given client the current client.
*/
export declare function setCurrentClient(client: Client): void;
//# sourceMappingURL=sdk.d.ts.map

View File

@@ -0,0 +1,77 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var custom_exports = {};
__export(custom_exports, {
MySqlCustomColumn: () => MySqlCustomColumn,
MySqlCustomColumnBuilder: () => MySqlCustomColumnBuilder,
customType: () => customType
});
module.exports = __toCommonJS(custom_exports);
var import_entity = require("../../entity.cjs");
var import_utils = require("../../utils.cjs");
var import_common = require("./common.cjs");
class MySqlCustomColumnBuilder extends import_common.MySqlColumnBuilder {
static [import_entity.entityKind] = "MySqlCustomColumnBuilder";
constructor(name, fieldConfig, customTypeParams) {
super(name, "custom", "MySqlCustomColumn");
this.config.fieldConfig = fieldConfig;
this.config.customTypeParams = customTypeParams;
}
/** @internal */
build(table) {
return new MySqlCustomColumn(
table,
this.config
);
}
}
class MySqlCustomColumn extends import_common.MySqlColumn {
static [import_entity.entityKind] = "MySqlCustomColumn";
sqlName;
mapTo;
mapFrom;
constructor(table, config) {
super(table, config);
this.sqlName = config.customTypeParams.dataType(config.fieldConfig);
this.mapTo = config.customTypeParams.toDriver;
this.mapFrom = config.customTypeParams.fromDriver;
}
getSQLType() {
return this.sqlName;
}
mapFromDriverValue(value) {
return typeof this.mapFrom === "function" ? this.mapFrom(value) : value;
}
mapToDriverValue(value) {
return typeof this.mapTo === "function" ? this.mapTo(value) : value;
}
}
function customType(customTypeParams) {
return (a, b) => {
const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
return new MySqlCustomColumnBuilder(name, config, customTypeParams);
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MySqlCustomColumn,
MySqlCustomColumnBuilder,
customType
});
//# sourceMappingURL=custom.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/ListHeader/DrawerRelationshipSelect/index.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,wBAAwB,mCAiCpC,CAAA"}

View File

@@ -0,0 +1,3 @@
const isMotionValue = (value) => Boolean(value && value.getVelocity);
export { isMotionValue };

View File

@@ -0,0 +1,46 @@
#ifndef SIGNAL_H
#define SIGNAL_H
#include <mutex>
#include <condition_variable>
class Signal {
public:
Signal() : mFlag(false), mWaiting(false) {}
void wait() {
std::unique_lock<std::mutex> lock(mMutex);
while (!mFlag) {
mWaiting = true;
mCond.wait(lock);
}
}
std::cv_status waitFor(std::chrono::milliseconds ms) {
std::unique_lock<std::mutex> lock(mMutex);
return mCond.wait_for(lock, ms);
}
void notify() {
std::unique_lock<std::mutex> lock(mMutex);
mFlag = true;
mCond.notify_all();
}
void reset() {
std::unique_lock<std::mutex> lock(mMutex);
mFlag = false;
mWaiting = false;
}
bool isWaiting() {
return mWaiting;
}
private:
bool mFlag;
bool mWaiting;
std::mutex mMutex;
std::condition_variable mCond;
};
#endif

View File

@@ -0,0 +1 @@
!function(e){e.languages.tt2=e.languages.extend("clike",{comment:/#.*|\[%#[\s\S]*?%\]/,keyword:/\b(?:BLOCK|CALL|CASE|CATCH|CLEAR|DEBUG|DEFAULT|ELSE|ELSIF|END|FILTER|FINAL|FOREACH|GET|IF|IN|INCLUDE|INSERT|LAST|MACRO|META|NEXT|PERL|PROCESS|RAWPERL|RETURN|SET|STOP|SWITCH|TAGS|THROW|TRY|UNLESS|USE|WHILE|WRAPPER)\b/,punctuation:/[[\]{},()]/}),e.languages.insertBefore("tt2","number",{operator:/=[>=]?|!=?|<=?|>=?|&&|\|\|?|\b(?:and|not|or)\b/,variable:{pattern:/\b[a-z]\w*(?:\s*\.\s*(?:\d+|\$?[a-z]\w*))*\b/i}}),e.languages.insertBefore("tt2","keyword",{delimiter:{pattern:/^(?:\[%|%%)-?|-?%\]$/,alias:"punctuation"}}),e.languages.insertBefore("tt2","string",{"single-quoted-string":{pattern:/'[^\\']*(?:\\[\s\S][^\\']*)*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"[^\\"]*(?:\\[\s\S][^\\"]*)*"/,greedy:!0,alias:"string",inside:{variable:{pattern:/\$(?:[a-z]\w*(?:\.(?:\d+|\$?[a-z]\w*))*)/i}}}}),delete e.languages.tt2.string,e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"tt2",/\[%[\s\S]+?%\]/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"tt2")}))}(Prism);

View File

@@ -0,0 +1,230 @@
'use strict';
var React = require('react');
var createCache = require('@emotion/cache');
var _extends = require('@babel/runtime/helpers/extends');
var weakMemoize = require('@emotion/weak-memoize');
var _isolatedHnrs_dist_emotionReact_isolatedHnrs = require('../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js');
var utils = require('@emotion/utils');
var serialize = require('@emotion/serialize');
var useInsertionEffectWithFallbacks = require('@emotion/use-insertion-effect-with-fallbacks');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
var createCache__default = /*#__PURE__*/_interopDefault(createCache);
var weakMemoize__default = /*#__PURE__*/_interopDefault(weakMemoize);
var isDevelopment = false;
var EmotionCacheContext = /* #__PURE__ */React__namespace.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
// because this module is primarily intended for the browser and node
// but it's also required in react native and similar environments sometimes
// and we could have a special build just for that
// but this is much easier and the native packages
// might use a different theme context in the future anyway
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache__default["default"]({
key: 'css'
}) : null);
var CacheProvider = EmotionCacheContext.Provider;
var __unsafe_useEmotionCache = function useEmotionCache() {
return React.useContext(EmotionCacheContext);
};
exports.withEmotionCache = function withEmotionCache(func) {
return /*#__PURE__*/React.forwardRef(function (props, ref) {
// the cache will never be null in the browser
var cache = React.useContext(EmotionCacheContext);
return func(props, cache, ref);
});
};
{
exports.withEmotionCache = function withEmotionCache(func) {
return function (props) {
var cache = React.useContext(EmotionCacheContext);
if (cache === null) {
// yes, we're potentially creating this on every render
// it doesn't actually matter though since it's only on the server
// so there will only every be a single render
// that could change in the future because of suspense and etc. but for now,
// this works and i don't want to optimise for a future thing that we aren't sure about
cache = createCache__default["default"]({
key: 'css'
});
return /*#__PURE__*/React__namespace.createElement(EmotionCacheContext.Provider, {
value: cache
}, func(props, cache));
} else {
return func(props, cache);
}
};
};
}
var ThemeContext = /* #__PURE__ */React__namespace.createContext({});
var useTheme = function useTheme() {
return React__namespace.useContext(ThemeContext);
};
var getTheme = function getTheme(outerTheme, theme) {
if (typeof theme === 'function') {
var mergedTheme = theme(outerTheme);
return mergedTheme;
}
return _extends({}, outerTheme, theme);
};
var createCacheWithTheme = /* #__PURE__ */weakMemoize__default["default"](function (outerTheme) {
return weakMemoize__default["default"](function (theme) {
return getTheme(outerTheme, theme);
});
});
var ThemeProvider = function ThemeProvider(props) {
var theme = React__namespace.useContext(ThemeContext);
if (props.theme !== theme) {
theme = createCacheWithTheme(theme)(props.theme);
}
return /*#__PURE__*/React__namespace.createElement(ThemeContext.Provider, {
value: theme
}, props.children);
};
function withTheme(Component) {
var componentName = Component.displayName || Component.name || 'Component';
var WithTheme = /*#__PURE__*/React__namespace.forwardRef(function render(props, ref) {
var theme = React__namespace.useContext(ThemeContext);
return /*#__PURE__*/React__namespace.createElement(Component, _extends({
theme: theme,
ref: ref
}, props));
});
WithTheme.displayName = "WithTheme(" + componentName + ")";
return _isolatedHnrs_dist_emotionReact_isolatedHnrs["default"](WithTheme, Component);
}
var hasOwn = {}.hasOwnProperty;
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
var createEmotionProps = function createEmotionProps(type, props) {
var newProps = {};
for (var _key in props) {
if (hasOwn.call(props, _key)) {
newProps[_key] = props[_key];
}
}
newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:
return newProps;
};
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
utils.registerStyles(cache, serialized, isStringTag);
var rules = useInsertionEffectWithFallbacks.useInsertionEffectAlwaysWithSyncFallback(function () {
return utils.insertStyles(cache, serialized, isStringTag);
});
if (rules !== undefined) {
var _ref2;
var serializedNames = serialized.name;
var next = serialized.next;
while (next !== undefined) {
serializedNames += ' ' + next.name;
next = next.next;
}
return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
__html: rules
}, _ref2.nonce = cache.sheet.nonce, _ref2));
}
return null;
};
var Emotion = /* #__PURE__ */exports.withEmotionCache(function (props, cache, ref) {
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
// not passing the registered cache to serializeStyles because it would
// make certain babel optimisations not possible
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
cssProp = cache.registered[cssProp];
}
var WrappedComponent = props[typePropName];
var registeredStyles = [cssProp];
var className = '';
if (typeof props.className === 'string') {
className = utils.getRegisteredStyles(cache.registered, registeredStyles, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serialize.serializeStyles(registeredStyles, undefined, React__namespace.useContext(ThemeContext));
className += cache.key + "-" + serialized.name;
var newProps = {};
for (var _key2 in props) {
if (hasOwn.call(props, _key2) && _key2 !== 'css' && _key2 !== typePropName && (!isDevelopment )) {
newProps[_key2] = props[_key2];
}
}
newProps.className = className;
if (ref) {
newProps.ref = ref;
}
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof WrappedComponent === 'string'
}), /*#__PURE__*/React__namespace.createElement(WrappedComponent, newProps));
});
var Emotion$1 = Emotion;
exports.CacheProvider = CacheProvider;
exports.Emotion = Emotion$1;
exports.ThemeContext = ThemeContext;
exports.ThemeProvider = ThemeProvider;
exports.__unsafe_useEmotionCache = __unsafe_useEmotionCache;
exports.createEmotionProps = createEmotionProps;
exports.hasOwn = hasOwn;
exports.isDevelopment = isDevelopment;
exports.useTheme = useTheme;
exports.withTheme = withTheme;

View File

@@ -0,0 +1,11 @@
/**
* 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'
const Lexical = process.env.NODE_ENV !== 'production' ? require('./Lexical.dev.js') : require('./Lexical.prod.js');
module.exports = Lexical;

View File

@@ -0,0 +1,76 @@
import type { JWK, KeyLike } from '../types';
export interface PEMImportOptions {
/**
* (Only effective in Web Crypto API runtimes) The value to use as {@link !SubtleCrypto.importKey}
* `extractable` argument. Default is false.
*/
extractable?: boolean;
}
/**
* Imports a PEM-encoded SPKI string as a runtime-specific public key representation
* ({@link !KeyObject} or {@link !CryptoKey}).
*
* Note: The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in
* {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption
* (1.2.840.113549.1.1.1) instead for all RSA algorithms.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/key/import'`.
*
* @param spki PEM-encoded SPKI string
* @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used
* with the imported key, its presence is only enforced in Web Crypto API runtimes. See
* {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
*/
export declare function importSPKI<KeyLikeType extends KeyLike = KeyLike>(spki: string, alg: string, options?: PEMImportOptions): Promise<KeyLikeType>;
/**
* Imports the SPKI from an X.509 string certificate as a runtime-specific public key representation
* ({@link !KeyObject} or {@link !CryptoKey}).
*
* Note: The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in
* {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption
* (1.2.840.113549.1.1.1) instead for all RSA algorithms.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/key/import'`.
*
* @param x509 X.509 certificate string
* @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used
* with the imported key, its presence is only enforced in Web Crypto API runtimes. See
* {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
*/
export declare function importX509<KeyLikeType extends KeyLike = KeyLike>(x509: string, alg: string, options?: PEMImportOptions): Promise<KeyLikeType>;
/**
* Imports a PEM-encoded PKCS#8 string as a runtime-specific private key representation
* ({@link !KeyObject} or {@link !CryptoKey}).
*
* Note: The OID id-RSASSA-PSS (1.2.840.113549.1.1.10) is not supported in
* {@link https://w3c.github.io/webcrypto/ Web Cryptography API}, use the OID rsaEncryption
* (1.2.840.113549.1.1.1) instead for all RSA algorithms.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/key/import'`.
*
* @param pkcs8 PEM-encoded PKCS#8 string
* @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used
* with the imported key, its presence is only enforced in Web Crypto API runtimes. See
* {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
*/
export declare function importPKCS8<KeyLikeType extends KeyLike = KeyLike>(pkcs8: string, alg: string, options?: PEMImportOptions): Promise<KeyLikeType>;
/**
* Imports a JWK to a runtime-specific key representation (KeyLike). Either the JWK "alg"
* (Algorithm) Parameter, or the optional "alg" argument, must be present.
*
* Note: When the runtime is using {@link https://w3c.github.io/webcrypto/ Web Cryptography API} the
* jwk parameters "use", "key_ops", and "ext" are also used in the resulting {@link !CryptoKey}.
*
* This function is exported (as a named export) from the main `'jose'` module entry point as well
* as from its subpath export `'jose/key/import'`.
*
* @param jwk JSON Web Key.
* @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used
* with the imported key. Default is the "alg" property on the JWK, its presence is only enforced
* in Web Crypto API runtimes. See
* {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
*/
export declare function importJWK<KeyLikeType extends KeyLike = KeyLike>(jwk: JWK, alg?: string): Promise<KeyLikeType | Uint8Array>;

View File

@@ -0,0 +1,7 @@
import type { FeedbackInternalOptions } from '@sentry/core';
import type { OptionalFeedbackConfiguration } from '../core/types';
/**
* Quick and dirty deep merge for the Feedback integration options
*/
export declare function mergeOptions(defaultOptions: FeedbackInternalOptions, optionOverrides: OptionalFeedbackConfiguration): FeedbackInternalOptions;
//# sourceMappingURL=mergeOptions.d.ts.map

View File

@@ -0,0 +1,9 @@
import { entityKind } from "./entity.cjs";
import { View } from "./sql/sql.cjs";
import { Subquery } from "./subquery.cjs";
export declare class SelectionProxyHandler<T extends Subquery | Record<string, unknown> | View> implements ProxyHandler<Subquery | Record<string, unknown> | View> {
static readonly [entityKind]: string;
private config;
constructor(config: SelectionProxyHandler<T>['config']);
get(subquery: T, prop: string | symbol): any;
}

View File

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

View File

@@ -0,0 +1,61 @@
import { entityKind } from "../entity.js";
import { TableName } from "../table.utils.js";
function unique(name) {
return new UniqueOnConstraintBuilder(name);
}
function uniqueKeyName(table, columns) {
return `${table[TableName]}_${columns.join("_")}_unique`;
}
class UniqueConstraintBuilder {
constructor(columns, name) {
this.name = name;
this.columns = columns;
}
static [entityKind] = "PgUniqueConstraintBuilder";
/** @internal */
columns;
/** @internal */
nullsNotDistinctConfig = false;
nullsNotDistinct() {
this.nullsNotDistinctConfig = true;
return this;
}
/** @internal */
build(table) {
return new UniqueConstraint(table, this.columns, this.nullsNotDistinctConfig, this.name);
}
}
class UniqueOnConstraintBuilder {
static [entityKind] = "PgUniqueOnConstraintBuilder";
/** @internal */
name;
constructor(name) {
this.name = name;
}
on(...columns) {
return new UniqueConstraintBuilder(columns, this.name);
}
}
class UniqueConstraint {
constructor(table, columns, nullsNotDistinct, name) {
this.table = table;
this.columns = columns;
this.name = name ?? uniqueKeyName(this.table, this.columns.map((column) => column.name));
this.nullsNotDistinct = nullsNotDistinct;
}
static [entityKind] = "PgUniqueConstraint";
columns;
name;
nullsNotDistinct = false;
getName() {
return this.name;
}
}
export {
UniqueConstraint,
UniqueConstraintBuilder,
UniqueOnConstraintBuilder,
unique,
uniqueKeyName
};
//# sourceMappingURL=unique-constraint.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","LineIcon","_jsx","className","fill","height","viewBox","width","xmlns","d","strokeLinecap"],"sources":["../../../src/icons/Line/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport './index.scss'\n\nexport const LineIcon: React.FC = () => (\n <svg\n className=\"icon icon--line\"\n fill=\"none\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n width=\"20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path className=\"stroke\" d=\"M5.33333 10H14.6667\" strokeLinecap=\"square\" />\n </svg>\n)\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAElB,OAAO;AAEP,OAAO,MAAMC,QAAA,GAAqBA,CAAA,kBAChCC,IAAA,CAAC;EACCC,SAAA,EAAU;EACVC,IAAA,EAAK;EACLC,MAAA,EAAO;EACPC,OAAA,EAAQ;EACRC,KAAA,EAAM;EACNC,KAAA,EAAM;YAEN,aAAAN,IAAA,CAAC;IAAKC,SAAA,EAAU;IAASM,CAAA,EAAE;IAAsBC,aAAA,EAAc","ignoreList":[]}

View File

@@ -0,0 +1,4 @@
export declare const endOfDecade: import("./types.js").FPFn1<
Date,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,40 @@
import type { PayloadRequest } from '../types/index.js';
/**
* Increments a filename by appending or incrementing a numeric suffix.
* @example
* incrementName('file.jpg') // 'file-1.jpg'
* incrementName('file-1.jpg') // 'file-2.jpg'
* incrementName('file-99.jpg') // 'file-100.jpg'
*/
export declare const incrementName: (name: string) => string;
type Args = {
collectionSlug: string;
desiredFilename: string;
prefix?: string;
req: PayloadRequest;
staticPath: string;
};
/**
* Generates a safe, unique filename by checking for conflicts in both the database
* and filesystem. If a conflict exists, it increments a numeric suffix until a
* unique name is found.
*
* @param args.collectionSlug - The slug of the upload collection
* @param args.desiredFilename - The original filename to make safe
* @param args.prefix - Optional prefix path for cloud storage adapters
* @param args.req - The Payload request object
* @param args.staticPath - The filesystem path where uploads are stored
* @returns A unique filename that doesn't conflict with existing files
*
* @example
* // If 'photo.jpg' already exists, returns 'photo-1.jpg'
* const safeName = await getSafeFileName({
* collectionSlug: 'media',
* desiredFilename: 'photo.jpg',
* req,
* staticPath: '/uploads/media',
* })
*/
export declare function getSafeFileName({ collectionSlug, desiredFilename, prefix, req, staticPath, }: Args): Promise<string>;
export {};
//# sourceMappingURL=getSafeFilename.d.ts.map

View File

@@ -0,0 +1,73 @@
{
"name": "process-warning",
"version": "5.0.0",
"description": "A small utility for creating warnings and emitting them.",
"main": "index.js",
"type": "commonjs",
"types": "types/index.d.ts",
"scripts": {
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "npm run test:unit && npm run test:jest && npm run test:typescript",
"test:jest": "jest jest.test.js",
"test:unit": "c8 --100 node --test",
"test:typescript": "tsd"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fastify/process-warning.git"
},
"keywords": [
"fastify",
"error",
"warning",
"utility",
"plugin",
"emit",
"once"
],
"author": "Tomas Della Vedova",
"contributors": [
{
"name": "Matteo Collina",
"email": "hello@matteocollina.com"
},
{
"name": "Manuel Spigolon",
"email": "behemoth89@gmail.com"
},
{
"name": "James Sumners",
"url": "https://james.sumners.info"
},
{
"name": "Frazer Smith",
"email": "frazer.dev@icloud.com",
"url": "https://github.com/fdawgs"
}
],
"license": "MIT",
"bugs": {
"url": "https://github.com/fastify/fastify-warning/issues"
},
"homepage": "https://github.com/fastify/fastify-warning#readme",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fastify"
},
{
"type": "opencollective",
"url": "https://opencollective.com/fastify"
}
],
"devDependencies": {
"@fastify/pre-commit": "^2.1.0",
"benchmark": "^2.1.4",
"c8": "^10.1.3",
"eslint": "^9.17.0",
"jest": "^29.7.0",
"neostandard": "^0.12.0",
"tsd": "^0.31.0"
}
}

View File

@@ -0,0 +1,21 @@
/*
* 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.
*/
/* eslint-disable no-restricted-syntax --
* These re-exports are only of constants, only one-level deep at this point,
* and should not cause problems for tree-shakers.
*/
export * from './SemanticAttributes';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,56 @@
import { DynamicSamplingContext } from './envelope';
export type TracePropagationTargets = (string | RegExp)[];
/**
* `PropagationContext` represents the data from an incoming trace. It should be constructed from incoming trace data,
* usually represented by `sentry-trace` and `baggage` HTTP headers.
*
* There is always a propagation context present in the SDK (or rather on Scopes), holding at least a `traceId`. This is
* to ensure that there is always a trace we can attach events onto, even if performance monitoring is disabled. If
* there was no incoming `traceId`, the `traceId` will be generated by the current SDK.
*/
export interface PropagationContext {
/**
* Either represents the incoming `traceId` or the `traceId` generated by the current SDK, if there was no incoming trace.
*/
traceId: string;
/**
* A random between 0 an 1 (including 0, excluding 1) used for sampling in the current execution context.
* This should be newly generated when a new trace is started.
*/
sampleRand: number;
/**
* Represents the sampling decision of the incoming trace.
*
* The current SDK should not modify this value!
*/
sampled?: boolean;
/**
* The `parentSpanId` denotes the ID of the incoming client span. If there is no `parentSpanId` on the propagation
* context, it means that the the incoming trace didn't come from a span.
*
* The current SDK should not modify this value!
*/
parentSpanId?: string;
/**
* A span ID that should be used for the `trace` context of various event types, and for propagation of a `parentSpanId` to downstream services, when performance is disabled or when there is no active span.
* This value should be set by the SDK in an informed way when the same span ID should be used for one unit of execution (e.g. a request, usually tied to the isolation scope).
* If this value is undefined on the propagation context, the SDK will generate a random span ID for `trace` contexts and trace propagation.
*/
propagationSpanId?: string;
/**
* An undefined dsc in the propagation context means that the current SDK invocation is the head of trace and still free to modify and set the DSC for outgoing requests.
*
* The current SDK should not modify this value!
*/
dsc?: Partial<DynamicSamplingContext>;
}
/**
* An object holding trace data, like span and trace ids, sampling decision, and dynamic sampling context
* in a serialized form. Both keys are expected to be used as Http headers or Html meta tags.
*/
export interface SerializedTraceData {
'sentry-trace'?: string;
baggage?: string;
traceparent?: string;
}
//# sourceMappingURL=tracing.d.ts.map

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CircleX = createLucideIcon("CircleX", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
["path", { d: "m9 9 6 6", key: "z0biqf" }]
]);
export { CircleX as default };
//# sourceMappingURL=circle-x.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"message-square-heart.js","sources":["../../../src/icons/message-square-heart.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquareHeart\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTVhMiAyIDAgMCAxLTIgMkg3bC00IDRWNWEyIDIgMCAwIDEgMi0yaDE0YTIgMiAwIDAgMSAyIDJ6IiAvPgogIDxwYXRoIGQ9Ik0xNC44IDcuNWExLjg0IDEuODQgMCAwIDAtMi42IDBsLS4yLjMtLjMtLjNhMS44NCAxLjg0IDAgMSAwLTIuNCAyLjhMMTIgMTNsMi43LTIuN2MuOS0uOS44LTIuMS4xLTIuOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/message-square-heart\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 MessageSquareHeart = createLucideIcon('MessageSquareHeart', [\n ['path', { d: 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z', key: '1lielz' }],\n [\n 'path',\n {\n d: 'M14.8 7.5a1.84 1.84 0 0 0-2.6 0l-.2.3-.3-.3a1.84 1.84 0 1 0-2.4 2.8L12 13l2.7-2.7c.9-.9.8-2.1.1-2.8',\n key: '1blaws',\n },\n ],\n]);\n\nexport default MessageSquareHeart;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC9F,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;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CopyMinus = createLucideIcon("CopyMinus", [
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
]);
export { CopyMinus as default };
//# sourceMappingURL=copy-minus.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"wallpaper.js","sources":["../../../src/icons/wallpaper.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Wallpaper\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iOSIgcj0iMiIgLz4KICA8cGF0aCBkPSJtOSAxNyA2LjEtNi4xYTIgMiAwIDAgMSAyLjgxLjAxTDIyIDE1VjVhMiAyIDAgMCAwLTItMkg0YTIgMiAwIDAgMC0yIDJ2MTBhMiAyIDAgMCAwIDIgMmgxNmEyIDIgMCAwIDAgMi0yIiAvPgogIDxwYXRoIGQ9Ik04IDIxaDgiIC8+CiAgPHBhdGggZD0iTTEyIDE3djQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/wallpaper\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 Wallpaper = createLucideIcon('Wallpaper', [\n ['circle', { cx: '8', cy: '9', r: '2', key: 'gjzl9d' }],\n [\n 'path',\n {\n d: 'm9 17 6.1-6.1a2 2 0 0 1 2.81.01L22 15V5a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2',\n key: '69xh40',\n },\n ],\n ['path', { d: 'M8 21h8', key: '1ev6f3' }],\n ['path', { d: 'M12 17v4', key: '1riwvh' }],\n]);\n\nexport default Wallpaper;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACtD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;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;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,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,181 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const util = require("util");
const memoize = require("./util/memoize");
/** @typedef {import("tapable").Tap} Tap */
/** @typedef {import("./config/defaults").OutputNormalizedWithDefaults} OutputOptions */
/** @typedef {import("./Chunk")} Chunk */
/** @typedef {import("./Compilation")} Compilation */
/** @typedef {import("./Compilation").ChunkHashContext} ChunkHashContext */
/** @typedef {import("./Compilation").Hash} Hash */
/** @typedef {import("./Compilation").RenderManifestEntry} RenderManifestEntry */
/** @typedef {import("./Compilation").RenderManifestOptions} RenderManifestOptions */
/** @typedef {import("./Compilation").Source} Source */
/** @typedef {import("./ModuleTemplate")} ModuleTemplate */
/** @typedef {import("./javascript/JavascriptModulesPlugin").RenderContext} RenderContext */
/**
* @template T
* @typedef {import("tapable").IfSet<T>} IfSet
*/
const getJavascriptModulesPlugin = memoize(() =>
require("./javascript/JavascriptModulesPlugin")
);
// TODO webpack 6 remove this class
class ChunkTemplate {
/**
* @param {OutputOptions} outputOptions output options
* @param {Compilation} compilation the compilation
*/
constructor(outputOptions, compilation) {
this._outputOptions = outputOptions || {};
this.hooks = Object.freeze({
renderManifest: {
tap: util.deprecate(
/**
* @template AdditionalOptions
* @param {string | Tap & IfSet<AdditionalOptions>} options options
* @param {(renderManifestEntries: RenderManifestEntry[], renderManifestOptions: RenderManifestOptions) => RenderManifestEntry[]} fn function
*/
(options, fn) => {
compilation.hooks.renderManifest.tap(
options,
(entries, options) => {
if (options.chunk.hasRuntime()) return entries;
return fn(entries, options);
}
);
},
"ChunkTemplate.hooks.renderManifest is deprecated (use Compilation.hooks.renderManifest instead)",
"DEP_WEBPACK_CHUNK_TEMPLATE_RENDER_MANIFEST"
)
},
modules: {
tap: util.deprecate(
/**
* @template AdditionalOptions
* @param {string | Tap & IfSet<AdditionalOptions>} options options
* @param {(source: Source, moduleTemplate: ModuleTemplate, renderContext: RenderContext) => Source} fn function
*/
(options, fn) => {
getJavascriptModulesPlugin()
.getCompilationHooks(compilation)
.renderChunk.tap(options, (source, renderContext) =>
fn(
source,
compilation.moduleTemplates.javascript,
renderContext
)
);
},
"ChunkTemplate.hooks.modules is deprecated (use JavascriptModulesPlugin.getCompilationHooks().renderChunk instead)",
"DEP_WEBPACK_CHUNK_TEMPLATE_MODULES"
)
},
render: {
tap: util.deprecate(
/**
* @template AdditionalOptions
* @param {string | Tap & IfSet<AdditionalOptions>} options options
* @param {(source: Source, moduleTemplate: ModuleTemplate, renderContext: RenderContext) => Source} fn function
*/
(options, fn) => {
getJavascriptModulesPlugin()
.getCompilationHooks(compilation)
.renderChunk.tap(options, (source, renderContext) =>
fn(
source,
compilation.moduleTemplates.javascript,
renderContext
)
);
},
"ChunkTemplate.hooks.render is deprecated (use JavascriptModulesPlugin.getCompilationHooks().renderChunk instead)",
"DEP_WEBPACK_CHUNK_TEMPLATE_RENDER"
)
},
renderWithEntry: {
tap: util.deprecate(
/**
* @template AdditionalOptions
* @param {string | Tap & IfSet<AdditionalOptions>} options options
* @param {(source: Source, chunk: Chunk) => Source} fn function
*/
(options, fn) => {
getJavascriptModulesPlugin()
.getCompilationHooks(compilation)
.render.tap(options, (source, renderContext) => {
if (
renderContext.chunkGraph.getNumberOfEntryModules(
renderContext.chunk
) === 0 ||
renderContext.chunk.hasRuntime()
) {
return source;
}
return fn(source, renderContext.chunk);
});
},
"ChunkTemplate.hooks.renderWithEntry is deprecated (use JavascriptModulesPlugin.getCompilationHooks().render instead)",
"DEP_WEBPACK_CHUNK_TEMPLATE_RENDER_WITH_ENTRY"
)
},
hash: {
tap: util.deprecate(
/**
* @template AdditionalOptions
* @param {string | Tap & IfSet<AdditionalOptions>} options options
* @param {(hash: Hash) => void} fn function
*/
(options, fn) => {
compilation.hooks.fullHash.tap(options, fn);
},
"ChunkTemplate.hooks.hash is deprecated (use Compilation.hooks.fullHash instead)",
"DEP_WEBPACK_CHUNK_TEMPLATE_HASH"
)
},
hashForChunk: {
tap: util.deprecate(
/**
* @template AdditionalOptions
* @param {string | Tap & IfSet<AdditionalOptions>} options options
* @param {(hash: Hash, chunk: Chunk, chunkHashContext: ChunkHashContext) => void} fn function
*/
(options, fn) => {
getJavascriptModulesPlugin()
.getCompilationHooks(compilation)
.chunkHash.tap(options, (chunk, hash, context) => {
if (chunk.hasRuntime()) return;
fn(hash, chunk, context);
});
},
"ChunkTemplate.hooks.hashForChunk is deprecated (use JavascriptModulesPlugin.getCompilationHooks().chunkHash instead)",
"DEP_WEBPACK_CHUNK_TEMPLATE_HASH_FOR_CHUNK"
)
}
});
}
}
Object.defineProperty(ChunkTemplate.prototype, "outputOptions", {
get: util.deprecate(
/**
* @this {ChunkTemplate}
* @returns {OutputOptions} output options
*/
function outputOptions() {
return this._outputOptions;
},
"ChunkTemplate.outputOptions is deprecated (use Compilation.outputOptions instead)",
"DEP_WEBPACK_CHUNK_TEMPLATE_OUTPUT_OPTIONS"
)
});
module.exports = ChunkTemplate;

View File

@@ -0,0 +1,5 @@
/// <reference types="node" />
/// <reference types="mocha" />
/** only globals that common to node and browsers are allowed */
export declare const _globalThis: typeof globalThis | NodeJS.Global;
//# sourceMappingURL=globalThis.d.ts.map

View File

@@ -0,0 +1,132 @@
import { neon, types } from "@neondatabase/serverless";
import { entityKind } from "../entity.js";
import { DefaultLogger } from "../logger.js";
import { PgDatabase } from "../pg-core/db.js";
import { PgDialect } from "../pg-core/dialect.js";
import { createTableRelationsHelpers, extractTablesRelationalConfig } from "../relations.js";
import { isConfig } from "../utils.js";
import { NeonHttpSession } from "./session.js";
class NeonHttpDriver {
constructor(client, dialect, options = {}) {
this.client = client;
this.dialect = dialect;
this.options = options;
this.initMappers();
}
static [entityKind] = "NeonHttpDriver";
createSession(schema) {
return new NeonHttpSession(this.client, this.dialect, schema, {
logger: this.options.logger,
cache: this.options.cache
});
}
initMappers() {
types.setTypeParser(types.builtins.TIMESTAMPTZ, (val) => val);
types.setTypeParser(types.builtins.TIMESTAMP, (val) => val);
types.setTypeParser(types.builtins.DATE, (val) => val);
types.setTypeParser(types.builtins.INTERVAL, (val) => val);
types.setTypeParser(1231, (val) => val);
types.setTypeParser(1115, (val) => val);
types.setTypeParser(1185, (val) => val);
types.setTypeParser(1187, (val) => val);
types.setTypeParser(1182, (val) => val);
}
}
function wrap(target, token, cb, deep) {
return new Proxy(target, {
get(target2, p) {
const element = target2[p];
if (typeof element !== "function" && (typeof element !== "object" || element === null)) return element;
if (deep) return wrap(element, token, cb);
if (p === "query") return wrap(element, token, cb, true);
return new Proxy(element, {
apply(target3, thisArg, argArray) {
const res = target3.call(thisArg, ...argArray);
if (typeof res === "object" && res !== null && "setToken" in res && typeof res.setToken === "function") {
res.setToken(token);
}
return cb(target3, p, res);
}
});
}
});
}
class NeonHttpDatabase extends PgDatabase {
static [entityKind] = "NeonHttpDatabase";
$withAuth(token) {
this.authToken = token;
return wrap(this, token, (target, p, res) => {
if (p === "with") {
return wrap(res, token, (_, __, res2) => res2);
}
return res;
});
}
async batch(batch) {
return this.session.batch(batch);
}
}
function construct(client, config = {}) {
const dialect = new PgDialect({ casing: config.casing });
let logger;
if (config.logger === true) {
logger = new DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
let schema;
if (config.schema) {
const tablesConfig = extractTablesRelationalConfig(
config.schema,
createTableRelationsHelpers
);
schema = {
fullSchema: config.schema,
schema: tablesConfig.tables,
tableNamesMap: tablesConfig.tableNamesMap
};
}
const driver = new NeonHttpDriver(client, dialect, { logger, cache: config.cache });
const session = driver.createSession(schema);
const db = new NeonHttpDatabase(
dialect,
session,
schema
);
db.$client = client;
db.$cache = config.cache;
if (db.$cache) {
db.$cache["invalidate"] = config.cache?.onMutate;
}
return db;
}
function drizzle(...params) {
if (typeof params[0] === "string") {
const instance = neon(params[0]);
return construct(instance, params[1]);
}
if (isConfig(params[0])) {
const { connection, client, ...drizzleConfig } = params[0];
if (client) return construct(client, drizzleConfig);
if (typeof connection === "object") {
const { connectionString, ...options } = connection;
const instance2 = neon(connectionString, options);
return construct(instance2, drizzleConfig);
}
const instance = neon(connection);
return construct(instance, drizzleConfig);
}
return construct(params[0], params[1]);
}
((drizzle2) => {
function mock(config) {
return construct({}, config);
}
drizzle2.mock = mock;
})(drizzle || (drizzle = {}));
export {
NeonHttpDatabase,
NeonHttpDriver,
drizzle
};
//# sourceMappingURL=driver.js.map

View File

@@ -0,0 +1,11 @@
import { HandlerDataDom } from '@sentry/core';
/**
* Add an instrumentation handler for when a click or a keypress happens.
*
* Use at your own risk, this might break without changelog notice, only used internally.
* @hidden
*/
export declare function addClickKeypressInstrumentationHandler(handler: (data: HandlerDataDom) => void): void;
/** Exported for tests only. */
export declare function instrumentDOM(): void;
//# sourceMappingURL=dom.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleBackToDashboard.js","names":["formatAdminURL","handleBackToDashboard","adminRoute","router","serverURL","redirectRoute","path","push"],"sources":["../../src/utilities/handleBackToDashboard.tsx"],"sourcesContent":["import type { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js'\n\nimport { formatAdminURL } from 'payload/shared'\n\ntype BackToDashboardProps = {\n adminRoute: string\n router: AppRouterInstance\n serverURL?: string\n}\n\nexport const handleBackToDashboard = ({ adminRoute, router, serverURL }: BackToDashboardProps) => {\n const redirectRoute = formatAdminURL({\n adminRoute,\n path: '',\n serverURL,\n })\n router.push(redirectRoute)\n}\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ;AAQ/B,OAAO,MAAMC,qBAAA,GAAwBA,CAAC;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAS,CAAwB;EAC3F,MAAMC,aAAA,GAAgBL,cAAA,CAAe;IACnCE,UAAA;IACAI,IAAA,EAAM;IACNF;EACF;EACAD,MAAA,CAAOI,IAAI,CAACF,aAAA;AACd","ignoreList":[]}

View File

@@ -0,0 +1,55 @@
'use strict'
/**
* A set of property names that indicate the value represents an error object.
*
* @typedef {string[]} K_ERROR_LIKE_KEYS
*/
module.exports = {
DATE_FORMAT: 'yyyy-mm-dd HH:MM:ss.l o',
DATE_FORMAT_SIMPLE: 'HH:MM:ss.l',
/**
* @type {K_ERROR_LIKE_KEYS}
*/
ERROR_LIKE_KEYS: ['err', 'error'],
MESSAGE_KEY: 'msg',
LEVEL_KEY: 'level',
LEVEL_LABEL: 'levelLabel',
TIMESTAMP_KEY: 'time',
LEVELS: {
default: 'USERLVL',
60: 'FATAL',
50: 'ERROR',
40: 'WARN',
30: 'INFO',
20: 'DEBUG',
10: 'TRACE'
},
LEVEL_NAMES: {
fatal: 60,
error: 50,
warn: 40,
info: 30,
debug: 20,
trace: 10
},
// Object keys that probably came from a logger like Pino or Bunyan.
LOGGER_KEYS: [
'pid',
'hostname',
'name',
'level',
'time',
'timestamp',
'caller'
]
}

View File

@@ -0,0 +1,79 @@
import { SQL } from "../sql/sql.js";
import { entityKind } from "../entity.js";
import type { GelColumn, GelExtraConfigColumn } from "./columns/index.js";
import { IndexedColumn } from "./columns/index.js";
import type { GelTable } from "./table.js";
interface IndexConfig {
name?: string;
columns: Partial<IndexedColumn | SQL>[];
/**
* If true, the index will be created as `create unique index` instead of `create index`.
*/
unique: boolean;
/**
* If true, the index will be created as `create index concurrently` instead of `create index`.
*/
concurrently?: boolean;
/**
* If true, the index will be created as `create index ... on only <table>` instead of `create index ... on <table>`.
*/
only: boolean;
/**
* Condition for partial index.
*/
where?: SQL;
/**
* The optional WITH clause specifies storage parameters for the index
*/
with?: Record<string, any>;
/**
* The optional WITH clause method for the index
*/
method?: 'btree' | string;
}
export type IndexColumn = GelColumn;
export type GelIndexMethod = 'btree' | 'hash' | 'gist' | 'sGelist' | 'gin' | 'brin' | 'hnsw' | 'ivfflat' | (string & {});
export type GelIndexOpClass = 'abstime_ops' | 'access_method' | 'anyarray_eq' | 'anyarray_ge' | 'anyarray_gt' | 'anyarray_le' | 'anyarray_lt' | 'anyarray_ne' | 'bigint_ops' | 'bit_ops' | 'bool_ops' | 'box_ops' | 'bpchar_ops' | 'char_ops' | 'cidr_ops' | 'cstring_ops' | 'date_ops' | 'float_ops' | 'int2_ops' | 'int4_ops' | 'int8_ops' | 'interval_ops' | 'jsonb_ops' | 'macaddr_ops' | 'name_ops' | 'numeric_ops' | 'oid_ops' | 'oidint4_ops' | 'oidint8_ops' | 'oidname_ops' | 'oidvector_ops' | 'point_ops' | 'polygon_ops' | 'range_ops' | 'record_eq' | 'record_ge' | 'record_gt' | 'record_le' | 'record_lt' | 'record_ne' | 'text_ops' | 'time_ops' | 'timestamp_ops' | 'timestamptz_ops' | 'timetz_ops' | 'uuid_ops' | 'varbit_ops' | 'varchar_ops' | 'xml_ops' | 'vector_l2_ops' | 'vector_ip_ops' | 'vector_cosine_ops' | 'vector_l1_ops' | 'bit_hamming_ops' | 'bit_jaccard_ops' | 'halfvec_l2_ops' | 'sparsevec_l2_op' | (string & {});
export declare class IndexBuilderOn {
private unique;
private name?;
static readonly [entityKind]: string;
constructor(unique: boolean, name?: string | undefined);
on(...columns: [Partial<GelExtraConfigColumn> | SQL, ...Partial<GelExtraConfigColumn | SQL>[]]): IndexBuilder;
onOnly(...columns: [Partial<GelExtraConfigColumn | SQL>, ...Partial<GelExtraConfigColumn | SQL>[]]): IndexBuilder;
/**
* Specify what index method to use. Choices are `btree`, `hash`, `gist`, `sGelist`, `gin`, `brin`, or user-installed access methods like `bloom`. The default method is `btree.
*
* If you have the `Gel_vector` extension installed in your database, you can use the `hnsw` and `ivfflat` options, which are predefined types.
*
* **You can always specify any string you want in the method, in case Drizzle doesn't have it natively in its types**
*
* @param method The name of the index method to be used
* @param columns
* @returns
*/
using(method: GelIndexMethod, ...columns: [Partial<GelExtraConfigColumn | SQL>, ...Partial<GelExtraConfigColumn | SQL>[]]): IndexBuilder;
}
export interface AnyIndexBuilder {
build(table: GelTable): Index;
}
export interface IndexBuilder extends AnyIndexBuilder {
}
export declare class IndexBuilder implements AnyIndexBuilder {
static readonly [entityKind]: string;
constructor(columns: Partial<IndexedColumn | SQL>[], unique: boolean, only: boolean, name?: string, method?: string);
concurrently(): this;
with(obj: Record<string, any>): this;
where(condition: SQL): this;
}
export declare class Index {
static readonly [entityKind]: string;
readonly config: IndexConfig & {
table: GelTable;
};
constructor(config: IndexConfig, table: GelTable);
}
export type GetColumnsTableName<TColumns> = TColumns extends GelColumn ? TColumns['_']['name'] : TColumns extends GelColumn[] ? TColumns[number]['_']['name'] : never;
export declare function index(name?: string): IndexBuilderOn;
export declare function uniqueIndex(name?: string): IndexBuilderOn;
export {};

View File

@@ -0,0 +1 @@
{"version":3,"names":["_classApplyDescriptorGet","require","_classPrivateFieldGet2","_classPrivateFieldGet","receiver","privateMap","descriptor","classPrivateFieldGet2","classApplyDescriptorGet"],"sources":["../../src/helpers/classPrivateFieldGet.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorGet from \"classApplyDescriptorGet\";\nimport classPrivateFieldGet2 from \"classPrivateFieldGet2\";\nexport default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classPrivateFieldGet2(privateMap, receiver);\n return classApplyDescriptorGet(receiver, descriptor);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACe,SAASE,qBAAqBA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EAClE,IAAIC,UAAU,GAAGC,sBAAqB,CAACF,UAAU,EAAED,QAAQ,CAAC;EAC5D,OAAOI,wBAAuB,CAACJ,QAAQ,EAAEE,UAAU,CAAC;AACtD","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"wrapMiddlewareWithSentry.d.ts","sourceRoot":"","sources":["../../../src/common/wrapMiddlewareWithSentry.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,gBAAgB,EACjE,UAAU,EAAE,CAAC,GACZ,CAAC,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CA4FtD"}

View File

@@ -0,0 +1,13 @@
import { imageType } from './types/index.js';
import { ISizeCalculationResult } from './types/interface.js';
/**
* Return size information based on an Uint8Array
*
* @param {Uint8Array} input
* @returns {ISizeCalculationResult}
*/
declare function imageSize(input: Uint8Array): ISizeCalculationResult;
declare const disableTypes: (types: imageType[]) => void;
export { disableTypes, imageSize };

View File

@@ -0,0 +1,2 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

View File

@@ -0,0 +1,12 @@
import { animations } from '../../motion/features/animations.mjs';
import { createDomVisualElement } from './create-visual-element.mjs';
/**
* @public
*/
const domMin = {
renderer: createDomVisualElement,
...animations,
};
export { domMin };

View File

@@ -0,0 +1,137 @@
const Benchmark = require('benchmark')
const suite = new Benchmark.Suite()
const { inspect } = require('util')
const jsonStringifySafe = require('json-stringify-safe')
const fastSafeStringify = require('./')
const array = new Array(10).fill(0).map((_, i) => i)
const obj = { foo: array }
const circ = JSON.parse(JSON.stringify(obj))
circ.o = { obj: circ, array }
const circGetters = JSON.parse(JSON.stringify(obj))
Object.assign(circGetters, { get o () { return { obj: circGetters, array } } })
const deep = require('./package.json')
deep.deep = JSON.parse(JSON.stringify(deep))
deep.deep.deep = JSON.parse(JSON.stringify(deep))
deep.deep.deep.deep = JSON.parse(JSON.stringify(deep))
deep.array = array
const deepCirc = JSON.parse(JSON.stringify(deep))
deepCirc.deep.deep.deep.circ = deepCirc
deepCirc.deep.deep.circ = deepCirc
deepCirc.deep.circ = deepCirc
deepCirc.array = array
const deepCircGetters = JSON.parse(JSON.stringify(deep))
for (let i = 0; i < 10; i++) {
deepCircGetters[i.toString()] = {
deep: {
deep: {
get circ () { return deep.deep },
deep: { get circ () { return deep.deep.deep } }
},
get circ () { return deep }
},
get array () { return array }
}
}
const deepCircNonCongifurableGetters = JSON.parse(JSON.stringify(deep))
Object.defineProperty(deepCircNonCongifurableGetters.deep.deep.deep, 'circ', {
get: () => deepCircNonCongifurableGetters,
enumerable: true,
configurable: false
})
Object.defineProperty(deepCircNonCongifurableGetters.deep.deep, 'circ', {
get: () => deepCircNonCongifurableGetters,
enumerable: true,
configurable: false
})
Object.defineProperty(deepCircNonCongifurableGetters.deep, 'circ', {
get: () => deepCircNonCongifurableGetters,
enumerable: true,
configurable: false
})
Object.defineProperty(deepCircNonCongifurableGetters, 'array', {
get: () => array,
enumerable: true,
configurable: false
})
suite.add('util.inspect: simple object ', function () {
inspect(obj, { showHidden: false, depth: null })
})
suite.add('util.inspect: circular ', function () {
inspect(circ, { showHidden: false, depth: null })
})
suite.add('util.inspect: circular getters ', function () {
inspect(circGetters, { showHidden: false, depth: null })
})
suite.add('util.inspect: deep ', function () {
inspect(deep, { showHidden: false, depth: null })
})
suite.add('util.inspect: deep circular ', function () {
inspect(deepCirc, { showHidden: false, depth: null })
})
suite.add('util.inspect: large deep circular getters ', function () {
inspect(deepCircGetters, { showHidden: false, depth: null })
})
suite.add('util.inspect: deep non-conf circular getters', function () {
inspect(deepCircNonCongifurableGetters, { showHidden: false, depth: null })
})
suite.add('\njson-stringify-safe: simple object ', function () {
jsonStringifySafe(obj)
})
suite.add('json-stringify-safe: circular ', function () {
jsonStringifySafe(circ)
})
suite.add('json-stringify-safe: circular getters ', function () {
jsonStringifySafe(circGetters)
})
suite.add('json-stringify-safe: deep ', function () {
jsonStringifySafe(deep)
})
suite.add('json-stringify-safe: deep circular ', function () {
jsonStringifySafe(deepCirc)
})
suite.add('json-stringify-safe: large deep circular getters ', function () {
jsonStringifySafe(deepCircGetters)
})
suite.add('json-stringify-safe: deep non-conf circular getters', function () {
jsonStringifySafe(deepCircNonCongifurableGetters)
})
suite.add('\nfast-safe-stringify: simple object ', function () {
fastSafeStringify(obj)
})
suite.add('fast-safe-stringify: circular ', function () {
fastSafeStringify(circ)
})
suite.add('fast-safe-stringify: circular getters ', function () {
fastSafeStringify(circGetters)
})
suite.add('fast-safe-stringify: deep ', function () {
fastSafeStringify(deep)
})
suite.add('fast-safe-stringify: deep circular ', function () {
fastSafeStringify(deepCirc)
})
suite.add('fast-safe-stringify: large deep circular getters ', function () {
fastSafeStringify(deepCircGetters)
})
suite.add('fast-safe-stringify: deep non-conf circular getters', function () {
fastSafeStringify(deepCircNonCongifurableGetters)
})
// add listeners
suite.on('cycle', function (event) {
console.log(String(event.target))
})
suite.on('complete', function () {
console.log('\nFastest is ' + this.filter('fastest').map('name'))
})
suite.run({ delay: 1, minSamples: 150 })

View File

@@ -0,0 +1,28 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { SingleStoreColumnBuilderWithAutoIncrement, SingleStoreColumnWithAutoIncrement } from "./common.cjs";
export type SingleStoreIntBuilderInitial<TName extends string> = SingleStoreIntBuilder<{
name: TName;
dataType: 'number';
columnType: 'SingleStoreInt';
data: number;
driverParam: number | string;
enumValues: undefined;
generated: undefined;
}>;
export declare class SingleStoreIntBuilder<T extends ColumnBuilderBaseConfig<'number', 'SingleStoreInt'>> extends SingleStoreColumnBuilderWithAutoIncrement<T, SingleStoreIntConfig> {
static readonly [entityKind]: string;
constructor(name: T['name'], config?: SingleStoreIntConfig);
}
export declare class SingleStoreInt<T extends ColumnBaseConfig<'number', 'SingleStoreInt'>> extends SingleStoreColumnWithAutoIncrement<T, SingleStoreIntConfig> {
static readonly [entityKind]: string;
getSQLType(): string;
mapFromDriverValue(value: number | string): number;
}
export interface SingleStoreIntConfig {
unsigned?: boolean;
}
export declare function int(): SingleStoreIntBuilderInitial<''>;
export declare function int(config?: SingleStoreIntConfig): SingleStoreIntBuilderInitial<''>;
export declare function int<TName extends string>(name: TName, config?: SingleStoreIntConfig): SingleStoreIntBuilderInitial<TName>;

View File

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

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