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 @@
exports._default = require("./emotion-babel-plugin.cjs.js").default;

View File

@@ -0,0 +1,118 @@
{
"name": "zod",
"version": "3.25.76",
"type": "module",
"author": "Colin McDonnell <zod@colinhacks.com>",
"description": "TypeScript-first schema declaration and validation library with static type inference",
"files": [
"src",
"**/*.js",
"**/*.mjs",
"**/*.cjs",
"**/*.d.ts",
"**/*.d.mts",
"**/*.d.cts"
],
"funding": "https://github.com/sponsors/colinhacks",
"homepage": "https://zod.dev",
"keywords": [
"typescript",
"schema",
"validation",
"type",
"inference"
],
"license": "MIT",
"sideEffects": false,
"main": "./index.cjs",
"types": "./index.d.cts",
"module": "./index.js",
"zshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts",
"./v3": "./src/v3/index.ts",
"./v4": "./src/v4/index.ts",
"./v4-mini": "./src/v4-mini/index.ts",
"./v4/mini": "./src/v4/mini/index.ts",
"./v4/core": "./src/v4/core/index.ts",
"./v4/locales": "./src/v4/locales/index.ts",
"./v4/locales/*": "./src/v4/locales/*"
},
"sourceDialects": [
"@zod/source"
]
},
"exports": {
"./package.json": "./package.json",
".": {
"@zod/source": "./src/index.ts",
"types": "./index.d.cts",
"import": "./index.js",
"require": "./index.cjs"
},
"./v3": {
"@zod/source": "./src/v3/index.ts",
"types": "./v3/index.d.cts",
"import": "./v3/index.js",
"require": "./v3/index.cjs"
},
"./v4": {
"@zod/source": "./src/v4/index.ts",
"types": "./v4/index.d.cts",
"import": "./v4/index.js",
"require": "./v4/index.cjs"
},
"./v4-mini": {
"@zod/source": "./src/v4-mini/index.ts",
"types": "./v4-mini/index.d.cts",
"import": "./v4-mini/index.js",
"require": "./v4-mini/index.cjs"
},
"./v4/mini": {
"@zod/source": "./src/v4/mini/index.ts",
"types": "./v4/mini/index.d.cts",
"import": "./v4/mini/index.js",
"require": "./v4/mini/index.cjs"
},
"./v4/core": {
"@zod/source": "./src/v4/core/index.ts",
"types": "./v4/core/index.d.cts",
"import": "./v4/core/index.js",
"require": "./v4/core/index.cjs"
},
"./v4/locales": {
"@zod/source": "./src/v4/locales/index.ts",
"types": "./v4/locales/index.d.cts",
"import": "./v4/locales/index.js",
"require": "./v4/locales/index.cjs"
},
"./v4/locales/*": {
"@zod/source": "./src/v4/locales/*",
"types": "./v4/locales/*",
"import": "./v4/locales/*",
"require": "./v4/locales/*"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/colinhacks/zod.git"
},
"bugs": {
"url": "https://github.com/colinhacks/zod/issues"
},
"support": {
"backing": {
"npm-funding": true
}
},
"scripts": {
"clean": "git clean -xdf . -e node_modules",
"build": "zshy --project tsconfig.build.json",
"postbuild": "pnpm biome check --write .",
"test:watch": "pnpm vitest",
"test": "pnpm vitest run",
"bump:beta": "pnpm version \"v$(pnpm pkg get version | jq -r)-beta.$(date +%Y%m%dT%H%M%S)\"",
"pub:beta": "pnpm bump:beta && pnpm publish --tag next --publish-branch v4 --no-git-checks --dry-run"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/forms/RowLabel/Context/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI;IAC/B,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAQD,KAAK,KAAK,CAAC,CAAC,IAAI;IACd,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACnC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAEjC,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAUrD,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,CAAC,OACG,YAAY,CAAC,CAAC,CAC7C,CAAA"}

View File

@@ -0,0 +1,8 @@
import { DiagLogger } from '../types';
/**
* Returns a No-Op Diagnostic logger where all messages do nothing.
* @implements {@link DiagLogger}
* @returns {DiagLogger}
*/
export declare function createNoopDiagLogger(): DiagLogger;
//# sourceMappingURL=noopLogger.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_arrayWithHoles","require","_iterableToArray","_unsupportedIterableToArray","_nonIterableRest","_toArray","arr","arrayWithHoles","iterableToArray","unsupportedIterableToArray","nonIterableRest"],"sources":["../../src/helpers/toArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayWithHoles from \"./arrayWithHoles.ts\";\nimport iterableToArray from \"./iterableToArray.ts\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n// @ts-expect-error nonIterableRest is still being converted to TS.\nimport nonIterableRest from \"./nonIterableRest.ts\";\n\nexport default function _toArray<T>(arr: any): T[] {\n return (\n arrayWithHoles<T>(arr) ||\n iterableToArray<T>(arr) ||\n unsupportedIterableToArray<T>(arr) ||\n nonIterableRest()\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAEe,SAASI,QAAQA,CAAIC,GAAQ,EAAO;EACjD,OACE,IAAAC,uBAAc,EAAID,GAAG,CAAC,IACtB,IAAAE,wBAAe,EAAIF,GAAG,CAAC,IACvB,IAAAG,mCAA0B,EAAIH,GAAG,CAAC,IAClC,IAAAI,wBAAe,EAAC,CAAC;AAErB","ignoreList":[]}

View File

@@ -0,0 +1,17 @@
import type { ClientCollectionConfig, TypeWithID } from 'payload';
import React from 'react';
import './index.scss';
export type ThumbnailCardProps = {
alignLabel?: 'center' | 'left';
className?: string;
collection?: ClientCollectionConfig;
doc?: {
filename?: string;
} & TypeWithID;
label?: string;
onClick?: () => void;
onKeyDown?: () => void;
thumbnail: React.ReactNode;
};
export declare const ThumbnailCard: React.FC<ThumbnailCardProps>;
//# sourceMappingURL=index.d.ts.map

View File

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

View File

@@ -0,0 +1,8 @@
import arrayWithHoles from "./arrayWithHoles.js";
import iterableToArray from "./iterableToArray.js";
import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
import nonIterableRest from "./nonIterableRest.js";
function _toArray(r) {
return arrayWithHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableRest();
}
export { _toArray as default };

View File

@@ -0,0 +1 @@
{"version":3,"file":"password-request.cjs","names":[],"sources":["../../../../src/rest/commands/auth/password-request.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\n\n/**\n * Request a password reset email to be sent to the given user.\n *\n * @param email Email address of the user you're requesting a password reset for.\n * @param reset_url Provide a custom reset url which the link in the email will lead to. The reset token will be passed as a parameter.\n *\n * @returns Empty body.\n */\nexport const passwordRequest =\n\t<Schema>(email: string, reset_url?: string): RestCommand<void, Schema> =>\n\t() => ({\n\t\tpath: '/auth/password/request',\n\t\tmethod: 'POST',\n\t\tbody: JSON.stringify({ email, ...(reset_url ? { reset_url } : {}) }),\n\t});\n"],"mappings":"AAUA,MAAa,GACH,EAAe,SACjB,CACN,KAAM,yBACN,OAAQ,OACR,KAAM,KAAK,UAAU,CAAE,QAAO,GAAI,EAAY,CAAE,YAAW,CAAG,EAAE,CAAG,CAAC,CACpE"}

View File

@@ -0,0 +1,25 @@
import type { PaginatedDocs } from '../../database/types.js';
import type { CollectionSlug, FindOptions, JoinQuery } from '../../index.js';
import type { PayloadRequest, PopulateType, SelectType, Sort, TransformCollectionWithSelect, Where } from '../../types/index.js';
import type { Collection, SelectFromCollectionSlug } from '../config/types.js';
export type Arguments = {
collection: Collection;
currentDepth?: number;
depth?: number;
disableErrors?: boolean;
draft?: boolean;
includeLockStatus?: boolean;
joins?: JoinQuery;
limit?: number;
overrideAccess?: boolean;
page?: number;
pagination?: boolean;
populate?: PopulateType;
req?: PayloadRequest;
showHiddenFields?: boolean;
sort?: Sort;
trash?: boolean;
where?: Where;
} & Pick<FindOptions<string, SelectType>, 'select'>;
export declare const findOperation: <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug>>(incomingArgs: Arguments) => Promise<PaginatedDocs<TransformCollectionWithSelect<TSlug, TSelect>>>;
//# sourceMappingURL=find.d.ts.map

View File

@@ -0,0 +1,3 @@
import { DeepModify } from "../deep-modify";
import { DeepPick } from "../deep-pick";
export type StrictDeepPick<Type, Filter extends DeepModify<Type>> = DeepPick<Type, Filter>;

View File

@@ -0,0 +1,28 @@
/**
*
* utils
*
*/
/** @private */
export function extendedTypeof(val) {
if (val === null) {
return 'null';
}
if (Array.isArray(val)) {
return 'array';
}
return typeof val;
}
/** @private */
export function isObject(val) {
return typeof val === 'object' && val !== null;
}
/** @private */
export function isExecutionResult(val) {
return (isObject(val) &&
('data' in val || ('data' in val && val.data == null && 'errors' in val)));
}
/** @private */
export function isAsyncIterable(val) {
return typeof Object(val)[Symbol.asyncIterator] === 'function';
}

View File

@@ -0,0 +1,4 @@
import type { MigrationConfig } from "../migrator.js";
import type { PgRemoteDatabase } from "./driver.js";
export type ProxyMigrator = (migrationQueries: string[]) => Promise<void>;
export declare function migrate<TSchema extends Record<string, unknown>>(db: PgRemoteDatabase<TSchema>, callback: ProxyMigrator, config: MigrationConfig): Promise<void>;

View File

@@ -0,0 +1,183 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const util = require("util");
const deprecateContext = util.deprecate(
() => {},
"Hook.context is deprecated and will be removed"
);
function CALL_DELEGATE(...args) {
this.call = this._createCall("sync");
return this.call(...args);
}
function CALL_ASYNC_DELEGATE(...args) {
this.callAsync = this._createCall("async");
return this.callAsync(...args);
}
function PROMISE_DELEGATE(...args) {
this.promise = this._createCall("promise");
return this.promise(...args);
}
class Hook {
constructor(args = [], name = undefined) {
this._args = args;
this.name = name;
this.taps = [];
this.interceptors = [];
this._call = CALL_DELEGATE;
this.call = CALL_DELEGATE;
this._callAsync = CALL_ASYNC_DELEGATE;
this.callAsync = CALL_ASYNC_DELEGATE;
this._promise = PROMISE_DELEGATE;
this.promise = PROMISE_DELEGATE;
this._x = undefined;
// eslint-disable-next-line no-self-assign
this.compile = this.compile;
// eslint-disable-next-line no-self-assign
this.tap = this.tap;
// eslint-disable-next-line no-self-assign
this.tapAsync = this.tapAsync;
// eslint-disable-next-line no-self-assign
this.tapPromise = this.tapPromise;
}
compile(_options) {
throw new Error("Abstract: should be overridden");
}
_createCall(type) {
return this.compile({
taps: this.taps,
interceptors: this.interceptors,
args: this._args,
type
});
}
_tap(type, options, fn) {
if (typeof options === "string") {
options = {
name: options.trim()
};
} else if (typeof options !== "object" || options === null) {
throw new Error("Invalid tap options");
}
if (typeof options.name !== "string" || options.name === "") {
throw new Error("Missing name for tap");
}
if (typeof options.context !== "undefined") {
deprecateContext();
}
options = Object.assign({ type, fn }, options);
options = this._runRegisterInterceptors(options);
this._insert(options);
}
tap(options, fn) {
this._tap("sync", options, fn);
}
tapAsync(options, fn) {
this._tap("async", options, fn);
}
tapPromise(options, fn) {
this._tap("promise", options, fn);
}
_runRegisterInterceptors(options) {
for (const interceptor of this.interceptors) {
if (interceptor.register) {
const newOptions = interceptor.register(options);
if (newOptions !== undefined) {
options = newOptions;
}
}
}
return options;
}
withOptions(options) {
const mergeOptions = (opt) =>
Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt);
return {
name: this.name,
tap: (opt, fn) => this.tap(mergeOptions(opt), fn),
tapAsync: (opt, fn) => this.tapAsync(mergeOptions(opt), fn),
tapPromise: (opt, fn) => this.tapPromise(mergeOptions(opt), fn),
intercept: (interceptor) => this.intercept(interceptor),
isUsed: () => this.isUsed(),
withOptions: (opt) => this.withOptions(mergeOptions(opt))
};
}
isUsed() {
return this.taps.length > 0 || this.interceptors.length > 0;
}
intercept(interceptor) {
this._resetCompilation();
this.interceptors.push(Object.assign({}, interceptor));
if (interceptor.register) {
for (let i = 0; i < this.taps.length; i++) {
this.taps[i] = interceptor.register(this.taps[i]);
}
}
}
_resetCompilation() {
this.call = this._call;
this.callAsync = this._callAsync;
this.promise = this._promise;
}
_insert(item) {
this._resetCompilation();
let before;
if (typeof item.before === "string") {
before = new Set([item.before]);
} else if (Array.isArray(item.before)) {
before = new Set(item.before);
}
let stage = 0;
if (typeof item.stage === "number") {
stage = item.stage;
}
let i = this.taps.length;
while (i > 0) {
i--;
const tap = this.taps[i];
this.taps[i + 1] = tap;
const xStage = tap.stage || 0;
if (before) {
if (before.has(tap.name)) {
before.delete(tap.name);
continue;
}
if (before.size > 0) {
continue;
}
}
if (xStage > stage) {
continue;
}
i++;
break;
}
this.taps[i] = item;
}
}
Object.setPrototypeOf(Hook.prototype, null);
module.exports = Hook;

View File

@@ -0,0 +1,32 @@
import { toDate } from "./toDate.mjs";
/**
* @name endOfYear
* @category Year Helpers
* @summary Return the end of a year for the given date.
*
* @description
* Return the end of a year for the given date.
* The result will be in the local timezone.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The end of a year
*
* @example
* // The end of a year for 2 September 2014 11:55:00:
* const result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))
* //=> Wed Dec 31 2014 23:59:59.999
*/
export function endOfYear(date) {
const _date = toDate(date);
const year = _date.getFullYear();
_date.setFullYear(year + 1, 0, 0);
_date.setHours(23, 59, 59, 999);
return _date;
}
// Fallback for modularized imports:
export default endOfYear;

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.05012,"78":0.00358,"112":0.00358,"115":0.04654,"121":0.00358,"127":0.00358,"128":0.00358,"134":0.00358,"140":0.00716,"144":0.00358,"145":0.49404,"146":0.66946,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 120 122 123 124 125 126 129 130 131 132 133 135 136 137 138 139 141 142 143 147 148 149 3.5 3.6"},D:{"43":0.00716,"47":0.00358,"63":0.00358,"69":0.05012,"74":0.00358,"75":0.00716,"78":0.01074,"79":0.05728,"83":0.00358,"86":0.01074,"87":0.03222,"88":0.02506,"91":0.00358,"92":0.01074,"93":0.00358,"94":0.02506,"97":0.00358,"103":0.03222,"104":0.01074,"105":0.01074,"106":0.01432,"107":0.00716,"108":0.01432,"109":0.26134,"110":0.00716,"111":0.34368,"112":0.00716,"116":0.03938,"117":0.04654,"119":0.00358,"120":0.02506,"122":0.0537,"123":0.01074,"124":0.01432,"125":0.29714,"126":0.20764,"127":0.0179,"128":0.00358,"129":0.00716,"130":0.03938,"131":0.1432,"132":0.08234,"133":0.0358,"134":0.02148,"135":0.01432,"136":0.00716,"137":0.02864,"138":0.0537,"139":0.11814,"140":0.03938,"141":0.1253,"142":4.41414,"143":7.27098,"144":0.00358,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 64 65 66 67 68 70 71 72 73 76 77 80 81 84 85 89 90 95 96 98 99 100 101 102 113 114 115 118 121 145 146"},F:{"84":0.00358,"92":0.00358,"93":0.08592,"94":0.01432,"95":0.01074,"123":0.00358,"124":0.2506,"125":0.08234,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 85 86 87 88 89 90 91 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"15":0.00358,"18":0.00358,"92":0.03222,"100":0.01432,"109":0.00716,"112":0.04654,"113":0.00716,"115":0.00358,"121":0.00358,"122":0.00716,"126":0.00716,"127":0.00358,"131":0.00716,"133":0.00358,"134":0.00358,"135":0.01432,"136":0.00358,"137":0.0358,"138":0.33652,"139":0.00358,"140":0.01432,"141":0.06086,"142":0.93796,"143":3.44038,_:"12 13 14 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 114 116 117 118 119 120 123 124 125 128 129 130 132"},E:{"14":0.00358,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 15.4 15.5 16.0 16.4 17.3 26.3","14.1":0.00358,"15.2-15.3":0.02148,"15.6":0.179,"16.1":0.00358,"16.2":0.00358,"16.3":0.00716,"16.5":0.02506,"16.6":0.1969,"17.0":0.03938,"17.1":0.0358,"17.2":0.01432,"17.4":0.01074,"17.5":0.00358,"17.6":0.26492,"18.0":0.00358,"18.1":0.02148,"18.2":0.00358,"18.3":0.02506,"18.4":0.00716,"18.5-18.6":0.09666,"26.0":0.04654,"26.1":0.27924,"26.2":0.07518},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00167,"5.0-5.1":0,"6.0-6.1":0.00334,"7.0-7.1":0.00251,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00668,"10.0-10.2":0.00084,"10.3":0.01169,"11.0-11.2":0.14364,"11.3-11.4":0.00418,"12.0-12.1":0.00334,"12.2-12.5":0.03758,"13.0-13.1":0.00084,"13.2":0.00585,"13.3":0.00167,"13.4-13.7":0.00585,"14.0-14.4":0.01169,"14.5-14.8":0.01253,"15.0-15.1":0.01336,"15.2-15.3":0.01002,"15.4":0.01086,"15.5":0.01169,"15.6-15.8":0.18122,"16.0":0.02088,"16.1":0.04009,"16.2":0.02088,"16.3":0.03758,"16.4":0.00919,"16.5":0.01587,"16.6-16.7":0.2355,"17.0":0.01336,"17.1":0.02171,"17.2":0.01587,"17.3":0.02422,"17.4":0.04092,"17.5":0.08017,"17.6-17.7":0.18539,"18.0":0.04176,"18.1":0.08685,"18.2":0.04593,"18.3":0.14949,"18.4":0.07683,"18.5-18.7":5.51675,"26.0":0.10773,"26.1":0.89608,"26.2":0.17036,"26.3":0.00752},P:{"4":0.02074,"20":0.03111,"21":0.03111,"22":0.14516,"23":0.27995,"24":0.40438,"25":0.70507,"26":0.20737,"27":0.82949,"28":1.87672,"29":4.98732,"5.0-5.4":0.01037,_:"6.2-6.4 8.2 10.1 11.1-11.2 12.0 14.0 16.0 17.0 18.0","7.2-7.4":0.41475,"9.2":0.01037,"13.0":0.02074,"15.0":0.01037,"19.0":0.04147},I:{"0":0.02563,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},A:{"11":0.11456,_:"6 7 8 9 10 5.5"},K:{"0":0.19899,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.00642},O:{"0":0.0321},H:{"0":0},L:{"0":57.4714},R:{_:"0"},M:{"0":0.21825}};

View File

@@ -0,0 +1,14 @@
export type { EmotionCache } from '@emotion/cache';
export type { ArrayInterpolation, ComponentSelector, CSSObject, FunctionInterpolation, Interpolation, Keyframes, SerializedStyles } from '@emotion/serialize';
export { withEmotionCache, CacheProvider, __unsafe_useEmotionCache } from "./context.js";
export { jsx } from "./jsx.js";
export { jsx as createElement } from "./jsx.js";
export { Global } from "./global.js";
export type { GlobalProps } from "./global.js";
export { keyframes } from "./keyframes.js";
export { ClassNames } from "./class-names.js";
export type { ClassNamesArg, ClassNamesContent, ClassNamesProps, ArrayClassNamesArg } from "./class-names.js";
export { ThemeContext, useTheme, ThemeProvider, withTheme } from "./theming.js";
export type { Theme, ThemeProviderProps, WithTheme } from "./theming.js";
export { default as css } from "./css.js";
export type { DistributiveOmit, PropsOf } from "./types.js";

View File

@@ -0,0 +1,165 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
// All data for localization are taken from this page
// https://www.unicode.org/cldr/charts/32/summary/id.html
const eraValues = {
narrow: ["SM", "M"],
abbreviated: ["SM", "M"],
wide: ["Sebelum Masehi", "Masehi"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["Kuartal ke-1", "Kuartal ke-2", "Kuartal ke-3", "Kuartal ke-4"],
};
// Note: in Indonesian, 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", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"Mei",
"Jun",
"Jul",
"Agt",
"Sep",
"Okt",
"Nov",
"Des",
],
wide: [
"Januari",
"Februari",
"Maret",
"April",
"Mei",
"Juni",
"Juli",
"Agustus",
"September",
"Oktober",
"November",
"Desember",
],
};
const dayValues = {
narrow: ["M", "S", "S", "R", "K", "J", "S"],
short: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"],
abbreviated: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"],
wide: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"],
};
const dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam",
},
wide: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam",
},
wide: {
am: "AM",
pm: "PM",
midnight: "tengah malam",
noon: "tengah hari",
morning: "pagi",
afternoon: "siang",
evening: "sore",
night: "malam",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
// Can't use "pertama", "kedua" because can't be parsed
return "ke-" + number;
};
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,"file":"satellite-dish.js","sources":["../../../src/icons/satellite-dish.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SatelliteDish\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAxMGE3LjMxIDcuMzEgMCAwIDAgMTAgMTBaIiAvPgogIDxwYXRoIGQ9Im05IDE1IDMtMyIgLz4KICA8cGF0aCBkPSJNMTcgMTNhNiA2IDAgMCAwLTYtNiIgLz4KICA8cGF0aCBkPSJNMjEgMTNBMTAgMTAgMCAwIDAgMTEgMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/satellite-dish\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 SatelliteDish = createLucideIcon('SatelliteDish', [\n ['path', { d: 'M4 10a7.31 7.31 0 0 0 10 10Z', key: '1fzpp3' }],\n ['path', { d: 'm9 15 3-3', key: '88sc13' }],\n ['path', { d: 'M17 13a6 6 0 0 0-6-6', key: '15cc6u' }],\n ['path', { d: 'M21 13A10 10 0 0 0 11 3', key: '11nf8s' }],\n]);\n\nexport default SatelliteDish;\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,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,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,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,128 @@
import type { Primitive } from '../types-hoist/misc';
import type { ParameterizedString } from '../types-hoist/parameterize';
import type { PolymorphicEvent } from '../types-hoist/polymorphics';
import type { VNode, VueViewModel } from '../types-hoist/vue';
/**
* Checks whether given value's type is one of a few Error or Error-like
* {@link isError}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isError(wat: unknown): wat is Error;
/**
* Checks whether given value's type is ErrorEvent
* {@link isErrorEvent}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isErrorEvent(wat: unknown): boolean;
/**
* Checks whether given value's type is DOMError
* {@link isDOMError}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isDOMError(wat: unknown): boolean;
/**
* Checks whether given value's type is DOMException
* {@link isDOMException}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isDOMException(wat: unknown): boolean;
/**
* Checks whether given value's type is a string
* {@link isString}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isString(wat: unknown): wat is string;
/**
* Checks whether given string is parameterized
* {@link isParameterizedString}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isParameterizedString(wat: unknown): wat is ParameterizedString;
/**
* Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
* {@link isPrimitive}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isPrimitive(wat: unknown): wat is Primitive;
/**
* Checks whether given value's type is an object literal, or a class instance.
* {@link isPlainObject}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isPlainObject(wat: unknown): wat is Record<string, unknown>;
/**
* Checks whether given value's type is an Event instance
* {@link isEvent}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isEvent(wat: unknown): wat is PolymorphicEvent;
/**
* Checks whether given value's type is an Element instance
* {@link isElement}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isElement(wat: unknown): boolean;
/**
* Checks whether given value's type is an regexp
* {@link isRegExp}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isRegExp(wat: unknown): wat is RegExp;
/**
* Checks whether given value has a then function.
* @param wat A value to be checked.
*/
export declare function isThenable(wat: any): wat is PromiseLike<any>;
/**
* Checks whether given value's type is a SyntheticEvent
* {@link isSyntheticEvent}.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isSyntheticEvent(wat: unknown): boolean;
/**
* Checks whether given value's type is an instance of provided constructor.
* {@link isInstanceOf}.
*
* @param wat A value to be checked.
* @param base A constructor to be used in a check.
* @returns A boolean representing the result.
*/
export declare function isInstanceOf<T>(wat: any, base: any): wat is T;
/**
* Checks whether given value's type is a Vue ViewModel or a VNode.
*
* @param wat A value to be checked.
* @returns A boolean representing the result.
*/
export declare function isVueViewModel(wat: unknown): wat is VueViewModel | VNode;
/**
* Checks whether the given parameter is a Standard Web API Request instance.
*
* Returns false if Request is not available in the current runtime.
*/
export declare function isRequest(request: unknown): request is Request;
//# sourceMappingURL=is.d.ts.map

View File

@@ -0,0 +1,36 @@
import { CSSValue } from './syntax/parser';
import { CSSTypes } from './types';
import { Context } from '../core/context';
export declare const enum PropertyDescriptorParsingType {
VALUE = 0,
LIST = 1,
IDENT_VALUE = 2,
TYPE_VALUE = 3,
TOKEN_VALUE = 4
}
export interface IPropertyDescriptor {
name: string;
type: PropertyDescriptorParsingType;
initialValue: string;
prefix: boolean;
}
export interface IPropertyIdentValueDescriptor<T> extends IPropertyDescriptor {
type: PropertyDescriptorParsingType.IDENT_VALUE;
parse: (context: Context, token: string) => T;
}
export interface IPropertyTypeValueDescriptor extends IPropertyDescriptor {
type: PropertyDescriptorParsingType.TYPE_VALUE;
format: CSSTypes;
}
export interface IPropertyValueDescriptor<T> extends IPropertyDescriptor {
type: PropertyDescriptorParsingType.VALUE;
parse: (context: Context, token: CSSValue) => T;
}
export interface IPropertyListDescriptor<T> extends IPropertyDescriptor {
type: PropertyDescriptorParsingType.LIST;
parse: (context: Context, tokens: CSSValue[]) => T;
}
export interface IPropertyTokenValueDescriptor extends IPropertyDescriptor {
type: PropertyDescriptorParsingType.TOKEN_VALUE;
}
export declare type CSSPropertyDescriptor<T> = IPropertyValueDescriptor<T> | IPropertyListDescriptor<T> | IPropertyIdentValueDescriptor<T> | IPropertyTypeValueDescriptor | IPropertyTokenValueDescriptor;

View File

@@ -0,0 +1,8 @@
"use strict";
exports.constructFromSymbol = void 0;
/**
* The symbol to access the `TZDate`'s function to construct a new instance from
* the provided value. It helps date-fns to inherit the time zone.
*/
const constructFromSymbol = exports.constructFromSymbol = Symbol.for("constructDateFrom");

View File

@@ -0,0 +1,23 @@
/*
* 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.
*/
export { getStringFromEnv, getBooleanFromEnv, getNumberFromEnv, getStringListFromEnv, } from './environment';
export { _globalThis } from '../../common/globalThis';
export { SDK_INFO } from './sdk-info';
/**
* @deprecated Use performance directly.
*/
export const otperformance = performance;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getRequestLocale.d.ts","sourceRoot":"","sources":["../../src/utilities/getRequestLocale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAOrD,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,wBAAsB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BtF"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/index.ts"],"names":[],"mappings":";;AACA,qCAAoC;AAEpC,MAAM,MAAM,GAAe,CAAC,gBAAa,CAAC,CAAA;AAE1C,kBAAe,MAAM,CAAA"}

View File

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

View File

@@ -0,0 +1,16 @@
import type { I18n } from '@payloadcms/translations';
import type { ClientConfig, ClientFieldSchemaMap, FieldSchemaMap, Payload } from 'payload';
/**
* Flattens the config fields into a map of field schemas
*/
export declare const buildClientFieldSchemaMap: (args: {
collectionSlug?: string;
config: ClientConfig;
globalSlug?: string;
i18n: I18n;
payload: Payload;
schemaMap: FieldSchemaMap;
}) => {
clientFieldSchemaMap: ClientFieldSchemaMap;
};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,18 @@
export declare function parseJson(s: string, pos: number): unknown;
export declare namespace parseJson {
var message: string | undefined;
var position: number;
var code: string;
}
export declare function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined;
export declare namespace parseJsonNumber {
var message: string | undefined;
var position: number;
var code: string;
}
export declare function parseJsonString(s: string, pos: number): string | undefined;
export declare namespace parseJsonString {
var message: string | undefined;
var position: number;
var code: string;
}

View File

@@ -0,0 +1,19 @@
import { BestAvailableLocale } from './BestAvailableLocale';
import { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils';
/**
* https://tc39.es/ecma402/#sec-lookupsupportedlocales
* @param availableLocales
* @param requestedLocales
*/
export function LookupSupportedLocales(availableLocales, requestedLocales) {
var subset = [];
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
var locale = requestedLocales_1[_i];
var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');
var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
if (availableLocale) {
subset.push(availableLocale);
}
}
return subset;
}

View File

@@ -0,0 +1,17 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var subquery_exports = {};
module.exports = __toCommonJS(subquery_exports);
//# sourceMappingURL=subquery.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"file-plus-2.js","sources":["../../../src/icons/file-plus-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FilePlus2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2NCIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJNMyAxNWg2IiAvPgogIDxwYXRoIGQ9Ik02IDEydjYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/file-plus-2\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 FilePlus2 = createLucideIcon('FilePlus2', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4', key: '1pf5j1' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'M3 15h6', key: '4e2qda' }],\n ['path', { d: 'M6 12v6', key: '1u72j0' }],\n]);\n\nexport default FilePlus2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAChF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"graphql.js","names":[],"sources":["../../../../src/rest/commands/server/graphql.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\n\n/**\n * Retrieve the GraphQL SDL for the current project.\n * @returns GraphQL SDL.\n */\nexport const readGraphqlSdl =\n\t<Schema>(scope: 'item' | 'system' = 'item'): RestCommand<string, Schema> =>\n\t() => ({\n\t\tmethod: 'GET',\n\t\tpath: scope === 'item' ? '/server/specs/graphql' : '/server/specs/graphql/system',\n\t});\n"],"mappings":"AAMA,MAAa,GACH,EAA2B,cAC7B,CACN,OAAQ,MACR,KAAM,IAAU,OAAS,wBAA0B,+BACnD"}

View File

@@ -0,0 +1,21 @@
/**
* Method configuration and request processing for MCP server instrumentation
*/
/**
* Extracts target info from method and params based on method type
* @param method - MCP method name
* @param params - Method parameters
* @returns Target name and attributes for span instrumentation
*/
export declare function extractTargetInfo(method: string, params: Record<string, unknown>): {
target?: string;
attributes: Record<string, string>;
};
/**
* Extracts request arguments based on method type
* @param method - MCP method name
* @param params - Method parameters
* @returns Arguments as span attributes with mcp.request.argument prefix
*/
export declare function getRequestArguments(method: string, params: Record<string, unknown>): Record<string, string>;
//# sourceMappingURL=methodConfig.d.ts.map

View File

@@ -0,0 +1,40 @@
const formatRelativeLocale = {
lastWeek: (date) => {
switch (date.getDay()) {
case 0:
return "'prošle nedelje u' p";
case 3:
return "'prošle srede u' p";
case 6:
return "'prošle subote u' p";
default:
return "'prošli' EEEE 'u' p";
}
},
yesterday: "'juče u' p",
today: "'danas u' p",
tomorrow: "'sutra u' p",
nextWeek: (date) => {
switch (date.getDay()) {
case 0:
return "'sledeće nedelje u' p";
case 3:
return "'sledeću sredu u' p";
case 6:
return "'sledeću subotu u' p";
default:
return "'sledeći' EEEE 'u' p";
}
},
other: "P",
};
export const formatRelative = (token, date, _baseDate, _options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date);
}
return format;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"linkedin.js","sources":["../../../src/icons/linkedin.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Linkedin\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgOGE2IDYgMCAwIDEgNiA2djdoLTR2LTdhMiAyIDAgMCAwLTItMiAyIDIgMCAwIDAtMiAydjdoLTR2LTdhNiA2IDAgMCAxIDYtNnoiIC8+CiAgPHJlY3Qgd2lkdGg9IjQiIGhlaWdodD0iMTIiIHg9IjIiIHk9IjkiIC8+CiAgPGNpcmNsZSBjeD0iNCIgY3k9IjQiIHI9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/linkedin\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 Linkedin = createLucideIcon('Linkedin', [\n [\n 'path',\n {\n d: 'M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z',\n key: 'c2jq9f',\n },\n ],\n ['rect', { width: '4', height: '12', x: '2', y: '9', key: 'mk3on5' }],\n ['circle', { cx: '4', cy: '4', r: '2', key: 'bt5ra8' }],\n]);\n\nexport default Linkedin;\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,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;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,CACA,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACpE,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;AACxD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,45 @@
"use strict";
exports.getWeeksInMonth = getWeeksInMonth;
var _index = require("./differenceInCalendarWeeks.js");
var _index2 = require("./lastDayOfMonth.js");
var _index3 = require("./startOfMonth.js");
/**
* The {@link getWeeksInMonth} function options.
*/
/**
* @name getWeeksInMonth
* @category Week Helpers
* @summary Get the number of calendar weeks a month spans.
*
* @description
* Get the number of calendar weeks the month in the given date spans.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The given date
* @param options - An object with options.
*
* @returns The number of calendar weeks
*
* @example
* // How many calendar weeks does February 2015 span?
* const result = getWeeksInMonth(new Date(2015, 1, 8))
* //=> 4
*
* @example
* // If the week starts on Monday,
* // how many calendar weeks does July 2017 span?
* const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 })
* //=> 6
*/
function getWeeksInMonth(date, options) {
return (
(0, _index.differenceInCalendarWeeks)(
(0, _index2.lastDayOfMonth)(date),
(0, _index3.startOfMonth)(date),
options,
) + 1
);
}

View File

@@ -0,0 +1,30 @@
import { monthsInYear } from "./constants.mjs";
/**
* @name monthsToYears
* @category Conversion Helpers
* @summary Convert number of months to years.
*
* @description
* Convert a number of months to a full number of years.
*
* @param months - The number of months to be converted
*
* @returns The number of months converted in years
*
* @example
* // Convert 36 months to years:
* const result = monthsToYears(36)
* //=> 3
*
* // It uses floor rounding:
* const result = monthsToYears(40)
* //=> 3
*/
export function monthsToYears(months) {
const years = months / monthsInYear;
return Math.trunc(years);
}
// Fallback for modularized imports:
export default monthsToYears;

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleServerFunctions.d.ts","sourceRoot":"","sources":["../../src/utilities/handleServerFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA6C,qBAAqB,EAAE,MAAM,SAAS,CAAA;AA+B/F,eAAO,MAAM,qBAAqB,EAAE,qBA+BnC,CAAA"}

View File

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

View File

@@ -0,0 +1,26 @@
var baseDelay = require('./_baseDelay'),
baseRest = require('./_baseRest');
/**
* Defers invoking the `func` until the current call stack has cleared. Any
* additional arguments are provided to `func` when it's invoked.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to defer.
* @param {...*} [args] The arguments to invoke `func` with.
* @returns {number} Returns the timer id.
* @example
*
* _.defer(function(text) {
* console.log(text);
* }, 'deferred');
* // => Logs 'deferred' after one millisecond.
*/
var defer = baseRest(function(func, args) {
return baseDelay(func, 1, args);
});
module.exports = defer;

View File

@@ -0,0 +1,170 @@
import { Client } from '../client';
import { LogSeverityLevel } from '../types-hoist/log';
/**
* Options for the Sentry Consola reporter.
*/
interface ConsolaReporterOptions {
/**
* Use this option to filter which levels should be captured. By default, all levels are captured.
*
* @example
* ```ts
* const sentryReporter = Sentry.createConsolaReporter({
* // Only capture error and warn logs
* levels: ['error', 'warn'],
* });
* consola.addReporter(sentryReporter);
* ```
*/
levels?: Array<LogSeverityLevel>;
/**
* Optionally provide a specific Sentry client instance to use for capturing logs.
* If not provided, the current client will be retrieved using `getClient()`.
*
* This is useful when you want to use specific client options for log normalization
* or when working with multiple client instances.
*
* @example
* ```ts
* const sentryReporter = Sentry.createConsolaReporter({
* client: myCustomClient,
* });
* ```
*/
client?: Client;
}
export interface ConsolaReporter {
log: (logObj: ConsolaLogObject) => void;
}
/**
* Represents a log object that Consola reporters receive.
*
* This interface matches the structure of log objects passed to Consola reporters.
* See: https://github.com/unjs/consola#custom-reporters
*
* @example
* ```ts
* const reporter = {
* log(logObj: ConsolaLogObject) {
* console.log(`[${logObj.type}] ${logObj.message || logObj.args?.join(' ')}`);
* }
* };
* consola.addReporter(reporter);
* ```
*/
export interface ConsolaLogObject {
/**
* Allows additional custom properties to be set on the log object.
* These properties will be captured as log attributes with a 'consola.' prefix.
*
* @example
* ```ts
* const reporter = Sentry.createConsolaReporter();
* reporter.log({
* type: 'info',
* message: 'User action',
* userId: 123,
* sessionId: 'abc-123'
* });
* // Will create attributes: consola.userId and consola.sessionId
* ```
*/
[key: string]: unknown;
/**
* The numeric log level (0-5) or null.
*
* Consola log levels:
* - 0: Fatal and Error
* - 1: Warnings
* - 2: Normal logs
* - 3: Informational logs, success, fail, ready, start, box, ...
* - 4: Debug logs
* - 5: Trace logs
* - null: Some special types like 'verbose'
*
* See: https://github.com/unjs/consola/blob/main/README.md#log-level
*/
level?: number | null;
/**
* The log type/method name (e.g., 'error', 'warn', 'info', 'debug', 'trace', 'success', 'fail', etc.).
*
* Consola built-in types include:
* - Standard: silent, fatal, error, warn, log, info, success, fail, ready, start, box, debug, trace, verbose
* - Custom types can also be defined
*
* See: https://github.com/unjs/consola/blob/main/README.md#log-types
*/
type?: string;
/**
* An optional tag/scope for the log entry.
*
* Tags are created using `consola.withTag('scope')` and help categorize logs.
*
* @example
* ```ts
* const scopedLogger = consola.withTag('auth');
* scopedLogger.info('User logged in'); // tag will be 'auth'
* ```
*
* See: https://github.com/unjs/consola/blob/main/README.md#withtagtag
*/
tag?: string;
/**
* The raw arguments passed to the log method.
*
* When `message` is not provided, these args are typically formatted into the final message.
*
* @example
* ```ts
* consola.info('Hello', 'world', { user: 'john' });
* // args = ['Hello', 'world', { user: 'john' }]
* ```
*/
args?: unknown[];
/**
* The timestamp when the log was created.
*
* This is automatically set by Consola when the log is created.
*/
date?: Date;
/**
* The formatted log message.
*
* When provided, this is the final formatted message. When not provided,
* the message should be constructed from the `args` array.
*/
message?: string;
}
/**
* Creates a new Sentry reporter for Consola that forwards logs to Sentry. Requires the `enableLogs` option to be enabled.
*
* **Note: This integration supports Consola v3.x only.** The reporter interface and log object structure
* may differ in other versions of Consola.
*
* @param options - Configuration options for the reporter.
* @returns A Consola reporter that can be added to consola instances.
*
* @example
* ```ts
* import * as Sentry from '@sentry/node';
* import { consola } from 'consola';
*
* Sentry.init({
* enableLogs: true,
* });
*
* const sentryReporter = Sentry.createConsolaReporter({
* // Optional: filter levels to capture
* levels: ['error', 'warn', 'info'],
* });
*
* consola.addReporter(sentryReporter);
*
* // Now consola logs will be captured by Sentry
* consola.info('This will be sent to Sentry');
* consola.error('This error will also be sent to Sentry');
* ```
*/
export declare function createConsolaReporter(options?: ConsolaReporterOptions): ConsolaReporter;
export {};
//# sourceMappingURL=consola.d.ts.map

View File

@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ArrowUpAZ = createLucideIcon("ArrowUpAZ", [
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
["path", { d: "M7 4v16", key: "1glfcx" }],
["path", { d: "M20 8h-5", key: "1vsyxs" }],
["path", { d: "M15 10V6.5a2.5 2.5 0 0 1 5 0V10", key: "ag13bf" }],
["path", { d: "M15 14h5l-5 6h5", key: "ur5jdg" }]
]);
export { ArrowUpAZ as default };
//# sourceMappingURL=arrow-up-a-z.js.map

View File

@@ -0,0 +1,37 @@
export interface Interaction {
_latency: number;
id: number;
entries: PerformanceEventTiming[];
}
/**
*
*/
export declare class InteractionManager {
/**
* A list of longest interactions on the page (by latency) sorted so the
* longest one is first. The list is at most MAX_INTERACTIONS_TO_CONSIDER
* long.
*/
_longestInteractionList: Interaction[];
/**
* A mapping of longest interactions by their interaction ID.
* This is used for faster lookup.
*/
_longestInteractionMap: Map<number, Interaction>;
_onBeforeProcessingEntry?: (entry: PerformanceEventTiming) => void;
_onAfterProcessingINPCandidate?: (interaction: Interaction) => void;
_resetInteractions(): void;
/**
* Returns the estimated p98 longest interaction based on the stored
* interaction candidates and the interaction count for the current page.
*/
_estimateP98LongestInteraction(): Interaction | undefined;
/**
* Takes a performance entry and adds it to the list of worst interactions
* if its duration is long enough to make it among the worst. If the
* entry is part of an existing interaction, it is merged and the latency
* and entries list is updated as needed.
*/
_processEntry(entry: PerformanceEventTiming): void;
}
//# sourceMappingURL=InteractionManager.d.ts.map

View File

@@ -0,0 +1,154 @@
'use strict';
function createMultipartBuffers(boundary, sizes) {
const bufs = [];
for (let i = 0; i < sizes.length; ++i) {
const mb = sizes[i] * 1024 * 1024;
bufs.push(Buffer.from([
`--${boundary}`,
`content-disposition: form-data; name="file${i + 1}"; `
+ `filename="random${i + 1}.bin"`,
'content-type: application/octet-stream',
'',
'0'.repeat(mb),
'',
].join('\r\n')));
}
bufs.push(Buffer.from([
`--${boundary}--`,
'',
].join('\r\n')));
return bufs;
}
const boundary = '-----------------------------168072824752491622650073';
const buffers = createMultipartBuffers(boundary, [
10,
10,
10,
20,
50,
]);
const calls = {
partBegin: 0,
headerField: 0,
headerValue: 0,
headerEnd: 0,
headersEnd: 0,
partData: 0,
partEnd: 0,
end: 0,
};
const moduleName = process.argv[2];
switch (moduleName) {
case 'busboy': {
const busboy = require('busboy');
const parser = busboy({
limits: {
fieldSizeLimit: Infinity,
},
headers: {
'content-type': `multipart/form-data; boundary=${boundary}`,
},
});
parser.on('file', (name, stream, info) => {
++calls.partBegin;
stream.on('data', (chunk) => {
++calls.partData;
}).on('end', () => {
++calls.partEnd;
});
}).on('close', () => {
++calls.end;
console.timeEnd(moduleName);
});
console.time(moduleName);
for (const buf of buffers)
parser.write(buf);
break;
}
case 'formidable': {
const { MultipartParser } = require('formidable');
const parser = new MultipartParser();
parser.initWithBoundary(boundary);
parser.on('data', ({ name }) => {
++calls[name];
if (name === 'end')
console.timeEnd(moduleName);
});
console.time(moduleName);
for (const buf of buffers)
parser.write(buf);
break;
}
case 'multiparty': {
const { Readable } = require('stream');
const { Form } = require('multiparty');
const form = new Form({
maxFieldsSize: Infinity,
maxFields: Infinity,
maxFilesSize: Infinity,
autoFields: false,
autoFiles: false,
});
const req = new Readable({ read: () => {} });
req.headers = {
'content-type': `multipart/form-data; boundary=${boundary}`,
};
function hijack(name, fn) {
const oldFn = form[name];
form[name] = function() {
fn();
return oldFn.apply(this, arguments);
};
}
hijack('onParseHeaderField', () => {
++calls.headerField;
});
hijack('onParseHeaderValue', () => {
++calls.headerValue;
});
hijack('onParsePartBegin', () => {
++calls.partBegin;
});
hijack('onParsePartData', () => {
++calls.partData;
});
hijack('onParsePartEnd', () => {
++calls.partEnd;
});
form.on('close', () => {
++calls.end;
console.timeEnd(moduleName);
}).on('part', (p) => p.resume());
console.time(moduleName);
form.parse(req);
for (const buf of buffers)
req.push(buf);
req.push(null);
break;
}
default:
if (moduleName === undefined)
console.error('Missing parser module name');
else
console.error(`Invalid parser module name: ${moduleName}`);
process.exit(1);
}

View File

@@ -0,0 +1,312 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const WebpackError = require("../WebpackError");
const {
evaluateToIdentifier
} = require("../javascript/JavascriptParserHelpers");
const ImportMetaContextDependency = require("./ImportMetaContextDependency");
/** @typedef {import("estree").Expression} Expression */
/** @typedef {import("estree").ObjectExpression} ObjectExpression */
/** @typedef {import("estree").Property} Property */
/** @typedef {import("estree").Identifier} Identifier */
/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
/** @typedef {import("../ContextModule").ContextModuleOptions} ContextModuleOptions */
/** @typedef {import("../ContextModule").ContextMode} ContextMode */
/** @typedef {import("../Chunk").ChunkName} ChunkName */
/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
/** @typedef {import("../Dependency").RawReferencedExports} RawReferencedExports */
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
/** @typedef {import("../javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */
/** @typedef {Pick<ContextModuleOptions, "mode" | "recursive" | "regExp" | "include" | "exclude" | "chunkName"> & { groupOptions: RawChunkGroupOptions, exports?: RawReferencedExports }} ImportMetaContextOptions */
/**
* @param {Property} prop property
* @param {string} expect except message
* @returns {WebpackError} error
*/
function createPropertyParseError(prop, expect) {
return createError(
`Parsing import.meta.webpackContext options failed. Unknown value for property ${JSON.stringify(
/** @type {Identifier} */
(prop.key).name
)}, expected type ${expect}.`,
/** @type {DependencyLocation} */
(prop.value.loc)
);
}
/**
* @param {string} msg message
* @param {DependencyLocation} loc location
* @returns {WebpackError} error
*/
function createError(msg, loc) {
const error = new WebpackError(msg);
error.name = "ImportMetaContextError";
error.loc = loc;
return error;
}
const PLUGIN_NAME = "ImportMetaContextDependencyParserPlugin";
module.exports = class ImportMetaContextDependencyParserPlugin {
/**
* @param {JavascriptParser} parser the parser
* @returns {void}
*/
apply(parser) {
parser.hooks.evaluateIdentifier
.for("import.meta.webpackContext")
.tap(PLUGIN_NAME, (expr) =>
evaluateToIdentifier(
"import.meta.webpackContext",
"import.meta",
() => ["webpackContext"],
true
)(expr)
);
parser.hooks.call
.for("import.meta.webpackContext")
.tap(PLUGIN_NAME, (expr) => {
if (expr.arguments.length < 1 || expr.arguments.length > 2) return;
const [directoryNode, optionsNode] = expr.arguments;
if (optionsNode && optionsNode.type !== "ObjectExpression") return;
const requestExpr = parser.evaluateExpression(
/** @type {Expression} */ (directoryNode)
);
if (!requestExpr.isString()) return;
const request = /** @type {string} */ (requestExpr.string);
/** @type {WebpackError[]} */
const errors = [];
let regExp = /^\.\/.*$/;
let recursive = true;
/** @type {ContextMode} */
let mode = "sync";
/** @type {ContextModuleOptions["include"]} */
let include;
/** @type {ContextModuleOptions["exclude"]} */
let exclude;
/** @type {RawChunkGroupOptions} */
const groupOptions = {};
/** @type {ChunkName | undefined} */
let chunkName;
/** @type {RawReferencedExports | undefined} */
let exports;
if (optionsNode) {
for (const prop of /** @type {ObjectExpression} */ (optionsNode)
.properties) {
if (prop.type !== "Property" || prop.key.type !== "Identifier") {
errors.push(
createError(
"Parsing import.meta.webpackContext options failed.",
/** @type {DependencyLocation} */
(optionsNode.loc)
)
);
break;
}
switch (prop.key.name) {
case "regExp": {
const regExpExpr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (!regExpExpr.isRegExp()) {
errors.push(createPropertyParseError(prop, "RegExp"));
} else {
regExp = /** @type {RegExp} */ (regExpExpr.regExp);
}
break;
}
case "include": {
const regExpExpr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (!regExpExpr.isRegExp()) {
errors.push(createPropertyParseError(prop, "RegExp"));
} else {
include = regExpExpr.regExp;
}
break;
}
case "exclude": {
const regExpExpr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (!regExpExpr.isRegExp()) {
errors.push(createPropertyParseError(prop, "RegExp"));
} else {
exclude = regExpExpr.regExp;
}
break;
}
case "mode": {
const modeExpr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (!modeExpr.isString()) {
errors.push(createPropertyParseError(prop, "string"));
} else {
mode = /** @type {ContextModuleOptions["mode"]} */ (
modeExpr.string
);
}
break;
}
case "chunkName": {
const expr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (!expr.isString()) {
errors.push(createPropertyParseError(prop, "string"));
} else {
chunkName = expr.string;
}
break;
}
case "exports": {
const expr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (expr.isString()) {
exports = [[/** @type {string} */ (expr.string)]];
} else if (expr.isArray()) {
const items =
/** @type {BasicEvaluatedExpression[]} */
(expr.items);
if (
items.every((i) => {
if (!i.isArray()) return false;
const innerItems =
/** @type {BasicEvaluatedExpression[]} */ (i.items);
return innerItems.every((i) => i.isString());
})
) {
exports = [];
for (const i1 of items) {
/** @type {string[]} */
const export_ = [];
for (const i2 of /** @type {BasicEvaluatedExpression[]} */ (
i1.items
)) {
export_.push(/** @type {string} */ (i2.string));
}
exports.push(export_);
}
} else {
errors.push(
createPropertyParseError(prop, "string|string[][]")
);
}
} else {
errors.push(
createPropertyParseError(prop, "string|string[][]")
);
}
break;
}
case "prefetch": {
const expr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (expr.isBoolean()) {
groupOptions.prefetchOrder = 0;
} else if (expr.isNumber()) {
groupOptions.prefetchOrder = expr.number;
} else {
errors.push(createPropertyParseError(prop, "boolean|number"));
}
break;
}
case "preload": {
const expr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (expr.isBoolean()) {
groupOptions.preloadOrder = 0;
} else if (expr.isNumber()) {
groupOptions.preloadOrder = expr.number;
} else {
errors.push(createPropertyParseError(prop, "boolean|number"));
}
break;
}
case "fetchPriority": {
const expr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (
expr.isString() &&
["high", "low", "auto"].includes(
/** @type {string} */ (expr.string)
)
) {
groupOptions.fetchPriority =
/** @type {RawChunkGroupOptions["fetchPriority"]} */ (
expr.string
);
} else {
errors.push(
createPropertyParseError(prop, '"high"|"low"|"auto"')
);
}
break;
}
case "recursive": {
const recursiveExpr = parser.evaluateExpression(
/** @type {Expression} */ (prop.value)
);
if (!recursiveExpr.isBoolean()) {
errors.push(createPropertyParseError(prop, "boolean"));
} else {
recursive = /** @type {boolean} */ (recursiveExpr.bool);
}
break;
}
default:
errors.push(
createError(
`Parsing import.meta.webpackContext options failed. Unknown property ${JSON.stringify(
prop.key.name
)}.`,
/** @type {DependencyLocation} */ (optionsNode.loc)
)
);
}
}
}
if (errors.length) {
for (const error of errors) parser.state.current.addError(error);
return;
}
const dep = new ImportMetaContextDependency(
{
request,
include,
exclude,
recursive,
regExp,
groupOptions,
chunkName,
referencedExports: exports,
mode,
category: "esm"
},
/** @type {Range} */ (expr.range)
);
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
dep.optional = Boolean(parser.scope.inTry);
parser.state.current.addDependency(dep);
return true;
});
}
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"getDocPreferences.d.ts","sourceRoot":"","sources":["../../../src/views/Document/getDocPreferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAItE,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,iBAAiB,uDAM3B,IAAI,KAAG,OAAO,CAAC,mBAAmB,CA2CpC,CAAA"}

View File

@@ -0,0 +1,22 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0;
// this is autogenerated file, see scripts/version-update.js
exports.PACKAGE_VERSION = '0.59.0';
exports.PACKAGE_NAME = '@opentelemetry/instrumentation-express';
//# sourceMappingURL=version.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"meta.js","sources":["../../../src/utils/meta.ts"],"sourcesContent":["import type { SerializedTraceData } from '../types-hoist/tracing';\nimport { getTraceData } from './traceData';\n\n/**\n * Returns a string of meta tags that represent the current trace data.\n *\n * You can use this to propagate a trace from your server-side rendered Html to the browser.\n * This function returns up to two meta tags, `sentry-trace` and `baggage`, depending on the\n * current trace data state.\n *\n * @example\n * Usage example:\n *\n * ```js\n * function renderHtml() {\n * return `\n * <head>\n * ${getTraceMetaTags()}\n * </head>\n * `;\n * }\n * ```\n *\n */\nexport function getTraceMetaTags(traceData?: SerializedTraceData): string {\n return Object.entries(traceData || getTraceData())\n .map(([key, value]) => `<meta name=\"${key}\" content=\"${value}\"/>`)\n .join('\\n');\n}\n"],"names":["traceData","getTraceData"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAACA,WAAS,EAAgC;AAC1E,EAAE,OAAO,MAAM,CAAC,OAAO,CAACA,WAAA,IAAaC,sBAAY,EAAE;AACnD,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC;AACrE,KAAK,IAAI,CAAC,IAAI,CAAC;AACf;;;;"}

View File

@@ -0,0 +1,92 @@
'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import React, { useEffect } from 'react';
import { useResize } from '../../../hooks/useResize.js';
import { useLivePreviewContext } from '../../../providers/LivePreview/context.js';
export const DeviceContainer = props => {
const {
children
} = props;
const deviceFrameRef = React.useRef(null);
const outerFrameRef = React.useRef(null);
const {
breakpoint,
setMeasuredDeviceSize,
size: desiredSize,
zoom
} = useLivePreviewContext();
// Keep an accurate measurement of the actual device size as it is truly rendered
// This is helpful when `sizes` are non-number units like percentages, etc.
const {
size: measuredDeviceSize
} = useResize(deviceFrameRef.current);
const {
size: outerFrameSize
} = useResize(outerFrameRef.current);
let deviceIsLargerThanFrame = false;
// Sync the measured device size with the context so that other components can use it
// This happens from the bottom up so that as this component mounts and unmounts,
// its size is freshly populated again upon re-mounting, i.e. going from iframe->popup->iframe
useEffect(() => {
if (measuredDeviceSize) {
setMeasuredDeviceSize(measuredDeviceSize);
}
}, [measuredDeviceSize, setMeasuredDeviceSize]);
let x = '0';
let margin = '0';
if (breakpoint && breakpoint !== 'responsive') {
x = '-50%';
if (desiredSize && measuredDeviceSize && typeof zoom === 'number' && typeof desiredSize.width === 'number' && typeof desiredSize.height === 'number' && typeof measuredDeviceSize.width === 'number' && typeof measuredDeviceSize.height === 'number') {
margin = '0 auto';
const scaledDesiredWidth = desiredSize.width / zoom;
const scaledDeviceWidth = measuredDeviceSize.width * zoom;
const scaledDeviceDifferencePixels = scaledDesiredWidth - desiredSize.width;
deviceIsLargerThanFrame = scaledDeviceWidth > outerFrameSize.width;
if (deviceIsLargerThanFrame) {
if (zoom > 1) {
const differenceFromDeviceToFrame = measuredDeviceSize.width - outerFrameSize.width;
if (differenceFromDeviceToFrame < 0) {
x = `${differenceFromDeviceToFrame / 2}px`;
} else {
x = '0';
}
} else {
x = '0';
}
} else {
if (zoom >= 1) {
x = `${scaledDeviceDifferencePixels / 2}px`;
} else {
const differenceFromDeviceToFrame_0 = outerFrameSize.width - scaledDeviceWidth;
x = `${differenceFromDeviceToFrame_0 / 2}px`;
margin = '0';
}
}
}
}
let width = zoom ? `${100 / zoom}%` : '100%';
let height = zoom ? `${100 / zoom}%` : '100%';
if (breakpoint !== 'responsive') {
width = `${desiredSize?.width / (typeof zoom === 'number' ? zoom : 1)}px`;
height = `${desiredSize?.height / (typeof zoom === 'number' ? zoom : 1)}px`;
}
return /*#__PURE__*/_jsx("div", {
ref: outerFrameRef,
style: {
height: '100%',
width: '100%'
},
children: /*#__PURE__*/_jsx("div", {
ref: deviceFrameRef,
style: {
height,
margin,
transform: `translate3d(${x}, 0, 0)`,
width
},
children: children
})
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,21 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}

View File

@@ -0,0 +1,141 @@
/**
* Essential MCP attribute constants for Sentry instrumentation
*
* Based on OpenTelemetry MCP semantic conventions
* @see https://github.com/open-telemetry/semantic-conventions/blob/3097fb0af5b9492b0e3f55dc5f6c21a3dc2be8df/docs/gen-ai/mcp.md
*/
// =============================================================================
// CORE MCP ATTRIBUTES
// =============================================================================
/** The name of the request or notification method */
const MCP_METHOD_NAME_ATTRIBUTE = 'mcp.method.name';
/** JSON-RPC request identifier for the request. Unique within the MCP session. */
const MCP_REQUEST_ID_ATTRIBUTE = 'mcp.request.id';
/** Identifies the MCP session */
const MCP_SESSION_ID_ATTRIBUTE = 'mcp.session.id';
/** Transport method used for MCP communication */
const MCP_TRANSPORT_ATTRIBUTE = 'mcp.transport';
// =============================================================================
// SERVER ATTRIBUTES
// =============================================================================
/** Name of the MCP server application */
const MCP_SERVER_NAME_ATTRIBUTE = 'mcp.server.name';
/** Display title of the MCP server application */
const MCP_SERVER_TITLE_ATTRIBUTE = 'mcp.server.title';
/** Version of the MCP server application */
const MCP_SERVER_VERSION_ATTRIBUTE = 'mcp.server.version';
/** MCP protocol version used in the session */
const MCP_PROTOCOL_VERSION_ATTRIBUTE = 'mcp.protocol.version';
// =============================================================================
// METHOD-SPECIFIC ATTRIBUTES
// =============================================================================
/** Name of the tool being called */
const MCP_TOOL_NAME_ATTRIBUTE = 'mcp.tool.name';
/** The resource URI being accessed */
const MCP_RESOURCE_URI_ATTRIBUTE = 'mcp.resource.uri';
/** Name of the prompt template */
const MCP_PROMPT_NAME_ATTRIBUTE = 'mcp.prompt.name';
// =============================================================================
// TOOL RESULT ATTRIBUTES
// =============================================================================
/** Whether a tool execution resulted in an error */
const MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE = 'mcp.tool.result.is_error';
/** Number of content items in the tool result */
const MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE = 'mcp.tool.result.content_count';
// =============================================================================
// PROMPT RESULT ATTRIBUTES
// =============================================================================
/** Description of the prompt result */
const MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE = 'mcp.prompt.result.description';
/** Number of messages in the prompt result */
const MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE = 'mcp.prompt.result.message_count';
// =============================================================================
// REQUEST ARGUMENT ATTRIBUTES
// =============================================================================
/** Prefix for MCP request argument prefix for each argument */
const MCP_REQUEST_ARGUMENT = 'mcp.request.argument';
// =============================================================================
// LOGGING ATTRIBUTES
// =============================================================================
/** Log level for MCP logging operations */
const MCP_LOGGING_LEVEL_ATTRIBUTE = 'mcp.logging.level';
/** Logger name for MCP logging operations */
const MCP_LOGGING_LOGGER_ATTRIBUTE = 'mcp.logging.logger';
/** Data type of the logged message */
const MCP_LOGGING_DATA_TYPE_ATTRIBUTE = 'mcp.logging.data_type';
/** Log message content */
const MCP_LOGGING_MESSAGE_ATTRIBUTE = 'mcp.logging.message';
// =============================================================================
// NETWORK ATTRIBUTES (OpenTelemetry Standard)
// =============================================================================
/** OSI transport layer protocol */
const NETWORK_TRANSPORT_ATTRIBUTE = 'network.transport';
/** The version of JSON RPC protocol used */
const NETWORK_PROTOCOL_VERSION_ATTRIBUTE = 'network.protocol.version';
/** Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name */
const CLIENT_ADDRESS_ATTRIBUTE = 'client.address';
/** Client port number */
const CLIENT_PORT_ATTRIBUTE = 'client.port';
// =============================================================================
// SENTRY-SPECIFIC MCP ATTRIBUTE VALUES
// =============================================================================
/** Sentry operation value for MCP server spans */
const MCP_SERVER_OP_VALUE = 'mcp.server';
/**
* Sentry operation value for client-to-server notifications
* Following OpenTelemetry MCP semantic conventions
*/
const MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE = 'mcp.notification.client_to_server';
/**
* Sentry operation value for server-to-client notifications
* Following OpenTelemetry MCP semantic conventions
*/
const MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE = 'mcp.notification.server_to_client';
/** Sentry origin value for MCP function spans */
const MCP_FUNCTION_ORIGIN_VALUE = 'auto.function.mcp_server';
/** Sentry origin value for MCP notification spans */
const MCP_NOTIFICATION_ORIGIN_VALUE = 'auto.mcp.notification';
/** Sentry source value for MCP route spans */
const MCP_ROUTE_SOURCE_VALUE = 'route';
export { CLIENT_ADDRESS_ATTRIBUTE, CLIENT_PORT_ATTRIBUTE, MCP_FUNCTION_ORIGIN_VALUE, MCP_LOGGING_DATA_TYPE_ATTRIBUTE, MCP_LOGGING_LEVEL_ATTRIBUTE, MCP_LOGGING_LOGGER_ATTRIBUTE, MCP_LOGGING_MESSAGE_ATTRIBUTE, MCP_METHOD_NAME_ATTRIBUTE, MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE, MCP_NOTIFICATION_ORIGIN_VALUE, MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE, MCP_PROMPT_NAME_ATTRIBUTE, MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE, MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE, MCP_PROTOCOL_VERSION_ATTRIBUTE, MCP_REQUEST_ARGUMENT, MCP_REQUEST_ID_ATTRIBUTE, MCP_RESOURCE_URI_ATTRIBUTE, MCP_ROUTE_SOURCE_VALUE, MCP_SERVER_NAME_ATTRIBUTE, MCP_SERVER_OP_VALUE, MCP_SERVER_TITLE_ATTRIBUTE, MCP_SERVER_VERSION_ATTRIBUTE, MCP_SESSION_ID_ATTRIBUTE, MCP_TOOL_NAME_ATTRIBUTE, MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE, MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE, MCP_TRANSPORT_ATTRIBUTE, NETWORK_PROTOCOL_VERSION_ATTRIBUTE, NETWORK_TRANSPORT_ATTRIBUTE };
//# sourceMappingURL=attributes.js.map

View File

@@ -0,0 +1,133 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(第\s*)?\d+(日|時|分|秒)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(前)/i,
abbreviated: /^(前)/i,
wide: /^(公元前|公元)/i,
};
const parseEraPatterns = {
any: [/^(前)/i, /^(公元)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^第[一二三四]季/i,
wide: /^第[一二三四]季度/i,
};
const parseQuarterPatterns = {
any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i],
};
const matchMonthPatterns = {
narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i,
};
const parseMonthPatterns = {
narrow: [
/^一/i,
/^二/i,
/^三/i,
/^四/i,
/^五/i,
/^六/i,
/^七/i,
/^八/i,
/^九/i,
/^十(?!(一|二))/i,
/^十一/i,
/^十二/i,
],
any: [
/^一|1/i,
/^二|2/i,
/^三|3/i,
/^四|4/i,
/^五|5/i,
/^六|6/i,
/^七|7/i,
/^八|8/i,
/^九|9/i,
/^十(?!(一|二))|10/i,
/^十一|11/i,
/^十二|12/i,
],
};
const matchDayPatterns = {
narrow: /^[一二三四五六日]/i,
short: /^[一二三四五六日]/i,
abbreviated: /^週[一二三四五六日]/i,
wide: /^星期[一二三四五六日]/i,
};
const parseDayPatterns = {
any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i],
};
const matchDayPeriodPatterns = {
any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^上午?/i,
pm: /^下午?/i,
midnight: /^午夜/i,
noon: /^[中正]午/i,
morning: /^早上/i,
afternoon: /^下午/i,
evening: /^晚上?/i,
night: /^凌晨/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1,64 @@
import { sql } from 'drizzle-orm';
import { buildVersionCollectionFields } from 'payload';
import { hasDraftsEnabled } from 'payload/shared';
import toSnakeCase from 'to-snake-case';
import { upsertRow } from './upsertRow/index.js';
import { getTransaction } from './utilities/getTransaction.js';
export async function createVersion({ autosave, collectionSlug, createdAt, parent, publishedLocale, req, returning, select, snapshot, updatedAt, versionData }) {
const collection = this.payload.collections[collectionSlug].config;
if (collection.versions.drafts) {
if (typeof select === 'object') {
select.updatedAt = true;
}
}
const defaultTableName = toSnakeCase(collection.slug);
const tableName = this.tableNameMap.get(`_${defaultTableName}${this.versionsSuffix}`);
const version = {
...versionData
};
if (version.id) {
delete version.id;
}
const data = {
autosave,
createdAt,
latest: true,
parent,
publishedLocale,
snapshot,
updatedAt,
version
};
const db = await getTransaction(this, req);
const result = await upsertRow({
adapter: this,
collectionSlug,
data,
db,
fields: buildVersionCollectionFields(this.payload.config, collection, true),
ignoreResult: returning === false ? 'idOnly' : undefined,
operation: 'create',
req,
select,
tableName
});
const table = this.tables[tableName];
if (hasDraftsEnabled(collection)) {
await this.execute({
db,
sql: sql`
UPDATE ${table}
SET latest = false
WHERE ${table.id} != ${result.id}
AND ${table.parent} = ${parent}
AND ${table.updatedAt} < ${result.updatedAt || updatedAt}
`
});
}
if (returning === false) {
return null;
}
return result;
}
//# sourceMappingURL=createVersion.js.map

View File

@@ -0,0 +1,14 @@
/**
* Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked.
*/
export declare class BindOnceFuture<R, This = unknown, T extends (this: This, ...args: unknown[]) => R = () => R> {
private _isCalled;
private _deferred;
private _callback;
private _that;
constructor(callback: T, that: This);
get isCalled(): boolean;
get promise(): Promise<R>;
call(...args: Parameters<T>): Promise<R>;
}
//# sourceMappingURL=callback.d.ts.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"K D E F 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":"9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B","2":"0C VC J bB K D E F A B C L M 4C 5C","129":"2B 3B 4B","769":"5B WC","1281":"0 1 2 3 4 5 6 7 8 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"},D:{"1":"0 1 2 3 4 5 6 7 8 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 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":"J bB K D E F A B C L M G N O P cB","33":"9 AB BB CB"},E:{"1":"E F A B C L M G AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D 6C bC 7C 8C 9C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 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":"F B C JD KD LD MD PC xC ND QC"},G:{"1":"E TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"bC OD yC PD QD RD SD"},H:{"2":"mD"},I:{"1":"I rD sD","2":"VC J nD oD pD qD yC"},J:{"1":"A","2":"D"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"A B"},O:{"1":"RC"},P:{"1":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:2,C:"High Resolution Time API",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sources":["../../../../src/tracing/google-genai/constants.ts"],"sourcesContent":["export const GOOGLE_GENAI_INTEGRATION_NAME = 'Google_GenAI';\n\n// https://ai.google.dev/api/rest/v1/models/generateContent\n// https://ai.google.dev/api/rest/v1/chats/sendMessage\n// https://googleapis.github.io/js-genai/release_docs/classes/models.Models.html#generatecontentstream\n// https://googleapis.github.io/js-genai/release_docs/classes/chats.Chat.html#sendmessagestream\nexport const GOOGLE_GENAI_INSTRUMENTED_METHODS = [\n 'models.generateContent',\n 'models.generateContentStream',\n 'chats.create',\n 'sendMessage',\n 'sendMessageStream',\n] as const;\n\n// Constants for internal use\nexport const GOOGLE_GENAI_SYSTEM_NAME = 'google_genai';\nexport const CHATS_CREATE_METHOD = 'chats.create';\nexport const CHAT_PATH = 'chat';\n"],"names":[],"mappings":"AAAO,MAAM,6BAAA,GAAgC;;AAE7C;AACA;AACA;AACA;AACO,MAAM,oCAAoC;AACjD,EAAE,wBAAwB;AAC1B,EAAE,8BAA8B;AAChC,EAAE,cAAc;AAChB,EAAE,aAAa;AACf,EAAE,mBAAmB;AACrB,CAAA;;AAEA;AACO,MAAM,wBAAA,GAA2B;AACjC,MAAM,mBAAA,GAAsB;AAC5B,MAAM,SAAA,GAAY;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"menu.js","sources":["../../../src/icons/menu.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Menu\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iNCIgeDI9IjIwIiB5MT0iMTIiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iNCIgeDI9IjIwIiB5MT0iNiIgeTI9IjYiIC8+CiAgPGxpbmUgeDE9IjQiIHgyPSIyMCIgeTE9IjE4IiB5Mj0iMTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/menu\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 Menu = createLucideIcon('Menu', [\n ['line', { x1: '4', x2: '20', y1: '12', y2: '12', key: '1e0a9i' }],\n ['line', { x1: '4', x2: '20', y1: '6', y2: '6', key: '1owob3' }],\n ['line', { x1: '4', x2: '20', y1: '18', y2: '18', key: 'yk5zj1' }],\n]);\n\nexport default Menu;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CACpC,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC/D,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,74 @@
'use strict'
const setLevelSym = Symbol('pino.setLevel')
const getLevelSym = Symbol('pino.getLevel')
const levelValSym = Symbol('pino.levelVal')
const levelCompSym = Symbol('pino.levelComp')
const useLevelLabelsSym = Symbol('pino.useLevelLabels')
const useOnlyCustomLevelsSym = Symbol('pino.useOnlyCustomLevels')
const mixinSym = Symbol('pino.mixin')
const lsCacheSym = Symbol('pino.lsCache')
const chindingsSym = Symbol('pino.chindings')
const asJsonSym = Symbol('pino.asJson')
const writeSym = Symbol('pino.write')
const redactFmtSym = Symbol('pino.redactFmt')
const timeSym = Symbol('pino.time')
const timeSliceIndexSym = Symbol('pino.timeSliceIndex')
const streamSym = Symbol('pino.stream')
const stringifySym = Symbol('pino.stringify')
const stringifySafeSym = Symbol('pino.stringifySafe')
const stringifiersSym = Symbol('pino.stringifiers')
const endSym = Symbol('pino.end')
const formatOptsSym = Symbol('pino.formatOpts')
const messageKeySym = Symbol('pino.messageKey')
const errorKeySym = Symbol('pino.errorKey')
const nestedKeySym = Symbol('pino.nestedKey')
const nestedKeyStrSym = Symbol('pino.nestedKeyStr')
const mixinMergeStrategySym = Symbol('pino.mixinMergeStrategy')
const msgPrefixSym = Symbol('pino.msgPrefix')
const wildcardFirstSym = Symbol('pino.wildcardFirst')
// public symbols, no need to use the same pino
// version for these
const serializersSym = Symbol.for('pino.serializers')
const formattersSym = Symbol.for('pino.formatters')
const hooksSym = Symbol.for('pino.hooks')
const needsMetadataGsym = Symbol.for('pino.metadata')
module.exports = {
setLevelSym,
getLevelSym,
levelValSym,
levelCompSym,
useLevelLabelsSym,
mixinSym,
lsCacheSym,
chindingsSym,
asJsonSym,
writeSym,
serializersSym,
redactFmtSym,
timeSym,
timeSliceIndexSym,
streamSym,
stringifySym,
stringifySafeSym,
stringifiersSym,
endSym,
formatOptsSym,
messageKeySym,
errorKeySym,
nestedKeySym,
wildcardFirstSym,
needsMetadataGsym,
useOnlyCustomLevelsSym,
formattersSym,
hooksSym,
nestedKeyStrSym,
mixinMergeStrategySym,
msgPrefixSym
}

View File

@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLUSCurrency = void 0;
// https://github.com/abhiaiyer91/graphql-currency-scalars
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
function generateCurrency(value) {
if (typeof value !== 'number') {
throw (0, error_js_1.createGraphQLError)(`Currency cannot represent non integer type ${JSON.stringify(value)}`);
}
const currencyInCents = parseInt(value.toString(), 10);
return (currencyInCents / 100).toLocaleString('en-US', {
style: 'currency',
currency: 'USD',
});
}
function generateCents(value) {
const digits = value.replace('$', '').replace(',', '');
const number = parseFloat(digits);
return number * 100;
}
/**
* An Currency Scalar.
*
* Input:
* This scalar takes a currency string as input and
* formats it to currency in cents.
*
* Output:
* This scalar serializes currency in cents to
* currency strings.
*/
exports.GraphQLUSCurrency = new graphql_1.GraphQLScalarType({
name: 'USCurrency',
description: 'A currency string, such as $21.25',
serialize: generateCurrency,
parseValue(value) {
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Currency cannot represent non string type ${JSON.stringify(value)}`);
}
return generateCents(value);
},
parseLiteral(ast) {
if (ast.kind === graphql_1.Kind.STRING) {
if (typeof ast.value === 'string') {
return generateCents(ast.value);
}
}
throw (0, error_js_1.createGraphQLError)(`Currency cannot represent an invalid currency-string ${JSON.stringify(ast)}.`, {
nodes: ast,
});
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'USCurrency',
type: 'string',
pattern: '^\\$[0-9]+(\\.[0-9]{2})?$',
},
},
});

View File

@@ -0,0 +1,32 @@
import { type Config, type Connection } from '@tidbcloud/serverless';
import { entityKind } from "../entity.cjs";
import type { Logger } from "../logger.cjs";
import { MySqlDatabase } from "../mysql-core/db.cjs";
import { type DrizzleConfig } from "../utils.cjs";
import type { TiDBServerlessPreparedQueryHKT, TiDBServerlessQueryResultHKT } from "./session.cjs";
export interface TiDBServerlessSDriverOptions {
logger?: Logger;
cache?: Cache;
}
export declare class TiDBServerlessDatabase<TSchema extends Record<string, unknown> = Record<string, never>> extends MySqlDatabase<TiDBServerlessQueryResultHKT, TiDBServerlessPreparedQueryHKT, TSchema> {
static readonly [entityKind]: string;
}
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>, TClient extends Connection = Connection>(...params: [
TClient | string
] | [
TClient | string,
DrizzleConfig<TSchema>
] | [
({
connection: string | Config;
} | {
client: TClient;
}) & DrizzleConfig<TSchema>
]): TiDBServerlessDatabase<TSchema> & {
$client: TClient;
};
export declare namespace drizzle {
function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): TiDBServerlessDatabase<TSchema> & {
$client: '$client is not available on drizzle.mock()';
};
}

View File

@@ -0,0 +1,23 @@
"use strict";
exports.buildMatchPatternFn = buildMatchPatternFn;
function buildMatchPatternFn(args) {
return (string, options = {}) => {
const matchResult = string.match(args.matchPattern);
if (!matchResult) return null;
const matchedString = matchResult[0];
const parseResult = string.match(args.parsePattern);
if (!parseResult) return null;
let value = args.valueCallback
? args.valueCallback(parseResult[0])
: parseResult[0];
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
value = options.valueCallback ? options.valueCallback(value) : value;
const rest = string.slice(matchedString.length);
return { value, rest };
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"layout-template.js","sources":["../../../src/icons/layout-template.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LayoutTemplate\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iNyIgeD0iMyIgeT0iMyIgcng9IjEiIC8+CiAgPHJlY3Qgd2lkdGg9IjkiIGhlaWdodD0iNyIgeD0iMyIgeT0iMTQiIHJ4PSIxIiAvPgogIDxyZWN0IHdpZHRoPSI1IiBoZWlnaHQ9IjciIHg9IjE2IiB5PSIxNCIgcng9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/layout-template\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 LayoutTemplate = createLucideIcon('LayoutTemplate', [\n ['rect', { width: '18', height: '7', x: '3', y: '3', rx: '1', key: 'f1a2em' }],\n ['rect', { width: '9', height: '7', x: '3', y: '14', rx: '1', key: 'jqznyg' }],\n ['rect', { width: '5', height: '7', x: '16', y: '14', rx: '1', key: 'q5h2i8' }],\n]);\n\nexport default LayoutTemplate;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
exports._default = require("./emotion-react-_isolated-hnrs.browser.development.cjs.js").default;

View File

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

View File

@@ -0,0 +1,21 @@
'use strict'
const { register } = require('../..')
const assert = require('assert')
function setup () {
const obj = { foo: 'bar' }
register(obj, shutdown)
}
let shutdownCalled = false
function shutdown (obj) {
shutdownCalled = true
assert.strictEqual(obj.foo, 'bar')
}
setup()
process.on('exit', function () {
assert.strictEqual(shutdownCalled, true)
})

View File

@@ -0,0 +1,84 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.zhTW = exports.zhCN = exports.vi = exports.ur = exports.ua = exports.tr = exports.th = exports.ta = exports.sv = exports.sl = exports.ru = exports.pt = exports.pl = exports.ps = exports.ota = exports.no = exports.nl = exports.ms = exports.mk = exports.ko = exports.kh = exports.ja = exports.it = exports.id = exports.hu = exports.he = exports.frCA = exports.fr = exports.fi = exports.fa = exports.es = exports.eo = exports.en = exports.de = exports.cs = exports.ca = exports.be = exports.az = exports.ar = void 0;
var ar_js_1 = require("./ar.cjs");
Object.defineProperty(exports, "ar", { enumerable: true, get: function () { return __importDefault(ar_js_1).default; } });
var az_js_1 = require("./az.cjs");
Object.defineProperty(exports, "az", { enumerable: true, get: function () { return __importDefault(az_js_1).default; } });
var be_js_1 = require("./be.cjs");
Object.defineProperty(exports, "be", { enumerable: true, get: function () { return __importDefault(be_js_1).default; } });
var ca_js_1 = require("./ca.cjs");
Object.defineProperty(exports, "ca", { enumerable: true, get: function () { return __importDefault(ca_js_1).default; } });
var cs_js_1 = require("./cs.cjs");
Object.defineProperty(exports, "cs", { enumerable: true, get: function () { return __importDefault(cs_js_1).default; } });
var de_js_1 = require("./de.cjs");
Object.defineProperty(exports, "de", { enumerable: true, get: function () { return __importDefault(de_js_1).default; } });
var en_js_1 = require("./en.cjs");
Object.defineProperty(exports, "en", { enumerable: true, get: function () { return __importDefault(en_js_1).default; } });
var eo_js_1 = require("./eo.cjs");
Object.defineProperty(exports, "eo", { enumerable: true, get: function () { return __importDefault(eo_js_1).default; } });
var es_js_1 = require("./es.cjs");
Object.defineProperty(exports, "es", { enumerable: true, get: function () { return __importDefault(es_js_1).default; } });
var fa_js_1 = require("./fa.cjs");
Object.defineProperty(exports, "fa", { enumerable: true, get: function () { return __importDefault(fa_js_1).default; } });
var fi_js_1 = require("./fi.cjs");
Object.defineProperty(exports, "fi", { enumerable: true, get: function () { return __importDefault(fi_js_1).default; } });
var fr_js_1 = require("./fr.cjs");
Object.defineProperty(exports, "fr", { enumerable: true, get: function () { return __importDefault(fr_js_1).default; } });
var fr_CA_js_1 = require("./fr-CA.cjs");
Object.defineProperty(exports, "frCA", { enumerable: true, get: function () { return __importDefault(fr_CA_js_1).default; } });
var he_js_1 = require("./he.cjs");
Object.defineProperty(exports, "he", { enumerable: true, get: function () { return __importDefault(he_js_1).default; } });
var hu_js_1 = require("./hu.cjs");
Object.defineProperty(exports, "hu", { enumerable: true, get: function () { return __importDefault(hu_js_1).default; } });
var id_js_1 = require("./id.cjs");
Object.defineProperty(exports, "id", { enumerable: true, get: function () { return __importDefault(id_js_1).default; } });
var it_js_1 = require("./it.cjs");
Object.defineProperty(exports, "it", { enumerable: true, get: function () { return __importDefault(it_js_1).default; } });
var ja_js_1 = require("./ja.cjs");
Object.defineProperty(exports, "ja", { enumerable: true, get: function () { return __importDefault(ja_js_1).default; } });
var kh_js_1 = require("./kh.cjs");
Object.defineProperty(exports, "kh", { enumerable: true, get: function () { return __importDefault(kh_js_1).default; } });
var ko_js_1 = require("./ko.cjs");
Object.defineProperty(exports, "ko", { enumerable: true, get: function () { return __importDefault(ko_js_1).default; } });
var mk_js_1 = require("./mk.cjs");
Object.defineProperty(exports, "mk", { enumerable: true, get: function () { return __importDefault(mk_js_1).default; } });
var ms_js_1 = require("./ms.cjs");
Object.defineProperty(exports, "ms", { enumerable: true, get: function () { return __importDefault(ms_js_1).default; } });
var nl_js_1 = require("./nl.cjs");
Object.defineProperty(exports, "nl", { enumerable: true, get: function () { return __importDefault(nl_js_1).default; } });
var no_js_1 = require("./no.cjs");
Object.defineProperty(exports, "no", { enumerable: true, get: function () { return __importDefault(no_js_1).default; } });
var ota_js_1 = require("./ota.cjs");
Object.defineProperty(exports, "ota", { enumerable: true, get: function () { return __importDefault(ota_js_1).default; } });
var ps_js_1 = require("./ps.cjs");
Object.defineProperty(exports, "ps", { enumerable: true, get: function () { return __importDefault(ps_js_1).default; } });
var pl_js_1 = require("./pl.cjs");
Object.defineProperty(exports, "pl", { enumerable: true, get: function () { return __importDefault(pl_js_1).default; } });
var pt_js_1 = require("./pt.cjs");
Object.defineProperty(exports, "pt", { enumerable: true, get: function () { return __importDefault(pt_js_1).default; } });
var ru_js_1 = require("./ru.cjs");
Object.defineProperty(exports, "ru", { enumerable: true, get: function () { return __importDefault(ru_js_1).default; } });
var sl_js_1 = require("./sl.cjs");
Object.defineProperty(exports, "sl", { enumerable: true, get: function () { return __importDefault(sl_js_1).default; } });
var sv_js_1 = require("./sv.cjs");
Object.defineProperty(exports, "sv", { enumerable: true, get: function () { return __importDefault(sv_js_1).default; } });
var ta_js_1 = require("./ta.cjs");
Object.defineProperty(exports, "ta", { enumerable: true, get: function () { return __importDefault(ta_js_1).default; } });
var th_js_1 = require("./th.cjs");
Object.defineProperty(exports, "th", { enumerable: true, get: function () { return __importDefault(th_js_1).default; } });
var tr_js_1 = require("./tr.cjs");
Object.defineProperty(exports, "tr", { enumerable: true, get: function () { return __importDefault(tr_js_1).default; } });
var ua_js_1 = require("./ua.cjs");
Object.defineProperty(exports, "ua", { enumerable: true, get: function () { return __importDefault(ua_js_1).default; } });
var ur_js_1 = require("./ur.cjs");
Object.defineProperty(exports, "ur", { enumerable: true, get: function () { return __importDefault(ur_js_1).default; } });
var vi_js_1 = require("./vi.cjs");
Object.defineProperty(exports, "vi", { enumerable: true, get: function () { return __importDefault(vi_js_1).default; } });
var zh_CN_js_1 = require("./zh-CN.cjs");
Object.defineProperty(exports, "zhCN", { enumerable: true, get: function () { return __importDefault(zh_CN_js_1).default; } });
var zh_TW_js_1 = require("./zh-TW.cjs");
Object.defineProperty(exports, "zhTW", { enumerable: true, get: function () { return __importDefault(zh_TW_js_1).default; } });

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/admin/fields/Email.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { EmailField, EmailFieldClient } from '../../fields/config/types.js'\nimport type { EmailFieldValidation } from '../../fields/validations.js'\nimport type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'\nimport type {\n ClientFieldBase,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerFieldBase,\n} from '../forms/Field.js'\nimport type {\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n FieldDiffClientComponent,\n FieldDiffServerComponent,\n FieldLabelClientComponent,\n FieldLabelServerComponent,\n} from '../types.js'\n\ntype EmailFieldClientWithoutType = MarkOptional<EmailFieldClient, 'type'>\n\ntype EmailFieldBaseClientProps = {\n readonly path: string\n readonly validate?: EmailFieldValidation\n}\n\ntype EmailFieldBaseServerProps = Pick<FieldPaths, 'path'>\n\nexport type EmailFieldClientProps = ClientFieldBase<EmailFieldClientWithoutType> &\n EmailFieldBaseClientProps\n\nexport type EmailFieldServerProps = EmailFieldBaseServerProps &\n ServerFieldBase<EmailField, EmailFieldClientWithoutType>\n\nexport type EmailFieldServerComponent = FieldServerComponent<\n EmailField,\n EmailFieldClientWithoutType,\n EmailFieldBaseServerProps\n>\n\nexport type EmailFieldClientComponent = FieldClientComponent<\n EmailFieldClientWithoutType,\n EmailFieldBaseClientProps\n>\n\nexport type EmailFieldLabelServerComponent = FieldLabelServerComponent<\n EmailField,\n EmailFieldClientWithoutType\n>\n\nexport type EmailFieldLabelClientComponent = FieldLabelClientComponent<EmailFieldClientWithoutType>\n\nexport type EmailFieldDescriptionServerComponent = FieldDescriptionServerComponent<\n EmailField,\n EmailFieldClientWithoutType\n>\n\nexport type EmailFieldDescriptionClientComponent =\n FieldDescriptionClientComponent<EmailFieldClientWithoutType>\n\nexport type EmailFieldErrorServerComponent = FieldErrorServerComponent<\n EmailField,\n EmailFieldClientWithoutType\n>\n\nexport type EmailFieldErrorClientComponent = FieldErrorClientComponent<EmailFieldClientWithoutType>\n\nexport type EmailFieldDiffServerComponent = FieldDiffServerComponent<EmailField, EmailFieldClient>\n\nexport type EmailFieldDiffClientComponent = FieldDiffClientComponent<EmailFieldClient>\n"],"names":[],"mappings":"AAuEA,WAAsF"}

View File

@@ -0,0 +1,51 @@
import { Bench } from 'tinybench'
import { fastUri } from '../index.js'
const {
equal: fastUriEqual,
parse: fastUriParse,
} = fastUri
const stringA = 'example://a/b/c/%7Bfoo%7D'
const stringB = 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'
const componentA = fastUriParse(stringA)
const componentB = fastUriParse(stringB)
const benchFastUri = new Bench({ name: 'fast-uri equal' })
benchFastUri.add('equal string with string', function () {
fastUriEqual(stringA, stringA)
})
benchFastUri.add('equal component with component', function () {
fastUriEqual(componentA, componentA)
})
benchFastUri.add('equal component with string', function () {
fastUriEqual(componentA, stringA)
})
benchFastUri.add('equal string with component', function () {
fastUriEqual(stringA, componentA)
})
benchFastUri.add('not equal string with string', function () {
fastUriEqual(stringA, stringB)
})
benchFastUri.add('not equal component with component', function () {
fastUriEqual(componentA, componentB)
})
benchFastUri.add('not equal component with string', function () {
fastUriEqual(componentA, stringB)
})
benchFastUri.add('not equal string with component', function () {
fastUriEqual(stringA, componentB)
})
await benchFastUri.run()
console.log(benchFastUri.name)
console.table(benchFastUri.table())

View File

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

View File

@@ -0,0 +1,8 @@
/** JSDoc */
export interface Package {
name: string;
version: string;
dependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
}
//# sourceMappingURL=package.d.ts.map

View File

@@ -0,0 +1,80 @@
<html>
<head>
</head>
<body>
<script>(function(){
var props = {};
function addObject(obj) {
if (obj == null) return;
try {
Object.getOwnPropertyNames(obj).forEach(add);
} catch(ex) {}
if (obj.prototype) {
Object.getOwnPropertyNames(obj.prototype).forEach(add);
}
if (typeof obj == "function") {
try {
Object.getOwnPropertyNames(new obj).forEach(add);
} catch(ex) {}
}
}
function add(name) {
if (/^[a-z_$][a-z0-9_$]*$/i.test(name)) {
props[name] = true;
}
}
Object.getOwnPropertyNames(window).forEach(function(thing){
addObject(window[thing]);
});
try {
addObject(new Event("click"));
addObject(new Event("contextmenu"));
addObject(new Event("mouseup"));
addObject(new Event("mousedown"));
addObject(new Event("keydown"));
addObject(new Event("keypress"));
addObject(new Event("keyup"));
addObject(new Event("input"));
addObject(new Event("touchstart"));
addObject(new Event("touchmove"));
addObject(new Event("touchend"));
addObject(new Event("touchcancel"));
addObject(new Event("pointerdown"));
addObject(new Event("pointermove"));
addObject(new Event("pointerup"));
addObject(new Event("pointercancel"));
addObject(new Event("pointerenter"));
addObject(new Event("pointerleave"));
} catch(ex) {console.error(ex)}
try {
addObject(Temporal.Duration.from({ years: 1 }));
addObject(new Temporal.Instant());
addObject(Temporal.Now);
addObject(new Temporal.PlainDate(2021, 7, 1));
addObject(new Temporal.ZonedDateTime(0n, "America/New_York"));
addObject(new Temporal.PlainYearMonth(2021, 7));
addObject(new Temporal.PlainTime());
addObject(new Temporal.PlainMonthDay(7, 1));
addObject(new Temporal.PlainDateTime(2021, 7, 1));
} catch(ex) {console.error(ex)}
var ta = document.createElement("textarea");
ta.style.width = "100%";
ta.style.height = "20em";
ta.style.boxSizing = "border-box";
ta.value = 'export var domprops = ' + JSON.stringify(Object.keys(props).sort(cmp), null, 4);
document.body.appendChild(ta);
function cmp(a, b) {
a = a.toLowerCase();
b = b.toLowerCase();
return a < b ? -1 : a > b ? 1 : 0;
}
})();</script>
</body>
</html>

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const metadata_1 = require("./metadata");
const nullable_1 = require("./nullable");
const error = {
message: "must be equal to one of the allowed values",
params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,
};
const def = {
keyword: "enum",
schemaType: "array",
error,
code(cxt) {
(0, metadata_1.checkMetadata)(cxt);
const { gen, data, schema, schemaValue, parentSchema, it } = cxt;
if (schema.length === 0)
throw new Error("enum must have non-empty array");
if (schema.length !== new Set(schema).size)
throw new Error("enum items must be unique");
let valid;
const isString = (0, codegen_1._) `typeof ${data} == "string"`;
if (schema.length >= it.opts.loopEnum) {
let cond;
[valid, cond] = (0, nullable_1.checkNullable)(cxt, isString);
gen.if(cond, loopEnum);
}
else {
/* istanbul ignore if */
if (!Array.isArray(schema))
throw new Error("ajv implementation error");
valid = (0, codegen_1.and)(isString, (0, codegen_1.or)(...schema.map((value) => (0, codegen_1._) `${data} === ${value}`)));
if (parentSchema.nullable)
valid = (0, codegen_1.or)((0, codegen_1._) `${data} === null`, valid);
}
cxt.pass(valid);
function loopEnum() {
gen.forOf("v", schemaValue, (v) => gen.if((0, codegen_1._) `${valid} = ${data} === ${v}`, () => gen.break()));
}
},
};
exports.default = def;
//# sourceMappingURL=enum.js.map

View File

@@ -0,0 +1,676 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @type {WeakMap<EXPECTED_OBJECT, WeakMap<EXPECTED_OBJECT, EXPECTED_OBJECT>>} */
const mergeCache = new WeakMap();
/** @typedef {Map<string, Map<string | number | boolean, EXPECTED_OBJECT>>} InnerPropertyCache */
/** @type {WeakMap<EXPECTED_OBJECT, InnerPropertyCache>} */
const setPropertyCache = new WeakMap();
const DELETE = Symbol("DELETE");
const DYNAMIC_INFO = Symbol("cleverMerge dynamic info");
/**
* Merges two given objects and caches the result to avoid computation if same objects passed as arguments again.
* @template T
* @template O
* @example
* // performs cleverMerge(first, second), stores the result in WeakMap and returns result
* cachedCleverMerge({a: 1}, {a: 2})
* {a: 2}
* // when same arguments passed, gets the result from WeakMap and returns it.
* cachedCleverMerge({a: 1}, {a: 2})
* {a: 2}
* @param {T | null | undefined} first first object
* @param {O | null | undefined} second second object
* @returns {T & O | T | O} merged object of first and second object
*/
const cachedCleverMerge = (first, second) => {
if (second === undefined) return /** @type {T} */ (first);
if (first === undefined) return /** @type {O} */ (second);
if (typeof second !== "object" || second === null) {
return /** @type {O} */ (second);
}
if (typeof first !== "object" || first === null) {
return /** @type {T} */ (first);
}
let innerCache = mergeCache.get(first);
if (innerCache === undefined) {
innerCache = new WeakMap();
mergeCache.set(first, innerCache);
}
const prevMerge = /** @type {T & O} */ (innerCache.get(second));
if (prevMerge !== undefined) return prevMerge;
const newMerge = _cleverMerge(first, second, true);
innerCache.set(second, newMerge);
return newMerge;
};
/**
* @template T
* @param {Partial<T>} obj object
* @param {string} property property
* @param {string | number | boolean} value assignment value
* @returns {T} new object
*/
const cachedSetProperty = (obj, property, value) => {
let mapByProperty = setPropertyCache.get(obj);
if (mapByProperty === undefined) {
mapByProperty = new Map();
setPropertyCache.set(obj, mapByProperty);
}
let mapByValue = mapByProperty.get(property);
if (mapByValue === undefined) {
mapByValue = new Map();
mapByProperty.set(property, mapByValue);
}
let result = mapByValue.get(value);
if (result) return /** @type {T} */ (result);
result = {
...obj,
[property]: value
};
mapByValue.set(value, result);
return /** @type {T} */ (result);
};
/**
* @typedef {Map<string, EXPECTED_ANY>} ByValues
*/
/**
* @template T
* @typedef {object} ObjectParsedPropertyEntry
* @property {T[keyof T] | undefined} base base value
* @property {`by${string}` | undefined} byProperty the name of the selector property
* @property {ByValues | undefined} byValues value depending on selector property, merged with base
*/
/** @typedef {(function(...EXPECTED_ANY): object) & { [DYNAMIC_INFO]: [DynamicFunction, object] }} DynamicFunction */
/**
* @template {object} T
* @typedef {Map<keyof T, ObjectParsedPropertyEntry<T>>} ParsedObjectStatic
*/
/**
* @template {object} T
* @typedef {{ byProperty: `by${string}`, fn: DynamicFunction }} ParsedObjectDynamic
*/
/**
* @template {object} T
* @typedef {object} ParsedObject
* @property {ParsedObjectStatic<T>} static static properties (key is property name)
* @property {ParsedObjectDynamic<T> | undefined} dynamic dynamic part
*/
/** @type {WeakMap<EXPECTED_OBJECT, ParsedObject<EXPECTED_ANY>>} */
const parseCache = new WeakMap();
/**
* @template {object} T
* @param {T} obj the object
* @returns {ParsedObject<T>} parsed object
*/
const cachedParseObject = (obj) => {
const entry = parseCache.get(/** @type {EXPECTED_OBJECT} */ (obj));
if (entry !== undefined) return entry;
const result = parseObject(obj);
parseCache.set(/** @type {EXPECTED_OBJECT} */ (obj), result);
return result;
};
/** @typedef {{ [p: string]: { [p: string]: EXPECTED_ANY } } | DynamicFunction} ByObject */
/**
* @template {object} T
* @param {T} obj the object
* @returns {ParsedObject<T>} parsed object
*/
const parseObject = (obj) => {
/** @type {ParsedObjectStatic<T>} */
const info = new Map();
/** @type {ParsedObjectDynamic<T> | undefined} */
let dynamicInfo;
/**
* @param {keyof T} p path
* @returns {Partial<ObjectParsedPropertyEntry<T>>} object parsed property entry
*/
const getInfo = (p) => {
const entry = info.get(p);
if (entry !== undefined) return entry;
const newEntry = {
base: undefined,
byProperty: undefined,
byValues: undefined
};
info.set(p, newEntry);
return newEntry;
};
for (const key_ of Object.keys(obj)) {
const key = /** @type {keyof T} */ (key_);
if (typeof key === "string" && key.startsWith("by")) {
const byProperty = key;
const byObj = /** @type {ByObject} */ (obj[byProperty]);
if (typeof byObj === "object") {
for (const byValue of Object.keys(byObj)) {
const obj = byObj[/** @type {keyof (keyof T)} */ (byValue)];
for (const key of Object.keys(obj)) {
const entry = getInfo(/** @type {keyof T} */ (key));
if (entry.byProperty === undefined) {
entry.byProperty = /** @type {`by${string}`} */ (byProperty);
entry.byValues = new Map();
} else if (entry.byProperty !== byProperty) {
throw new Error(
`${/** @type {string} */ (byProperty)} and ${entry.byProperty} for a single property is not supported`
);
}
/** @type {ByValues} */
(entry.byValues).set(byValue, obj[key]);
if (byValue === "default") {
for (const otherByValue of Object.keys(byObj)) {
if (
!(
/** @type {ByValues} */
(entry.byValues).has(otherByValue)
)
) {
/** @type {ByValues} */
(entry.byValues).set(otherByValue, undefined);
}
}
}
}
}
} else if (typeof byObj === "function") {
if (dynamicInfo === undefined) {
dynamicInfo = {
byProperty: /** @type {`by${string}`} */ (key),
fn: byObj
};
} else {
throw new Error(
`${key} and ${dynamicInfo.byProperty} when both are functions is not supported`
);
}
} else {
const entry = getInfo(key);
entry.base = obj[key];
}
} else {
const entry = getInfo(key);
entry.base = obj[key];
}
}
return {
static: info,
dynamic: dynamicInfo
};
};
/**
* @template {object} T
* @param {ParsedObjectStatic<T>} info static properties (key is property name)
* @param {{ byProperty: `by${string}`, fn: DynamicFunction } | undefined} dynamicInfo dynamic part
* @returns {T} the object
*/
const serializeObject = (info, dynamicInfo) => {
const obj = /** @type {EXPECTED_ANY} */ ({});
// Setup byProperty structure
for (const entry of info.values()) {
if (entry.byProperty !== undefined) {
const byProperty = entry.byProperty;
const byObj = (obj[byProperty] = obj[byProperty] || {});
for (const byValue of /** @type {ByValues} */ (entry.byValues).keys()) {
byObj[byValue] = byObj[byValue] || {};
}
}
}
for (const [key, entry] of info) {
if (entry.base !== undefined) {
obj[key] = entry.base;
}
// Fill byProperty structure
if (entry.byProperty !== undefined) {
const byProperty = entry.byProperty;
const byObj = (obj[byProperty] = obj[byProperty] || {});
for (const byValue of Object.keys(byObj)) {
const value = getFromByValues(
/** @type {ByValues} */
(entry.byValues),
byValue
);
if (value !== undefined) byObj[byValue][key] = value;
}
}
}
if (dynamicInfo !== undefined) {
obj[dynamicInfo.byProperty] = dynamicInfo.fn;
}
return obj;
};
const VALUE_TYPE_UNDEFINED = 0;
const VALUE_TYPE_ATOM = 1;
const VALUE_TYPE_ARRAY_EXTEND = 2;
const VALUE_TYPE_OBJECT = 3;
const VALUE_TYPE_DELETE = 4;
/**
* @template T
* @param {T} value a single value
* @returns {VALUE_TYPE_UNDEFINED | VALUE_TYPE_ATOM | VALUE_TYPE_ARRAY_EXTEND | VALUE_TYPE_OBJECT | VALUE_TYPE_DELETE} value type
*/
const getValueType = (value) => {
if (value === undefined) {
return VALUE_TYPE_UNDEFINED;
} else if (value === DELETE) {
return VALUE_TYPE_DELETE;
} else if (Array.isArray(value)) {
if (value.includes("...")) return VALUE_TYPE_ARRAY_EXTEND;
return VALUE_TYPE_ATOM;
} else if (
typeof value === "object" &&
value !== null &&
(!value.constructor || value.constructor === Object)
) {
return VALUE_TYPE_OBJECT;
}
return VALUE_TYPE_ATOM;
};
/**
* Merges two objects. Objects are deeply clever merged.
* Arrays might reference the old value with "...".
* Non-object values take preference over object values.
* @template T
* @template O
* @param {T} first first object
* @param {O} second second object
* @returns {T & O | T | O} merged object of first and second object
*/
const cleverMerge = (first, second) => {
if (second === undefined) return first;
if (first === undefined) return second;
if (typeof second !== "object" || second === null) return second;
if (typeof first !== "object" || first === null) return first;
return /** @type {T & O} */ (_cleverMerge(first, second, false));
};
/**
* @template {object} T
* @template {object} O
* Merges two objects. Objects are deeply clever merged.
* @param {T} first first
* @param {O} second second
* @param {boolean} internalCaching should parsing of objects and nested merges be cached
* @returns {T & O} merged object of first and second object
*/
const _cleverMerge = (first, second, internalCaching = false) => {
const firstObject = internalCaching
? cachedParseObject(first)
: parseObject(first);
const { static: firstInfo, dynamic: firstDynamicInfo } = firstObject;
// If the first argument has a dynamic part we modify the dynamic part to merge the second argument
if (firstDynamicInfo !== undefined) {
let { byProperty, fn } = firstDynamicInfo;
const fnInfo = fn[DYNAMIC_INFO];
if (fnInfo) {
second =
/** @type {O} */
(
internalCaching
? cachedCleverMerge(fnInfo[1], second)
: cleverMerge(fnInfo[1], second)
);
fn = fnInfo[0];
}
/** @type {DynamicFunction} */
const newFn = (...args) => {
const fnResult = fn(...args);
return internalCaching
? cachedCleverMerge(fnResult, second)
: cleverMerge(fnResult, second);
};
newFn[DYNAMIC_INFO] = [fn, second];
return /** @type {T & O} */ (
serializeObject(firstObject.static, { byProperty, fn: newFn })
);
}
// If the first part is static only, we merge the static parts and keep the dynamic part of the second argument
const secondObject = internalCaching
? cachedParseObject(second)
: parseObject(second);
const { static: secondInfo, dynamic: secondDynamicInfo } = secondObject;
const resultInfo = new Map();
for (const [key, firstEntry] of firstInfo) {
const secondEntry = secondInfo.get(
/** @type {keyof (T | O)} */
(key)
);
const entry =
secondEntry !== undefined
? mergeEntries(firstEntry, secondEntry, internalCaching)
: firstEntry;
resultInfo.set(key, entry);
}
for (const [key, secondEntry] of secondInfo) {
if (!firstInfo.has(/** @type {keyof (T | O)} */ (key))) {
resultInfo.set(key, secondEntry);
}
}
return /** @type {T & O} */ (serializeObject(resultInfo, secondDynamicInfo));
};
/**
* @template T, O
* @param {ObjectParsedPropertyEntry<T>} firstEntry a
* @param {ObjectParsedPropertyEntry<O>} secondEntry b
* @param {boolean} internalCaching should parsing of objects and nested merges be cached
* @returns {ObjectParsedPropertyEntry<T> | ObjectParsedPropertyEntry<O> | ObjectParsedPropertyEntry<T & O>} new entry
*/
const mergeEntries = (firstEntry, secondEntry, internalCaching) => {
switch (getValueType(secondEntry.base)) {
case VALUE_TYPE_ATOM:
case VALUE_TYPE_DELETE:
// No need to consider firstEntry at all
// second value override everything
// = second.base + second.byProperty
return secondEntry;
case VALUE_TYPE_UNDEFINED:
if (!firstEntry.byProperty) {
// = first.base + second.byProperty
return {
base: firstEntry.base,
byProperty: secondEntry.byProperty,
byValues: secondEntry.byValues
};
} else if (firstEntry.byProperty !== secondEntry.byProperty) {
throw new Error(
`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`
);
} else {
// = first.base + (first.byProperty + second.byProperty)
// need to merge first and second byValues
/** @type {Map<string, T & O>} */
const newByValues = new Map(firstEntry.byValues);
for (const [key, value] of /** @type {ByValues} */ (
secondEntry.byValues
)) {
const firstValue = getFromByValues(
/** @type {ByValues} */
(firstEntry.byValues),
key
);
newByValues.set(
key,
mergeSingleValue(firstValue, value, internalCaching)
);
}
return {
base: firstEntry.base,
byProperty: firstEntry.byProperty,
byValues: newByValues
};
}
default: {
if (!firstEntry.byProperty) {
// The simple case
// = (first.base + second.base) + second.byProperty
return {
base:
/** @type {T[keyof T] & O[keyof O]} */
(
mergeSingleValue(
firstEntry.base,
secondEntry.base,
internalCaching
)
),
byProperty: secondEntry.byProperty,
byValues: secondEntry.byValues
};
}
/** @type {O[keyof O] | T[keyof T] | (T[keyof T] & O[keyof O]) | (T[keyof T] | undefined)[] | (O[keyof O] | undefined)[] | (O[keyof O] | T[keyof T] | undefined)[] | undefined} */
let newBase;
/** @type {Map<string, (T & O) | O[keyof O] | (O[keyof O] | undefined)[] | ((T & O) | undefined)[] | (T & O & O[keyof O]) | ((T & O) | O[keyof O] | undefined)[] | undefined>} */
const intermediateByValues = new Map(firstEntry.byValues);
for (const [key, value] of intermediateByValues) {
intermediateByValues.set(
key,
mergeSingleValue(value, secondEntry.base, internalCaching)
);
}
if (
[.../** @type {ByValues} */ (firstEntry.byValues).values()].every(
(value) => {
const type = getValueType(value);
return type === VALUE_TYPE_ATOM || type === VALUE_TYPE_DELETE;
}
)
) {
// = (first.base + second.base) + ((first.byProperty + second.base) + second.byProperty)
newBase = mergeSingleValue(
firstEntry.base,
secondEntry.base,
internalCaching
);
} else {
// = first.base + ((first.byProperty (+default) + second.base) + second.byProperty)
newBase = firstEntry.base;
if (!intermediateByValues.has("default")) {
intermediateByValues.set("default", secondEntry.base);
}
}
if (!secondEntry.byProperty) {
// = first.base + (first.byProperty + second.base)
return {
base: /** @type {T[keyof T] & O[keyof O]} */ (newBase),
byProperty: firstEntry.byProperty,
byValues: intermediateByValues
};
} else if (firstEntry.byProperty !== secondEntry.byProperty) {
throw new Error(
`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`
);
}
/** @type {Map<string, (T & O) | O[keyof O] | (O[keyof O] | undefined)[] | (T & O & O[keyof O]) | ((T & O) | undefined)[] | ((T & O) | O[keyof O] | undefined)[] | undefined>} */
const newByValues = new Map(intermediateByValues);
for (const [key, value] of /** @type {ByValues} */ (
secondEntry.byValues
)) {
const firstValue = getFromByValues(intermediateByValues, key);
newByValues.set(
key,
mergeSingleValue(firstValue, value, internalCaching)
);
}
return {
base: /** @type {T[keyof T] & O[keyof O]} */ (newBase),
byProperty: firstEntry.byProperty,
byValues: newByValues
};
}
}
};
/**
* @template V
* @param {ByValues} byValues all values
* @param {string} key value of the selector
* @returns {V | undefined} value
*/
const getFromByValues = (byValues, key) => {
if (key !== "default" && byValues.has(key)) {
return byValues.get(key);
}
return byValues.get("default");
};
/**
* @template A
* @template B
* @param {A | A[]} a value
* @param {B | B[]} b value
* @param {boolean} internalCaching should parsing of objects and nested merges be cached
* @returns {A & B | (A | B)[] | A | A[] | B | B[]} value
*/
const mergeSingleValue = (a, b, internalCaching) => {
const bType = getValueType(b);
const aType = getValueType(a);
switch (bType) {
case VALUE_TYPE_DELETE:
case VALUE_TYPE_ATOM:
return b;
case VALUE_TYPE_OBJECT: {
return aType !== VALUE_TYPE_OBJECT
? b
: internalCaching
? cachedCleverMerge(a, b)
: cleverMerge(a, b);
}
case VALUE_TYPE_UNDEFINED:
return a;
case VALUE_TYPE_ARRAY_EXTEND:
switch (
aType !== VALUE_TYPE_ATOM
? aType
: Array.isArray(a)
? VALUE_TYPE_ARRAY_EXTEND
: VALUE_TYPE_OBJECT
) {
case VALUE_TYPE_UNDEFINED:
return b;
case VALUE_TYPE_DELETE:
return /** @type {B[]} */ (b).filter((item) => item !== "...");
case VALUE_TYPE_ARRAY_EXTEND: {
/** @type {(A | B)[]} */
const newArray = [];
for (const item of /** @type {B[]} */ (b)) {
if (item === "...") {
for (const item of /** @type {A[]} */ (a)) {
newArray.push(item);
}
} else {
newArray.push(item);
}
}
return newArray;
}
case VALUE_TYPE_OBJECT:
return /** @type {(A | B)[]} */ (b).map((item) =>
item === "..." ? /** @type {A} */ (a) : item
);
default:
throw new Error("Not implemented");
}
default:
throw new Error("Not implemented");
}
};
/**
* @template {object} T
* @param {T} obj the object
* @param {(keyof T)[]=} keysToKeepOriginalValue keys to keep original value
* @returns {T} the object without operations like "..." or DELETE
*/
const removeOperations = (obj, keysToKeepOriginalValue = []) => {
const newObj = /** @type {T} */ ({});
for (const _key of Object.keys(obj)) {
const key = /** @type {keyof T} */ (_key);
const value = obj[key];
const type = getValueType(value);
if (type === VALUE_TYPE_OBJECT && keysToKeepOriginalValue.includes(key)) {
newObj[key] = value;
continue;
}
switch (type) {
case VALUE_TYPE_UNDEFINED:
case VALUE_TYPE_DELETE:
break;
case VALUE_TYPE_OBJECT:
newObj[key] =
/** @type {T[keyof T]} */
(
removeOperations(
/** @type {T} */
(value),
keysToKeepOriginalValue
)
);
break;
case VALUE_TYPE_ARRAY_EXTEND:
newObj[key] =
/** @type {T[keyof T]} */
(
/** @type {EXPECTED_ANY[]} */
(value).filter((i) => i !== "...")
);
break;
default:
newObj[key] = value;
break;
}
}
return newObj;
};
/**
* @template T
* @template {keyof T} P
* @template V
* @param {T} obj the object
* @param {P} byProperty the by description
* @param {...V} values values
* @returns {Omit<T, P>} object with merged byProperty
*/
const resolveByProperty = (obj, byProperty, ...values) => {
if (typeof obj !== "object" || obj === null || !(byProperty in obj)) {
return obj;
}
const { [byProperty]: _byValue, ..._remaining } = obj;
const remaining = /** @type {T} */ (_remaining);
const byValue =
/** @type {Record<string, T> | ((...args: V[]) => T)} */
(_byValue);
if (typeof byValue === "object") {
const key = /** @type {string} */ (values[0]);
if (key in byValue) {
return cachedCleverMerge(remaining, byValue[key]);
} else if ("default" in byValue) {
return cachedCleverMerge(remaining, byValue.default);
}
return remaining;
} else if (typeof byValue === "function") {
// eslint-disable-next-line prefer-spread
const result = byValue.apply(null, values);
return cachedCleverMerge(
remaining,
resolveByProperty(result, byProperty, ...values)
);
}
return obj;
};
module.exports.DELETE = DELETE;
module.exports.cachedCleverMerge = cachedCleverMerge;
module.exports.cachedSetProperty = cachedSetProperty;
module.exports.cleverMerge = cleverMerge;
module.exports.removeOperations = removeOperations;
module.exports.resolveByProperty = resolveByProperty;

View File

@@ -0,0 +1,6 @@
language: node_js
script: make test
node_js:
- "stable"
- "4"
- "0.12"

View File

@@ -0,0 +1,23 @@
(function (Prism) {
Prism.languages.ignore = {
// https://git-scm.com/docs/gitignore
'comment': /^#.*/m,
'entry': {
pattern: /\S(?:.*(?:(?:\\ )|\S))?/,
alias: 'string',
inside: {
'operator': /^!|\*\*?|\?/,
'regex': {
pattern: /(^|[^\\])\[[^\[\]]*\]/,
lookbehind: true
},
'punctuation': /\//
}
}
};
Prism.languages.gitignore = Prism.languages.ignore;
Prism.languages.hgignore = Prism.languages.ignore;
Prism.languages.npmignore = Prism.languages.ignore;
}(Prism));

View File

@@ -0,0 +1,17 @@
import type { FPArity, FPFn, FPFnInput } from "../types";
/**
* Converts a function to a curried function that accepts arguments in reverse
* order.
*
* @param fn - The function to convert to FP
* @param arity - The arity of the function
* @param curriedArgs - The curried arguments
*
* @returns FP version of the function
*
* @private
*/
export declare function convertToFP<
Fn extends FPFnInput,
Arity extends FPArity,
>(fn: Fn, arity: Arity, curriedArgs?: unknown[]): FPFn<Fn, Arity>;

View File

@@ -0,0 +1,147 @@
"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 session_exports = {};
__export(session_exports, {
ExpoSQLitePreparedQuery: () => ExpoSQLitePreparedQuery,
ExpoSQLiteSession: () => ExpoSQLiteSession,
ExpoSQLiteTransaction: () => ExpoSQLiteTransaction
});
module.exports = __toCommonJS(session_exports);
var import_entity = require("../entity.cjs");
var import_logger = require("../logger.cjs");
var import_sql = require("../sql/sql.cjs");
var import_sqlite_core = require("../sqlite-core/index.cjs");
var import_session = require("../sqlite-core/session.cjs");
var import_utils = require("../utils.cjs");
class ExpoSQLiteSession extends import_session.SQLiteSession {
constructor(client, dialect, schema, options = {}) {
super(dialect);
this.client = client;
this.schema = schema;
this.logger = options.logger ?? new import_logger.NoopLogger();
}
static [import_entity.entityKind] = "ExpoSQLiteSession";
logger;
prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper) {
const stmt = this.client.prepareSync(query.sql);
return new ExpoSQLitePreparedQuery(
stmt,
query,
this.logger,
fields,
executeMethod,
isResponseInArrayMode,
customResultMapper
);
}
transaction(transaction, config = {}) {
const tx = new ExpoSQLiteTransaction("sync", this.dialect, this, this.schema);
this.run(import_sql.sql.raw(`begin${config?.behavior ? " " + config.behavior : ""}`));
try {
const result = transaction(tx);
this.run(import_sql.sql`commit`);
return result;
} catch (err) {
this.run(import_sql.sql`rollback`);
throw err;
}
}
}
class ExpoSQLiteTransaction extends import_sqlite_core.SQLiteTransaction {
static [import_entity.entityKind] = "ExpoSQLiteTransaction";
transaction(transaction) {
const savepointName = `sp${this.nestedIndex}`;
const tx = new ExpoSQLiteTransaction("sync", this.dialect, this.session, this.schema, this.nestedIndex + 1);
this.session.run(import_sql.sql.raw(`savepoint ${savepointName}`));
try {
const result = transaction(tx);
this.session.run(import_sql.sql.raw(`release savepoint ${savepointName}`));
return result;
} catch (err) {
this.session.run(import_sql.sql.raw(`rollback to savepoint ${savepointName}`));
throw err;
}
}
}
class ExpoSQLitePreparedQuery extends import_session.SQLitePreparedQuery {
constructor(stmt, query, logger, fields, executeMethod, _isResponseInArrayMode, customResultMapper) {
super("sync", executeMethod, query);
this.stmt = stmt;
this.logger = logger;
this.fields = fields;
this._isResponseInArrayMode = _isResponseInArrayMode;
this.customResultMapper = customResultMapper;
}
static [import_entity.entityKind] = "ExpoSQLitePreparedQuery";
run(placeholderValues) {
const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
const { changes, lastInsertRowId } = this.stmt.executeSync(params);
return {
changes,
lastInsertRowId
};
}
all(placeholderValues) {
const { fields, joinsNotNullableMap, query, logger, stmt, customResultMapper } = this;
if (!fields && !customResultMapper) {
const params = (0, import_sql.fillPlaceholders)(query.params, placeholderValues ?? {});
logger.logQuery(query.sql, params);
return stmt.executeSync(params).getAllSync();
}
const rows = this.values(placeholderValues);
if (customResultMapper) {
return customResultMapper(rows);
}
return rows.map((row) => (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap));
}
get(placeholderValues) {
const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
const { fields, stmt, joinsNotNullableMap, customResultMapper } = this;
if (!fields && !customResultMapper) {
return stmt.executeSync(params).getFirstSync();
}
const rows = this.values(placeholderValues);
const row = rows[0];
if (!row) {
return void 0;
}
if (customResultMapper) {
return customResultMapper(rows);
}
return (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap);
}
values(placeholderValues) {
const params = (0, import_sql.fillPlaceholders)(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
return this.stmt.executeForRawResultSync(params).getAllSync();
}
/** @internal */
isResponseInArrayMode() {
return this._isResponseInArrayMode;
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ExpoSQLitePreparedQuery,
ExpoSQLiteSession,
ExpoSQLiteTransaction
});
//# sourceMappingURL=session.cjs.map

View File

@@ -0,0 +1,33 @@
import { entityKind } from "../entity.cjs";
import type { AnySQLiteColumn, SQLiteColumn } from "./columns/index.cjs";
import { SQLiteTable } from "./table.cjs";
export declare function primaryKey<TTableName extends string, TColumn extends AnySQLiteColumn<{
tableName: TTableName;
}>, TColumns extends AnySQLiteColumn<{
tableName: TTableName;
}>[]>(config: {
name?: string;
columns: [TColumn, ...TColumns];
}): PrimaryKeyBuilder;
/**
* @deprecated: Please use primaryKey({ columns: [] }) instead of this function
* @param columns
*/
export declare function primaryKey<TTableName extends string, TColumns extends AnySQLiteColumn<{
tableName: TTableName;
}>[]>(...columns: TColumns): PrimaryKeyBuilder;
export declare class PrimaryKeyBuilder {
static readonly [entityKind]: string;
_: {
brand: 'SQLitePrimaryKeyBuilder';
};
constructor(columns: SQLiteColumn[], name?: string);
}
export declare class PrimaryKey {
readonly table: SQLiteTable;
static readonly [entityKind]: string;
readonly columns: SQLiteColumn[];
readonly name?: string;
constructor(table: SQLiteTable, columns: SQLiteColumn[], name?: string);
getName(): string;
}

View File

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

View File

@@ -0,0 +1,134 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "کاراکتر", verb: "داشته باشد" },
file: { unit: "بایت", verb: "داشته باشد" },
array: { unit: "آیتم", verb: "داشته باشد" },
set: { unit: "آیتم", verb: "داشته باشد" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const parsedType = (data: any): string => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "عدد";
}
case "object": {
if (Array.isArray(data)) {
return "آرایه";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "ورودی",
email: "آدرس ایمیل",
url: "URL",
emoji: "ایموجی",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "تاریخ و زمان ایزو",
date: "تاریخ ایزو",
time: "زمان ایزو",
duration: "مدت زمان ایزو",
ipv4: "IPv4 آدرس",
ipv6: "IPv6 آدرس",
cidrv4: "IPv4 دامنه",
cidrv6: "IPv6 دامنه",
base64: "base64-encoded رشته",
base64url: "base64url-encoded رشته",
json_string: "JSON رشته",
e164: "E.164 عدد",
jwt: "JWT",
template_literal: "ورودی",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `ورودی نامعتبر: می‌بایست ${issue.expected} می‌بود، ${parsedType(issue.input)} دریافت شد`;
case "invalid_value":
if (issue.values.length === 1) {
return `ورودی نامعتبر: می‌بایست ${util.stringifyPrimitive(issue.values[0])} می‌بود`;
}
return `گزینه نامعتبر: می‌بایست یکی از ${util.joinValues(issue.values, "|")} می‌بود`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `خیلی بزرگ: ${issue.origin ?? "مقدار"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصر"} باشد`;
}
return `خیلی بزرگ: ${issue.origin ?? "مقدار"} باید ${adj}${issue.maximum.toString()} باشد`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `خیلی کوچک: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} باشد`;
}
return `خیلی کوچک: ${issue.origin} باید ${adj}${issue.minimum.toString()} باشد`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") {
return `رشته نامعتبر: باید با "${_issue.prefix}" شروع شود`;
}
if (_issue.format === "ends_with") {
return `رشته نامعتبر: باید با "${_issue.suffix}" تمام شود`;
}
if (_issue.format === "includes") {
return `رشته نامعتبر: باید شامل "${_issue.includes}" باشد`;
}
if (_issue.format === "regex") {
return `رشته نامعتبر: باید با الگوی ${_issue.pattern} مطابقت داشته باشد`;
}
return `${Nouns[_issue.format] ?? issue.format} نامعتبر`;
}
case "not_multiple_of":
return `عدد نامعتبر: باید مضرب ${issue.divisor} باشد`;
case "unrecognized_keys":
return `کلید${issue.keys.length > 1 ? "های" : ""} ناشناس: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `کلید ناشناس در ${issue.origin}`;
case "invalid_union":
return `ورودی نامعتبر`;
case "invalid_element":
return `مقدار نامعتبر در ${issue.origin}`;
default:
return `ورودی نامعتبر`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../src/schema/traverseFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAW7C,OAAO,KAAK,EACV,cAAc,EACd,MAAM,EACN,SAAS,EAET,QAAQ,EAER,WAAW,EACX,WAAW,EACZ,MAAM,aAAa,CAAA;AAepB,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAClC,cAAc,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACjC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACzC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACxC,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,gBAAgB,EAAE,WAAW,CAAA;IAC7B,oBAAoB,CAAC,EAAE,WAAW,CAAA;IAClC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,WAAW,CAAA;IACxB,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAChC,QAAQ,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACtC,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,iBAAiB,EAAE,OAAO,CAAA;IAC1B,2BAA2B,EAAE,OAAO,CAAA;IACpC,yBAAyB,EAAE,OAAO,CAAA;IAClC,6BAA6B,EAAE,OAAO,CAAA;IACtC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAA;IACrC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,cAAc,sZA0BxB,IAAI,KAAG,MAq7BT,CAAA"}

View File

@@ -0,0 +1 @@
.token.cr,.token.lf,.token.space,.token.tab:not(:empty){position:relative}.token.cr:before,.token.lf:before,.token.space:before,.token.tab:not(:empty):before{color:grey;opacity:.6;position:absolute}.token.tab:not(:empty):before{content:'\21E5'}.token.cr:before{content:'\240D'}.token.crlf:before{content:'\240D\240A'}.token.lf:before{content:'\240A'}.token.space:before{content:'\00B7'}

View File

@@ -0,0 +1,5 @@
/**
* Sentry Logo
*/
export declare function SentryLogo(): SVGElement;
//# sourceMappingURL=SentryLogo.d.ts.map

View File

@@ -0,0 +1,19 @@
export type Schema = import("./validate").Schema;
export type JSONSchema4 = import("./validate").JSONSchema4;
export type JSONSchema6 = import("./validate").JSONSchema6;
export type JSONSchema7 = import("./validate").JSONSchema7;
export type ExtendedSchema = import("./validate").ExtendedSchema;
export type ValidationErrorConfiguration =
import("./validate").ValidationErrorConfiguration;
import { validate } from "./validate";
import { ValidationError } from "./validate";
import { enableValidation } from "./validate";
import { disableValidation } from "./validate";
import { needValidate } from "./validate";
export {
validate,
ValidationError,
enableValidation,
disableValidation,
needValidate,
};

View File

@@ -0,0 +1,15 @@
import { ExtendedQuery } from "../types/query.js";
//#region src/utils/query-to-params.d.ts
/**
* Transform nested query object to an url compatible format
*
* @param query The nested query object
*
* @returns Flat query parameters
*/
declare const queryToParams: <Schema = any, Item = Record<string, unknown>>(query: ExtendedQuery<Schema, Item>) => Record<string, string>;
//#endregion
export { queryToParams };
//# sourceMappingURL=query-to-params.d.ts.map

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