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,23 @@
@import '../../../../scss/styles';
@layer payload-default {
.query-preset-where-field {
.field-label {
margin-bottom: calc(var(--base) / 2);
}
.value-wrapper {
background-color: var(--theme-elevation-50);
padding: var(--base);
}
}
.query-preset-where-field {
.pill {
&--style-always-white {
background: var(--theme-elevation-250);
color: var(--theme-elevation-1000);
}
}
}
}

View File

@@ -0,0 +1,3 @@
import type { Execute } from './types.js';
export declare const execute: Execute<any>;
//# sourceMappingURL=execute.d.ts.map

View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
const dateFormats = {
full: "EEEE, d MMMM y",
long: "d MMMM y",
medium: "d MMM y",
short: "d/M/yy",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
const dateTimeFormats = {
full: "{{date}} - {{time}}",
long: "{{date}} - {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["getFromImportMap","isPlainObject","isReactServerComponentOrFunction","React","removeUndefined","RenderServerComponent","clientProps","Component","Fallback","importMap","key","serverProps","Array","isArray","map","c","index","isRSC","sanitizedProps","_jsx","ResolvedComponent","PayloadComponent","schemaPath"],"sources":["../../../src/elements/RenderServerComponent/index.tsx"],"sourcesContent":["import type { ImportMap, PayloadComponent } from 'payload'\n\nimport { getFromImportMap, isPlainObject, isReactServerComponentOrFunction } from 'payload/shared'\nimport React from 'react'\n\nimport { removeUndefined } from '../../utilities/removeUndefined.js'\n\ntype RenderServerComponentFn = (args: {\n readonly clientProps?: object\n readonly Component?:\n | PayloadComponent\n | PayloadComponent[]\n | React.ComponentType\n | React.ComponentType[]\n readonly Fallback?: React.ComponentType\n readonly importMap: ImportMap\n readonly key?: string\n readonly serverProps?: object\n}) => React.ReactNode\n\n/**\n * Can be used to render both MappedComponents and React Components.\n */\nexport const RenderServerComponent: RenderServerComponentFn = ({\n clientProps = {},\n Component,\n Fallback,\n importMap,\n key,\n serverProps,\n}) => {\n if (Array.isArray(Component)) {\n return Component.map((c, index) =>\n RenderServerComponent({\n clientProps,\n Component: c,\n importMap,\n key: index,\n serverProps,\n }),\n )\n }\n\n if (typeof Component === 'function') {\n const isRSC = isReactServerComponentOrFunction(Component)\n\n // prevent $undefined from being passed through the rsc requests\n const sanitizedProps = removeUndefined({\n ...clientProps,\n ...(isRSC ? serverProps : {}),\n })\n\n return <Component key={key} {...sanitizedProps} />\n }\n\n if (typeof Component === 'string' || isPlainObject(Component)) {\n const ResolvedComponent = getFromImportMap<React.ComponentType>({\n importMap,\n PayloadComponent: Component,\n schemaPath: '',\n })\n\n if (ResolvedComponent) {\n const isRSC = isReactServerComponentOrFunction(ResolvedComponent)\n\n // prevent $undefined from being passed through rsc requests\n const sanitizedProps = removeUndefined({\n ...clientProps,\n ...(isRSC ? serverProps : {}),\n ...(isRSC && typeof Component === 'object' && Component?.serverProps\n ? Component.serverProps\n : {}),\n ...(typeof Component === 'object' && Component?.clientProps ? Component.clientProps : {}),\n })\n\n return <ResolvedComponent key={key} {...sanitizedProps} />\n }\n }\n\n return Fallback\n ? RenderServerComponent({\n clientProps,\n Component: Fallback,\n importMap,\n key,\n serverProps,\n })\n : null\n}\n"],"mappings":";AAEA,SAASA,gBAAgB,EAAEC,aAAa,EAAEC,gCAAgC,QAAQ;AAClF,OAAOC,KAAA,MAAW;AAElB,SAASC,eAAe,QAAQ;AAehC;;;AAGA,OAAO,MAAMC,qBAAA,GAAiDA,CAAC;EAC7DC,WAAA,GAAc,CAAC,CAAC;EAChBC,SAAS;EACTC,QAAQ;EACRC,SAAS;EACTC,GAAG;EACHC;AAAW,CACZ;EACC,IAAIC,KAAA,CAAMC,OAAO,CAACN,SAAA,GAAY;IAC5B,OAAOA,SAAA,CAAUO,GAAG,CAAC,CAACC,CAAA,EAAGC,KAAA,KACvBX,qBAAA,CAAsB;MACpBC,WAAA;MACAC,SAAA,EAAWQ,CAAA;MACXN,SAAA;MACAC,GAAA,EAAKM,KAAA;MACLL;IACF;EAEJ;EAEA,IAAI,OAAOJ,SAAA,KAAc,YAAY;IACnC,MAAMU,KAAA,GAAQf,gCAAA,CAAiCK,SAAA;IAE/C;IACA,MAAMW,cAAA,GAAiBd,eAAA,CAAgB;MACrC,GAAGE,WAAW;MACd,IAAIW,KAAA,GAAQN,WAAA,GAAc,CAAC,CAAC;IAC9B;IAEA,oBAAOQ,IAAA,CAACZ,SAAA;MAAqB,GAAGW;OAATR,GAAA;EACzB;EAEA,IAAI,OAAOH,SAAA,KAAc,YAAYN,aAAA,CAAcM,SAAA,GAAY;IAC7D,MAAMa,iBAAA,GAAoBpB,gBAAA,CAAsC;MAC9DS,SAAA;MACAY,gBAAA,EAAkBd,SAAA;MAClBe,UAAA,EAAY;IACd;IAEA,IAAIF,iBAAA,EAAmB;MACrB,MAAMH,KAAA,GAAQf,gCAAA,CAAiCkB,iBAAA;MAE/C;MACA,MAAMF,cAAA,GAAiBd,eAAA,CAAgB;QACrC,GAAGE,WAAW;QACd,IAAIW,KAAA,GAAQN,WAAA,GAAc,CAAC,CAAC;QAC5B,IAAIM,KAAA,IAAS,OAAOV,SAAA,KAAc,YAAYA,SAAA,EAAWI,WAAA,GACrDJ,SAAA,CAAUI,WAAW,GACrB,CAAC,CAAC;QACN,IAAI,OAAOJ,SAAA,KAAc,YAAYA,SAAA,EAAWD,WAAA,GAAcC,SAAA,CAAUD,WAAW,GAAG,CAAC,CAAC;MAC1F;MAEA,oBAAOa,IAAA,CAACC,iBAAA;QAA6B,GAAGF;SAATR,GAAA;IACjC;EACF;EAEA,OAAOF,QAAA,GACHH,qBAAA,CAAsB;IACpBC,WAAA;IACAC,SAAA,EAAWC,QAAA;IACXC,SAAA;IACAC,GAAA;IACAC;EACF,KACA;AACN","ignoreList":[]}

View File

@@ -0,0 +1,53 @@
"use strict";
exports.compareAsc = compareAsc;
var _index = require("./toDate.js");
/**
* @name compareAsc
* @category Common Helpers
* @summary Compare the two dates and return -1, 0 or 1.
*
* @description
* Compare the two dates and return 1 if the first date is after the second,
* -1 if the first date is before the second or 0 if dates are equal.
*
* @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 dateLeft - The first date to compare
* @param dateRight - The second date to compare
*
* @returns The result of the comparison
*
* @example
* // Compare 11 February 1987 and 10 July 1989:
* const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
* //=> -1
*
* @example
* // Sort the array of dates:
* const result = [
* new Date(1995, 6, 2),
* new Date(1987, 1, 11),
* new Date(1989, 6, 10)
* ].sort(compareAsc)
* //=> [
* // Wed Feb 11 1987 00:00:00,
* // Mon Jul 10 1989 00:00:00,
* // Sun Jul 02 1995 00:00:00
* // ]
*/
function compareAsc(dateLeft, dateRight) {
const _dateLeft = (0, _index.toDate)(dateLeft);
const _dateRight = (0, _index.toDate)(dateRight);
const diff = _dateLeft.getTime() - _dateRight.getTime();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1;
// Return 0 if diff is 0; return NaN if diff is NaN
} else {
return diff;
}
}

View File

@@ -0,0 +1,18 @@
/*
* 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.
*/
import { noopDetector } from '../../NoopDetector';
export const osDetector = noopDetector;
//# sourceMappingURL=OSDetector.js.map

View File

@@ -0,0 +1,5 @@
@layer payload-default {
.colored-folder-icon {
color: var(--theme-elevation-300);
}
}

View File

@@ -0,0 +1,197 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { getTranslation } from '@payloadcms/translations';
import { useRouter, useSearchParams } from 'next/navigation.js';
import { formatAdminURL, mergeListSearchAndWhere } from 'payload/shared';
import * as qs from 'qs-esm';
import React from 'react';
import { toast } from 'sonner';
import { CheckboxInput } from '../../fields/Checkbox/Input.js';
import { useAuth } from '../../providers/Auth/index.js';
import { useConfig } from '../../providers/Config/index.js';
import { useLocale } from '../../providers/Locale/index.js';
import { useRouteCache } from '../../providers/RouteCache/index.js';
import { SelectAllStatus, useSelection } from '../../providers/Selection/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { requests } from '../../utilities/api.js';
import { parseSearchParams } from '../../utilities/parseSearchParams.js';
import { ConfirmationModal } from '../ConfirmationModal/index.js';
import { ListSelectionButton } from '../ListSelection/index.js';
import './index.scss';
const confirmManyRestoreDrawerSlug = `confirm-restore-many-docs`;
const baseClass = 'restore-many';
export const RestoreMany = props => {
const {
collection: {
slug
} = {},
viewType
} = props;
const {
permissions
} = useAuth();
const {
config: {
collections,
routes,
serverURL
}
} = useConfig();
const {
code: locale
} = useLocale();
const router = useRouter();
const {
clearRouteCache
} = useRouteCache();
const searchParams = useSearchParams();
const {
count,
getSelectedIds,
selectAll,
toggleAll
} = useSelection();
const {
openModal
} = useModal();
const {
i18n,
t
} = useTranslation();
const [restoreAsPublished, setRestoreAsPublished] = React.useState(false);
const collectionPermissions = permissions?.collections?.[slug];
const hasUpdatePermission = collectionPermissions?.update;
if (selectAll === SelectAllStatus.None || !hasUpdatePermission || viewType !== 'trash') {
return null;
}
const selectingAll = selectAll === SelectAllStatus.AllAvailable;
const selectedIDs = !selectingAll ? getSelectedIds() : [];
const baseWhere = parseSearchParams(searchParams)?.where;
const finalWhere = {
and: [...(Array.isArray(baseWhere?.and) ? baseWhere.and : baseWhere ? [baseWhere] : []), {
deletedAt: {
exists: true
}
}]
};
const handleRestore = async () => {
const collectionConfig = collections.find(c => c.slug === slug);
if (!collectionConfig) {
return;
}
let whereConstraint;
if (selectingAll) {
whereConstraint = finalWhere;
} else {
whereConstraint = {
and: [{
id: {
in: selectedIDs
}
}, {
deletedAt: {
exists: true
}
}]
};
}
const url = formatAdminURL({
apiRoute: routes.api,
path: `/${slug}${qs.stringify({
limit: 0,
locale,
select: {},
trash: true,
where: mergeListSearchAndWhere({
collectionConfig,
search: parseSearchParams(searchParams)?.search,
where: whereConstraint
})
}, {
addQueryPrefix: true
})}`
});
const body = {
deletedAt: null
};
// Only include _status if drafts are enabled
if (collectionConfig?.versions?.drafts) {
body._status = restoreAsPublished ? 'published' : 'draft';
}
const restoreManyResponse = await requests.patch(url, {
body: JSON.stringify(body),
headers: {
'Accept-Language': i18n.language,
'Content-Type': 'application/json'
}
});
try {
const {
plural,
singular
} = collectionConfig.labels;
const json = await restoreManyResponse.json();
const restoredDocs = json?.docs?.length || 0;
const successLabel = restoredDocs > 1 ? plural : singular;
if (restoreManyResponse.status < 400 || restoredDocs > 0) {
toast.success(t('general:restoredCountSuccessfully', {
count: restoredDocs,
label: getTranslation(successLabel, i18n)
}));
}
if (json?.errors?.length > 0) {
toast.error(json.message, {
description: json.errors.map(e => e.message).join('\n')
});
}
} catch (err) {
toast.error(t('error:unknown'));
}
toggleAll();
router.replace(qs.stringify({
...parseSearchParams(searchParams),
page: selectingAll ? '1' : undefined
}, {
addQueryPrefix: true
}));
clearRouteCache();
};
const collectionConfig_0 = collections.find(({
slug: s
}) => s === slug);
const labelString = getTranslation(count === 1 ? collectionConfig_0.labels.singular : collectionConfig_0.labels.plural, i18n);
return /*#__PURE__*/_jsxs(React.Fragment, {
children: [/*#__PURE__*/_jsx(ListSelectionButton, {
"aria-label": t('general:restore'),
className: "restore-documents__toggle",
onClick: () => {
openModal(confirmManyRestoreDrawerSlug);
},
children: t('general:restore')
}), /*#__PURE__*/_jsx(ConfirmationModal, {
body: /*#__PURE__*/_jsxs(React.Fragment, {
children: [t(collectionConfig_0?.versions?.drafts ? 'general:aboutToRestoreAsDraftCount' : 'general:aboutToRestoreCount', {
count,
label: labelString
}), collectionConfig_0?.versions?.drafts && /*#__PURE__*/_jsx("div", {
className: `${baseClass}__checkbox`,
children: /*#__PURE__*/_jsx(CheckboxInput, {
checked: restoreAsPublished,
id: "restore-as-published-many",
label: t('general:restoreAsPublished'),
name: "restore-as-published-many",
onToggle: e_0 => setRestoreAsPublished(e_0.target.checked)
})
})]
}),
className: baseClass,
confirmingLabel: t('general:restoring'),
heading: t('general:confirmRestoration'),
modalSlug: confirmManyRestoreDrawerSlug,
onConfirm: handleRestore
})]
});
};
//# sourceMappingURL=index.js.map

View File

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

View File

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

View File

@@ -0,0 +1,54 @@
# on-exit-leak-free
This module helps dispose of an object gracefully when the Node.js process exits.
It executes a function with a given parameter
on [`'exit'`](https://nodejs.org/api/process.html#event-exit) without leaking memory,
cleaning things up appropriately if the object is garbage collected.
Requires `WeakRef` and `FinalizationRegistry`, i.e. use Node v14+.
## Install
```bash
npm i on-exit-leak-free
```
## Example
```js
'use strict'
const { register, unregister } = require('on-exit-leak-free')
const assert = require('assert')
function setup () {
// This object can be safely garbage collected,
// and the resulting shutdown function will not be called.
// There are no leaks.
const obj = { foo: 'bar' }
register(obj, shutdown)
// use registerBeforeExit(obj, shutdown) to execute the function only
// on beforeExit
// call unregister(obj) to remove
}
let shutdownCalled = false
// Please make sure that the function passed to register()
// does not create a closure around unnecessary objects.
function shutdown (obj, eventName) {
console.log(eventName) // beforeExit
shutdownCalled = true
assert.strictEqual(obj.foo, 'bar')
}
setup()
process.on('exit', function () {
assert.strictEqual(shutdownCalled, true)
})
```
## License
MIT

View File

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

View File

@@ -0,0 +1,18 @@
import { generateMetadata } from '../../utilities/meta.js';
export const generateBrowseByFolderMetadata = async args => {
const {
config,
i18n
} = args;
const title = i18n.t('folder:browseByFolder');
const description = '';
const keywords = '';
return generateMetadata({
...(config.admin.meta || {}),
description,
keywords,
serverURL: config.serverURL,
title
});
};
//# sourceMappingURL=metadata.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"to-json.js","sourceRoot":"","sources":["../src/to-json.ts"],"names":[],"mappings":";;;AAEA,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AACzD,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACjE,MAAM,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;AAElD;;;GAGG;AACH,SAAgB,MAAM;IACpB,4EAA4E;IAC5E,0DAA0D;IAC1D,IAAI,IAAI,GAAQ,EAAE,CAAC;IACnB,IAAI,KAAK,GAAG,IAAW,CAAC;IAExB,KAAK,IAAI,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE;QAClC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,IAAI,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;YACvB,IAAI,IAAI,GAAG,OAAO,KAAK,CAAC;YAExB,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBAChC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aACnB;SACF;KACF;IAED,OAAO,IAAqB,CAAC;AAC/B,CAAC;AAlBD,wBAkBC;AAGD;;;GAGG;AACH,SAAgB,WAAW,CAAC,GAAW,EAAE,OAA+B,EAAE;IACxE,IAAI,IAAI,GAA2B,EAAE,CAAC;IAEtC,oEAAoE;IACpE,OAAO,GAAG,IAAI,GAAG,KAAK,eAAe,EAAE;QACrC,IAAI,GAAG,IAAI,CAAC,MAAM,CAChB,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAC/B,MAAM,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAClC,CAAC;QACF,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAW,CAAC;KAC5C;IAED,gCAAgC;IAChC,IAAI,UAAU,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IAE/B,0BAA0B;IAC1B,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAC3C,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KACxB;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AArBD,kCAqBC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"aggregate.js","names":[],"sources":["../../../../src/rest/commands/read/aggregate.ts"],"sourcesContent":["import { type AllCollections } from '../../../index.js';\nimport type { AggregationOptions, AggregationOutput } from '../../../types/aggregate.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\nimport { isSystemCollection } from '../../utils/is-system-collection.js';\n\n/**\n * Aggregate allow you to perform calculations on a set of values, returning a single result.\n * @param collection The collection to aggregate\n * @param options The aggregation options\n * @returns Aggregated data\n * @throws Will throw if collection is empty\n */\nexport const aggregate =\n\t<Schema, Collection extends AllCollections<Schema>, Options extends AggregationOptions<Schema, Collection>>(\n\t\tcollection: Collection,\n\t\toptions: Options,\n\t): RestCommand<AggregationOutput<Schema, Collection, Options>, Schema> =>\n\t() => {\n\t\tconst collectionName = String(collection);\n\t\tthrowIfEmpty(collectionName, 'Collection cannot be empty');\n\n\t\tconst path = isSystemCollection(collectionName) ? `/${collectionName.substring(9)}` : `/items/${collectionName}`;\n\n\t\treturn {\n\t\t\tpath,\n\t\t\tmethod: 'GET',\n\t\t\tparams: {\n\t\t\t\t...(options.query ?? {}),\n\t\t\t\t...(options.groupBy ? { groupBy: options.groupBy } : {}),\n\t\t\t\taggregate: options.aggregate,\n\t\t\t},\n\t\t};\n\t};\n"],"mappings":"gKAaA,MAAa,GAEX,EACA,QAEK,CACL,IAAM,EAAiB,OAAO,EAAW,CAKzC,OAJA,EAAa,EAAgB,6BAA6B,CAInD,CACN,KAHY,EAAmB,EAAe,CAAG,IAAI,EAAe,UAAU,EAAE,GAAK,UAAU,IAI/F,OAAQ,MACR,OAAQ,CACP,GAAI,EAAQ,OAAS,EAAE,CACvB,GAAI,EAAQ,QAAU,CAAE,QAAS,EAAQ,QAAS,CAAG,EAAE,CACvD,UAAW,EAAQ,UACnB,CACD"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"star-half.js","sources":["../../../src/icons/star-half.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name StarHalf\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTcuOCA1LjggMjEgNyAxNC4xIDIgOS4zbDctMUwxMiAyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/star-half\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst StarHalf = createLucideIcon('StarHalf', [\n ['path', { d: 'M12 17.8 5.8 21 7 14.1 2 9.3l7-1L12 2', key: 'nare05' }],\n]);\n\nexport default StarHalf;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACxE,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"renderDocumentSlots.d.ts","sourceRoot":"","sources":["../../../src/views/Document/renderDocumentSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEb,MAAM,EACN,cAAc,EAGd,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EAGpB,cAAc,EAMf,MAAM,SAAS,CAAA;AAQhB,eAAO,MAAM,mBAAmB,EAAE,CAAC,IAAI,EAAE;IACvC,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,iBAAiB,EAAE,OAAO,CAAA;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,oBAAoB,CAAA;IACjC,GAAG,EAAE,cAAc,CAAA;CACpB,KAAK,aAiLL,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC;IACtD,cAAc,EAAE,MAAM,CAAA;IACtB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACrB,CAwBA,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"versions.js","names":[],"sources":["../../../../src/rest/commands/update/versions.ts"],"sourcesContent":["import type { DirectusVersion } from '../../../schema/version.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type UpdateContentVersionOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusVersion<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Update multiple existing Content Versions.\n * @param keys\n * @param item\n * @param query\n * @returns Returns the Content Version objects for the updated Content Versions.\n * @throws Will throw if keys is empty\n */\nexport const updateContentVersions =\n\t<Schema, const TQuery extends Query<Schema, DirectusVersion<Schema>>>(\n\t\tkeys: DirectusVersion<Schema>['id'][],\n\t\titem: NestedPartial<DirectusVersion<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateContentVersionOutput<Schema, TQuery>[], Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/versions`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify({ keys, data: item }),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n\n/**\n * Update multiple Content Versions as batch.\n * @param items\n * @param query\n * @returns Returns the Content Version objects for the updated Content Versions.\n */\nexport const updateContentVersionsBatch =\n\t<Schema, const TQuery extends Query<Schema, DirectusVersion<Schema>>>(\n\t\titems: NestedPartial<DirectusVersion<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateContentVersionOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/versions`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'PATCH',\n\t});\n\n/**\n * Update an existing Content Version.\n * @param key\n * @param item\n * @param query\n * @returns Returns the Content Version object for the updated Content Version.\n * @throws Will throw if key is empty\n */\nexport const updateContentVersion =\n\t<Schema, const TQuery extends Query<Schema, DirectusVersion<Schema>>>(\n\t\tkey: DirectusVersion<Schema>['id'],\n\t\titem: NestedPartial<DirectusVersion<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateContentVersionOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(key, 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/versions/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify(item),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n"],"mappings":"6DAmBA,MAAa,GAEX,EACA,EACA,SAGA,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,YACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,CAAE,OAAM,KAAM,EAAM,CAAC,CAC1C,OAAQ,QACR,EASU,GAEX,EACA,SAEM,CACN,KAAM,YACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,QACR,EAUW,GAEX,EACA,EACA,SAGA,EAAa,EAAK,sBAAsB,CAEjC,CACN,KAAM,aAAa,IACnB,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR"}

View File

@@ -0,0 +1,5 @@
/**
* Returns true if we are in the browser.
*/
export declare function isBrowser(): boolean;
//# sourceMappingURL=isBrowser.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"map-pin-off.js","sources":["../../../src/icons/map-pin-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MapPinOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuNzUgNy4wOWEzIDMgMCAwIDEgMi4xNiAyLjE2IiAvPgogIDxwYXRoIGQ9Ik0xNy4wNzIgMTcuMDcyYy0xLjYzNCAyLjE3LTMuNTI3IDMuOTEyLTQuNDcxIDQuNzI3YTEgMSAwIDAgMS0xLjIwMiAwQzkuNTM5IDIwLjE5MyA0IDE0Ljk5MyA0IDEwYTggOCAwIDAgMSAxLjQzMi00LjU2OCIgLz4KICA8cGF0aCBkPSJtMiAyIDIwIDIwIiAvPgogIDxwYXRoIGQ9Ik04LjQ3NSAyLjgxOEE4IDggMCAwIDEgMjAgMTBjMCAxLjE4My0uMzEgMi4zNzctLjgxIDMuNTMzIiAvPgogIDxwYXRoIGQ9Ik05LjEzIDkuMTNhMyAzIDAgMCAwIDMuNzQgMy43NCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/map-pin-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MapPinOff = createLucideIcon('MapPinOff', [\n ['path', { d: 'M12.75 7.09a3 3 0 0 1 2.16 2.16', key: '1d4wjd' }],\n [\n 'path',\n {\n d: 'M17.072 17.072c-1.634 2.17-3.527 3.912-4.471 4.727a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 1.432-4.568',\n key: '12yil7',\n },\n ],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M8.475 2.818A8 8 0 0 1 20 10c0 1.183-.31 2.377-.81 3.533', key: 'lhrkcz' }],\n ['path', { d: 'M9.13 9.13a3 3 0 0 0 3.74 3.74', key: '13wojd' }],\n]);\n\nexport default MapPinOff;\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,CAAmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAChE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjE,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,10 @@
import type { Locale } from 'use-intl/core';
import getServerExtractor from './getServerExtractor.js';
type Return = ReturnType<typeof getServerExtractor>;
declare function getExtractedImpl(namespace?: string): Promise<Return>;
declare function getExtractedImpl(opts?: {
locale: Locale;
namespace?: string;
}): Promise<Return>;
declare const getExtracted: typeof getExtractedImpl;
export default getExtracted;

View File

@@ -0,0 +1 @@
{"version":3,"file":"OSDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/OSDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU;IACd,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAAe;YAC7B,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzC,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE;SAC7B,CAAC;QACF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { ATTR_OS_TYPE, ATTR_OS_VERSION } from '../../../semconv';\nimport { platform, release } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport { DetectedResource, ResourceDetector } from '../../../types';\nimport { normalizeType } from './utils';\n\n/**\n * OSDetector detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: Attributes = {\n [ATTR_OS_TYPE]: normalizeType(platform()),\n [ATTR_OS_VERSION]: release(),\n };\n return { attributes };\n }\n}\n\nexport const osDetector = new OSDetector();\n"]}

View File

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

View File

@@ -0,0 +1,22 @@
/**
* @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 Grab = createLucideIcon("Grab", [
["path", { d: "M18 11.5V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1.4", key: "edstyy" }],
["path", { d: "M14 10V8a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2", key: "19wdwo" }],
["path", { d: "M10 9.9V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v5", key: "1lugqo" }],
["path", { d: "M6 14a2 2 0 0 0-2-2a2 2 0 0 0-2 2", key: "1hbeus" }],
[
"path",
{ d: "M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-4a8 8 0 0 1-8-8 2 2 0 1 1 4 0", key: "1etffm" }
]
]);
export { Grab as default };
//# sourceMappingURL=grab.js.map

View File

@@ -0,0 +1,217 @@
'use strict'
const defaults = require('./defaults')
const util = require('util')
const { isDate } = util.types || util // Node 8 doesn't have `util.types`
function escapeElement(elementRepresentation) {
const escaped = elementRepresentation.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
return '"' + escaped + '"'
}
// convert a JS array to a postgres array literal
// uses comma separator so won't work for types like box that use
// a different array separator.
function arrayString(val) {
let result = '{'
for (let i = 0; i < val.length; i++) {
if (i > 0) {
result = result + ','
}
if (val[i] === null || typeof val[i] === 'undefined') {
result = result + 'NULL'
} else if (Array.isArray(val[i])) {
result = result + arrayString(val[i])
} else if (ArrayBuffer.isView(val[i])) {
let item = val[i]
if (!(item instanceof Buffer)) {
const buf = Buffer.from(item.buffer, item.byteOffset, item.byteLength)
if (buf.length === item.byteLength) {
item = buf
} else {
item = buf.slice(item.byteOffset, item.byteOffset + item.byteLength)
}
}
result += '\\\\x' + item.toString('hex')
} else {
result += escapeElement(prepareValue(val[i]))
}
}
result = result + '}'
return result
}
// converts values from javascript types
// to their 'raw' counterparts for use as a postgres parameter
// note: you can override this function to provide your own conversion mechanism
// for complex types, etc...
const prepareValue = function (val, seen) {
// null and undefined are both null for postgres
if (val == null) {
return null
}
if (typeof val === 'object') {
if (val instanceof Buffer) {
return val
}
if (ArrayBuffer.isView(val)) {
const buf = Buffer.from(val.buffer, val.byteOffset, val.byteLength)
if (buf.length === val.byteLength) {
return buf
}
return buf.slice(val.byteOffset, val.byteOffset + val.byteLength) // Node.js v4 does not support those Buffer.from params
}
if (isDate(val)) {
if (defaults.parseInputDatesAsUTC) {
return dateToStringUTC(val)
} else {
return dateToString(val)
}
}
if (Array.isArray(val)) {
return arrayString(val)
}
return prepareObject(val, seen)
}
return val.toString()
}
function prepareObject(val, seen) {
if (val && typeof val.toPostgres === 'function') {
seen = seen || []
if (seen.indexOf(val) !== -1) {
throw new Error('circular reference detected while preparing "' + val + '" for query')
}
seen.push(val)
return prepareValue(val.toPostgres(prepareValue), seen)
}
return JSON.stringify(val)
}
function dateToString(date) {
let offset = -date.getTimezoneOffset()
let year = date.getFullYear()
const isBCYear = year < 1
if (isBCYear) year = Math.abs(year) + 1 // negative years are 1 off their BC representation
let ret =
String(year).padStart(4, '0') +
'-' +
String(date.getMonth() + 1).padStart(2, '0') +
'-' +
String(date.getDate()).padStart(2, '0') +
'T' +
String(date.getHours()).padStart(2, '0') +
':' +
String(date.getMinutes()).padStart(2, '0') +
':' +
String(date.getSeconds()).padStart(2, '0') +
'.' +
String(date.getMilliseconds()).padStart(3, '0')
if (offset < 0) {
ret += '-'
offset *= -1
} else {
ret += '+'
}
ret += String(Math.floor(offset / 60)).padStart(2, '0') + ':' + String(offset % 60).padStart(2, '0')
if (isBCYear) ret += ' BC'
return ret
}
function dateToStringUTC(date) {
let year = date.getUTCFullYear()
const isBCYear = year < 1
if (isBCYear) year = Math.abs(year) + 1 // negative years are 1 off their BC representation
let ret =
String(year).padStart(4, '0') +
'-' +
String(date.getUTCMonth() + 1).padStart(2, '0') +
'-' +
String(date.getUTCDate()).padStart(2, '0') +
'T' +
String(date.getUTCHours()).padStart(2, '0') +
':' +
String(date.getUTCMinutes()).padStart(2, '0') +
':' +
String(date.getUTCSeconds()).padStart(2, '0') +
'.' +
String(date.getUTCMilliseconds()).padStart(3, '0')
ret += '+00:00'
if (isBCYear) ret += ' BC'
return ret
}
function normalizeQueryConfig(config, values, callback) {
// can take in strings or config objects
config = typeof config === 'string' ? { text: config } : config
if (values) {
if (typeof values === 'function') {
config.callback = values
} else {
config.values = values
}
}
if (callback) {
config.callback = callback
}
return config
}
// Ported from PostgreSQL 9.2.4 source code in src/interfaces/libpq/fe-exec.c
const escapeIdentifier = function (str) {
return '"' + str.replace(/"/g, '""') + '"'
}
const escapeLiteral = function (str) {
let hasBackslash = false
let escaped = "'"
if (str == null) {
return "''"
}
if (typeof str !== 'string') {
return "''"
}
for (let i = 0; i < str.length; i++) {
const c = str[i]
if (c === "'") {
escaped += c + c
} else if (c === '\\') {
escaped += c + c
hasBackslash = true
} else {
escaped += c
}
}
escaped += "'"
if (hasBackslash === true) {
escaped = ' E' + escaped
}
return escaped
}
module.exports = {
prepareValue: function prepareValueWrapper(value) {
// this ensures that extra arguments do not get passed into prepareValue
// by accident, eg: from calling values.map(utils.prepareValue)
return prepareValue(value)
},
normalizeQueryConfig,
escapeIdentifier,
escapeLiteral,
}

View File

@@ -0,0 +1,90 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
require('./common');
var assert = require('assert');
var events = require('../');
var callbacks_called = [];
var e = new events.EventEmitter();
function callback1() {
callbacks_called.push('callback1');
e.on('foo', callback2);
e.on('foo', callback3);
e.removeListener('foo', callback1);
}
function callback2() {
callbacks_called.push('callback2');
e.removeListener('foo', callback2);
}
function callback3() {
callbacks_called.push('callback3');
e.removeListener('foo', callback3);
}
e.on('foo', callback1);
assert.strictEqual(e.listeners('foo').length, 1);
e.emit('foo');
assert.strictEqual(e.listeners('foo').length, 2);
assert.ok(Array.isArray(callbacks_called));
assert.strictEqual(callbacks_called.length, 1);
assert.strictEqual(callbacks_called[0], 'callback1');
e.emit('foo');
assert.strictEqual(e.listeners('foo').length, 0);
assert.ok(Array.isArray(callbacks_called));
assert.strictEqual(callbacks_called.length, 3);
assert.strictEqual(callbacks_called[0], 'callback1');
assert.strictEqual(callbacks_called[1], 'callback2');
assert.strictEqual(callbacks_called[2], 'callback3');
e.emit('foo');
assert.strictEqual(e.listeners('foo').length, 0);
assert.ok(Array.isArray(callbacks_called));
assert.strictEqual(callbacks_called.length, 3);
assert.strictEqual(callbacks_called[0], 'callback1');
assert.strictEqual(callbacks_called[1], 'callback2');
assert.strictEqual(callbacks_called[2], 'callback3');
e.on('foo', callback1);
e.on('foo', callback2);
assert.strictEqual(e.listeners('foo').length, 2);
e.removeAllListeners('foo');
assert.strictEqual(e.listeners('foo').length, 0);
// Verify that removing callbacks while in emit allows emits to propagate to
// all listeners
callbacks_called = [];
e.on('foo', callback2);
e.on('foo', callback3);
assert.strictEqual(2, e.listeners('foo').length);
e.emit('foo');
assert.ok(Array.isArray(callbacks_called));
assert.strictEqual(callbacks_called.length, 2);
assert.strictEqual(callbacks_called[0], 'callback2');
assert.strictEqual(callbacks_called[1], 'callback3');
assert.strictEqual(0, e.listeners('foo').length);

View File

@@ -0,0 +1,301 @@
// Type definitions for decimal.js >=7.0.0
// Project: https://github.com/MikeMcl/decimal.js
// Definitions by: Michael Mclaughlin <https://github.com/MikeMcl>
// Definitions: https://github.com/MikeMcl/decimal.js
//
// Documentation: http://mikemcl.github.io/decimal.js/
//
// Exports:
//
// class Decimal (default export)
// type Decimal.Constructor
// type Decimal.Instance
// type Decimal.Modulo
// type Decimal.Rounding
// type Decimal.Value
// interface Decimal.Config
//
// Example (alternative syntax commented-out):
//
// import {Decimal} from "decimal.js"
// //import Decimal from "decimal.js"
//
// let r: Decimal.Rounding = Decimal.ROUND_UP;
// let c: Decimal.Configuration = {precision: 4, rounding: r};
// Decimal.set(c);
// let v: Decimal.Value = '12345.6789';
// let d: Decimal = new Decimal(v);
// //let d: Decimal.Instance = new Decimal(v);
//
// The use of compiler option `--strictNullChecks` is recommended.
export default Decimal;
export namespace Decimal {
export type Constructor = typeof Decimal;
export type Instance = Decimal;
export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
export type Modulo = Rounding | 9;
export type Value = string | number | bigint | Decimal;
// http://mikemcl.github.io/decimal.js/#constructor-properties
export interface Config {
precision?: number;
rounding?: Rounding;
toExpNeg?: number;
toExpPos?: number;
minE?: number;
maxE?: number;
crypto?: boolean;
modulo?: Modulo;
defaults?: boolean;
}
}
export declare class Decimal {
readonly d: number[];
readonly e: number;
readonly s: number;
constructor(n: Decimal.Value);
absoluteValue(): Decimal;
abs(): Decimal;
ceil(): Decimal;
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
comparedTo(n: Decimal.Value): number;
cmp(n: Decimal.Value): number;
cosine(): Decimal;
cos(): Decimal;
cubeRoot(): Decimal;
cbrt(): Decimal;
decimalPlaces(): number;
dp(): number;
dividedBy(n: Decimal.Value): Decimal;
div(n: Decimal.Value): Decimal;
dividedToIntegerBy(n: Decimal.Value): Decimal;
divToInt(n: Decimal.Value): Decimal;
equals(n: Decimal.Value): boolean;
eq(n: Decimal.Value): boolean;
floor(): Decimal;
greaterThan(n: Decimal.Value): boolean;
gt(n: Decimal.Value): boolean;
greaterThanOrEqualTo(n: Decimal.Value): boolean;
gte(n: Decimal.Value): boolean;
hyperbolicCosine(): Decimal;
cosh(): Decimal;
hyperbolicSine(): Decimal;
sinh(): Decimal;
hyperbolicTangent(): Decimal;
tanh(): Decimal;
inverseCosine(): Decimal;
acos(): Decimal;
inverseHyperbolicCosine(): Decimal;
acosh(): Decimal;
inverseHyperbolicSine(): Decimal;
asinh(): Decimal;
inverseHyperbolicTangent(): Decimal;
atanh(): Decimal;
inverseSine(): Decimal;
asin(): Decimal;
inverseTangent(): Decimal;
atan(): Decimal;
isFinite(): boolean;
isInteger(): boolean;
isInt(): boolean;
isNaN(): boolean;
isNegative(): boolean;
isNeg(): boolean;
isPositive(): boolean;
isPos(): boolean;
isZero(): boolean;
lessThan(n: Decimal.Value): boolean;
lt(n: Decimal.Value): boolean;
lessThanOrEqualTo(n: Decimal.Value): boolean;
lte(n: Decimal.Value): boolean;
logarithm(n?: Decimal.Value): Decimal;
log(n?: Decimal.Value): Decimal;
minus(n: Decimal.Value): Decimal;
sub(n: Decimal.Value): Decimal;
modulo(n: Decimal.Value): Decimal;
mod(n: Decimal.Value): Decimal;
naturalExponential(): Decimal;
exp(): Decimal;
naturalLogarithm(): Decimal;
ln(): Decimal;
negated(): Decimal;
neg(): Decimal;
plus(n: Decimal.Value): Decimal;
add(n: Decimal.Value): Decimal;
precision(includeZeros?: boolean): number;
sd(includeZeros?: boolean): number;
round(): Decimal;
sine() : Decimal;
sin() : Decimal;
squareRoot(): Decimal;
sqrt(): Decimal;
tangent() : Decimal;
tan() : Decimal;
times(n: Decimal.Value): Decimal;
mul(n: Decimal.Value) : Decimal;
toBinary(significantDigits?: number): string;
toBinary(significantDigits: number, rounding: Decimal.Rounding): string;
toDecimalPlaces(decimalPlaces?: number): Decimal;
toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
toDP(decimalPlaces?: number): Decimal;
toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
toExponential(decimalPlaces?: number): string;
toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string;
toFixed(decimalPlaces?: number): string;
toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string;
toFraction(max_denominator?: Decimal.Value): Decimal[];
toHexadecimal(significantDigits?: number): string;
toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string;
toHex(significantDigits?: number): string;
toHex(significantDigits: number, rounding?: Decimal.Rounding): string;
toJSON(): string;
toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal;
toNumber(): number;
toOctal(significantDigits?: number): string;
toOctal(significantDigits: number, rounding: Decimal.Rounding): string;
toPower(n: Decimal.Value): Decimal;
pow(n: Decimal.Value): Decimal;
toPrecision(significantDigits?: number): string;
toPrecision(significantDigits: number, rounding: Decimal.Rounding): string;
toSignificantDigits(significantDigits?: number): Decimal;
toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal;
toSD(significantDigits?: number): Decimal;
toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal;
toString(): string;
truncated(): Decimal;
trunc(): Decimal;
valueOf(): string;
static abs(n: Decimal.Value): Decimal;
static acos(n: Decimal.Value): Decimal;
static acosh(n: Decimal.Value): Decimal;
static add(x: Decimal.Value, y: Decimal.Value): Decimal;
static asin(n: Decimal.Value): Decimal;
static asinh(n: Decimal.Value): Decimal;
static atan(n: Decimal.Value): Decimal;
static atanh(n: Decimal.Value): Decimal;
static atan2(y: Decimal.Value, x: Decimal.Value): Decimal;
static cbrt(n: Decimal.Value): Decimal;
static ceil(n: Decimal.Value): Decimal;
static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal;
static clone(object?: Decimal.Config): Decimal.Constructor;
static config(object: Decimal.Config): Decimal.Constructor;
static cos(n: Decimal.Value): Decimal;
static cosh(n: Decimal.Value): Decimal;
static div(x: Decimal.Value, y: Decimal.Value): Decimal;
static exp(n: Decimal.Value): Decimal;
static floor(n: Decimal.Value): Decimal;
static hypot(...n: Decimal.Value[]): Decimal;
static isDecimal(object: any): object is Decimal;
static ln(n: Decimal.Value): Decimal;
static log(n: Decimal.Value, base?: Decimal.Value): Decimal;
static log2(n: Decimal.Value): Decimal;
static log10(n: Decimal.Value): Decimal;
static max(...n: Decimal.Value[]): Decimal;
static min(...n: Decimal.Value[]): Decimal;
static mod(x: Decimal.Value, y: Decimal.Value): Decimal;
static mul(x: Decimal.Value, y: Decimal.Value): Decimal;
static noConflict(): Decimal.Constructor; // Browser only
static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal;
static random(significantDigits?: number): Decimal;
static round(n: Decimal.Value): Decimal;
static set(object: Decimal.Config): Decimal.Constructor;
static sign(n: Decimal.Value): number;
static sin(n: Decimal.Value): Decimal;
static sinh(n: Decimal.Value): Decimal;
static sqrt(n: Decimal.Value): Decimal;
static sub(x: Decimal.Value, y: Decimal.Value): Decimal;
static sum(...n: Decimal.Value[]): Decimal;
static tan(n: Decimal.Value): Decimal;
static tanh(n: Decimal.Value): Decimal;
static trunc(n: Decimal.Value): Decimal;
static readonly default?: Decimal.Constructor;
static readonly Decimal?: Decimal.Constructor;
static readonly precision: number;
static readonly rounding: Decimal.Rounding;
static readonly toExpNeg: number;
static readonly toExpPos: number;
static readonly minE: number;
static readonly maxE: number;
static readonly crypto: boolean;
static readonly modulo: Decimal.Modulo;
static readonly ROUND_UP: 0;
static readonly ROUND_DOWN: 1;
static readonly ROUND_CEIL: 2;
static readonly ROUND_FLOOR: 3;
static readonly ROUND_HALF_UP: 4;
static readonly ROUND_HALF_DOWN: 5;
static readonly ROUND_HALF_EVEN: 6;
static readonly ROUND_HALF_CEIL: 7;
static readonly ROUND_HALF_FLOOR: 8;
static readonly EUCLID: 9;
}
export declare function Decimal(n: Decimal.Value): Decimal;

View File

@@ -0,0 +1,104 @@
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
import { ForwardRef, Memo, isMemo } from 'react-is';
const REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
const KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
const FORWARD_REF_STATICS = {
'$$typeof': true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
const MEMO_STATICS = {
'$$typeof': true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true,
}
const TYPE_STATICS = {};
TYPE_STATICS[ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[Memo] = MEMO_STATICS;
function getStatics(component) {
// React v16.11 and below
if (isMemo(component)) {
return MEMO_STATICS;
}
// React v16.12 and above
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}
const defineProperty = Object.defineProperty;
const getOwnPropertyNames = Object.getOwnPropertyNames;
const getOwnPropertySymbols = Object.getOwnPropertySymbols;
const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
const getPrototypeOf = Object.getPrototypeOf;
const objectPrototype = Object.prototype;
export default function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
if (objectPrototype) {
const inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
let keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
const targetStatics = getStatics(targetComponent);
const sourceStatics = getStatics(sourceComponent);
for (let i = 0; i < keys.length; ++i) {
const key = keys[i];
if (!KNOWN_STATICS[key] &&
!(blacklist && blacklist[key]) &&
!(sourceStatics && sourceStatics[key]) &&
!(targetStatics && targetStatics[key])
) {
const descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try { // Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
}
return targetComponent;
};

View File

@@ -0,0 +1,180 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { OriginalSource, RawSource } = require("webpack-sources");
const Module = require("./Module");
const {
JAVASCRIPT_TYPE,
JAVASCRIPT_TYPES
} = require("./ModuleSourceTypeConstants");
const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = require("./ModuleTypeConstants");
const makeSerializable = require("./util/makeSerializable");
/** @typedef {import("./config/defaults").WebpackOptionsNormalizedWithDefaults} WebpackOptions */
/** @typedef {import("./Compilation")} Compilation */
/** @typedef {import("./Dependency").UpdateHashContext} UpdateHashContext */
/** @typedef {import("./Generator").SourceTypes} SourceTypes */
/** @typedef {import("./Module").BuildCallback} BuildCallback */
/** @typedef {import("./Module").CodeGenerationContext} CodeGenerationContext */
/** @typedef {import("./Module").CodeGenerationResult} CodeGenerationResult */
/** @typedef {import("./Module").NeedBuildCallback} NeedBuildCallback */
/** @typedef {import("./Module").NeedBuildContext} NeedBuildContext */
/** @typedef {import("./Module").ReadOnlyRuntimeRequirements} ReadOnlyRuntimeRequirements */
/** @typedef {import("./Module").Sources} Sources */
/** @typedef {import("./ModuleGraph")} ModuleGraph */
/** @typedef {import("./ModuleGraphConnection").ConnectionState} ConnectionState */
/** @typedef {import("./RequestShortener")} RequestShortener */
/** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */
/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {import("./util/Hash")} Hash */
/** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */
class RawModule extends Module {
/**
* @param {string} source source code
* @param {string} identifier unique identifier
* @param {string=} readableIdentifier readable identifier
* @param {ReadOnlyRuntimeRequirements=} runtimeRequirements runtime requirements needed for the source code
*/
constructor(source, identifier, readableIdentifier, runtimeRequirements) {
super(JAVASCRIPT_MODULE_TYPE_DYNAMIC, null);
this.sourceStr = source;
this.identifierStr = identifier || this.sourceStr;
this.readableIdentifierStr = readableIdentifier || this.identifierStr;
this.runtimeRequirements = runtimeRequirements || null;
}
/**
* @returns {SourceTypes} types available (do not mutate)
*/
getSourceTypes() {
return JAVASCRIPT_TYPES;
}
/**
* @returns {string} a unique identifier of the module
*/
identifier() {
return this.identifierStr;
}
/**
* @param {string=} type the source type for which the size should be estimated
* @returns {number} the estimated size of the module (must be non-zero)
*/
size(type) {
return Math.max(1, this.sourceStr.length);
}
/**
* @param {RequestShortener} requestShortener the request shortener
* @returns {string} a user readable identifier of the module
*/
readableIdentifier(requestShortener) {
return /** @type {string} */ (
requestShortener.shorten(this.readableIdentifierStr)
);
}
/**
* @param {NeedBuildContext} context context info
* @param {NeedBuildCallback} callback callback function, returns true, if the module needs a rebuild
* @returns {void}
*/
needBuild(context, callback) {
return callback(null, !this.buildMeta);
}
/**
* @param {WebpackOptions} options webpack options
* @param {Compilation} compilation the compilation
* @param {ResolverWithOptions} resolver the resolver
* @param {InputFileSystem} fs the file system
* @param {BuildCallback} callback callback function
* @returns {void}
*/
build(options, compilation, resolver, fs, callback) {
this.buildMeta = {};
this.buildInfo = {
cacheable: true
};
callback();
}
/**
* @param {ModuleGraph} moduleGraph the module graph
* @returns {ConnectionState} how this module should be connected to referencing modules when consumed for side-effects only
*/
getSideEffectsConnectionState(moduleGraph) {
if (this.factoryMeta !== undefined) {
if (this.factoryMeta.sideEffectFree) return false;
if (this.factoryMeta.sideEffectFree === false) return true;
}
return true;
}
/**
* @param {CodeGenerationContext} context context for code generation
* @returns {CodeGenerationResult} result
*/
codeGeneration(context) {
/** @type {Sources} */
const sources = new Map();
if (this.useSourceMap || this.useSimpleSourceMap) {
sources.set(
JAVASCRIPT_TYPE,
new OriginalSource(this.sourceStr, this.identifier())
);
} else {
sources.set(JAVASCRIPT_TYPE, new RawSource(this.sourceStr));
}
return { sources, runtimeRequirements: this.runtimeRequirements };
}
/**
* @param {Hash} hash the hash used to track dependencies
* @param {UpdateHashContext} context context
* @returns {void}
*/
updateHash(hash, context) {
hash.update(this.sourceStr);
super.updateHash(hash, context);
}
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
const { write } = context;
write(this.sourceStr);
write(this.identifierStr);
write(this.readableIdentifierStr);
write(this.runtimeRequirements);
super.serialize(context);
}
/**
* @param {ObjectDeserializerContext} context context
*/
deserialize(context) {
const { read } = context;
this.sourceStr = read();
this.identifierStr = read();
this.readableIdentifierStr = read();
this.runtimeRequirements = read();
super.deserialize(context);
}
}
makeSerializable(RawModule, "webpack/lib/RawModule");
module.exports = RawModule;

View File

@@ -0,0 +1,2 @@
const e=(e=`item`)=>()=>({method:`GET`,path:e===`item`?`/server/specs/graphql`:`/server/specs/graphql/system`});export{e as readGraphqlSdl};
//# sourceMappingURL=graphql.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/logger.ts"],"sourcesContent":["import { type Logger, pino } from 'pino'\nimport { build, type PinoPretty, type PrettyOptions } from 'pino-pretty'\n\nimport type { Config } from '../config/types.js'\n\n/**\n * Payload internal logger. Uses Pino.\n * This allows you to bring your own logger instance and let payload use it\n */\nexport type PayloadLogger = Logger\n\nconst prettyOptions: PrettyOptions = {\n colorize: true,\n ignore: 'pid,hostname',\n translateTime: 'SYS:HH:MM:ss',\n}\n\nexport const prettySyncLoggerDestination: PinoPretty.PrettyStream = build({\n ...prettyOptions,\n destination: 1, // stdout\n sync: true,\n})\n\nexport const defaultLoggerOptions: PinoPretty.PrettyStream = build(prettyOptions)\n\nexport const getLogger = (name = 'payload', logger?: Config['logger']): PayloadLogger => {\n if (!logger) {\n return pino(defaultLoggerOptions)\n }\n\n // Synchronous logger used by bin scripts\n if (logger === 'sync') {\n return pino(prettySyncLoggerDestination)\n }\n\n // Check if logger is an object\n if ('options' in logger) {\n const { destination, options } = logger\n\n if (!options.name) {\n options.name = name\n }\n\n if (!options.enabled) {\n options.enabled = process.env.DISABLE_LOGGING !== 'true'\n }\n\n return pino(options, destination)\n } else {\n // Instantiated logger\n return logger\n }\n}\n"],"names":["pino","build","prettyOptions","colorize","ignore","translateTime","prettySyncLoggerDestination","destination","sync","defaultLoggerOptions","getLogger","name","logger","options","enabled","process","env","DISABLE_LOGGING"],"mappings":"AAAA,SAAsBA,IAAI,QAAQ,OAAM;AACxC,SAASC,KAAK,QAA6C,cAAa;AAUxE,MAAMC,gBAA+B;IACnCC,UAAU;IACVC,QAAQ;IACRC,eAAe;AACjB;AAEA,OAAO,MAAMC,8BAAuDL,MAAM;IACxE,GAAGC,aAAa;IAChBK,aAAa;IACbC,MAAM;AACR,GAAE;AAEF,OAAO,MAAMC,uBAAgDR,MAAMC,eAAc;AAEjF,OAAO,MAAMQ,YAAY,CAACC,OAAO,SAAS,EAAEC;IAC1C,IAAI,CAACA,QAAQ;QACX,OAAOZ,KAAKS;IACd;IAEA,yCAAyC;IACzC,IAAIG,WAAW,QAAQ;QACrB,OAAOZ,KAAKM;IACd;IAEA,+BAA+B;IAC/B,IAAI,aAAaM,QAAQ;QACvB,MAAM,EAAEL,WAAW,EAAEM,OAAO,EAAE,GAAGD;QAEjC,IAAI,CAACC,QAAQF,IAAI,EAAE;YACjBE,QAAQF,IAAI,GAAGA;QACjB;QAEA,IAAI,CAACE,QAAQC,OAAO,EAAE;YACpBD,QAAQC,OAAO,GAAGC,QAAQC,GAAG,CAACC,eAAe,KAAK;QACpD;QAEA,OAAOjB,KAAKa,SAASN;IACvB,OAAO;QACL,sBAAsB;QACtB,OAAOK;IACT;AACF,EAAC"}

View File

@@ -0,0 +1,161 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const api = require('@opentelemetry/api');
const core$1 = require('@opentelemetry/core');
const instrumentation = require('@opentelemetry/instrumentation');
const core = require('@sentry/core');
const diagch = require('diagnostics_channel');
const nodeVersion = require('../../nodeVersion.js');
const outgoingFetchRequest = require('../../utils/outgoingFetchRequest.js');
/**
* This custom node-fetch instrumentation is used to instrument outgoing fetch requests.
* It does not emit any spans.
*
* The reason this is isolated from the OpenTelemetry instrumentation is that users may overwrite this,
* which would lead to Sentry not working as expected.
*
* This is heavily inspired & adapted from:
* https://github.com/open-telemetry/opentelemetry-js-contrib/blob/28e209a9da36bc4e1f8c2b0db7360170ed46cb80/plugins/node/instrumentation-undici/src/undici.ts
*/
class SentryNodeFetchInstrumentation extends instrumentation.InstrumentationBase {
// Keep ref to avoid https://github.com/nodejs/node/issues/42170 bug and for
// unsubscribing.
constructor(config = {}) {
super('@sentry/instrumentation-node-fetch', core.SDK_VERSION, config);
this._channelSubs = [];
this._propagationDecisionMap = new core.LRUMap(100);
this._ignoreOutgoingRequestsMap = new WeakMap();
}
/** No need to instrument files/modules. */
init() {
return undefined;
}
/** Disable the instrumentation. */
disable() {
super.disable();
this._channelSubs.forEach(sub => sub.unsubscribe());
this._channelSubs = [];
}
/** Enable the instrumentation. */
enable() {
// "enabled" handling is currently a bit messy with InstrumentationBase.
// If constructed with `{enabled: false}`, this `.enable()` is still called,
// and `this.getConfig().enabled !== this.isEnabled()`, creating confusion.
//
// For now, this class will setup for instrumenting if `.enable()` is
// called, but use `this.getConfig().enabled` to determine if
// instrumentation should be generated. This covers the more likely common
// case of config being given a construction time, rather than later via
// `instance.enable()`, `.disable()`, or `.setConfig()` calls.
super.enable();
// This method is called by the super-class constructor before ours is
// called. So we need to ensure the property is initalized.
this._channelSubs = this._channelSubs || [];
// Avoid to duplicate subscriptions
if (this._channelSubs.length > 0) {
return;
}
this._subscribeToChannel('undici:request:create', this._onRequestCreated.bind(this));
this._subscribeToChannel('undici:request:headers', this._onResponseHeaders.bind(this));
}
/**
* This method is called when a request is created.
* You can still mutate the request here before it is sent.
*/
_onRequestCreated({ request }) {
const config = this.getConfig();
const enabled = config.enabled !== false;
if (!enabled) {
return;
}
const shouldIgnore = this._shouldIgnoreOutgoingRequest(request);
// We store this decisision for later so we do not need to re-evaluate it
// Additionally, the active context is not correct in _onResponseHeaders, so we need to make sure it is evaluated here
this._ignoreOutgoingRequestsMap.set(request, shouldIgnore);
if (shouldIgnore) {
return;
}
outgoingFetchRequest.addTracePropagationHeadersToFetchRequest(request, this._propagationDecisionMap);
}
/**
* This method is called when a response is received.
*/
_onResponseHeaders({ request, response }) {
const config = this.getConfig();
const enabled = config.enabled !== false;
if (!enabled) {
return;
}
const _breadcrumbs = config.breadcrumbs;
const breadCrumbsEnabled = typeof _breadcrumbs === 'undefined' ? true : _breadcrumbs;
const shouldIgnore = this._ignoreOutgoingRequestsMap.get(request);
if (breadCrumbsEnabled && !shouldIgnore) {
outgoingFetchRequest.addFetchRequestBreadcrumb(request, response);
}
}
/** Subscribe to a diagnostics channel. */
_subscribeToChannel(
diagnosticChannel,
onMessage,
) {
// `diagnostics_channel` had a ref counting bug until v18.19.0.
// https://github.com/nodejs/node/pull/47520
const useNewSubscribe = nodeVersion.NODE_MAJOR > 18 || (nodeVersion.NODE_MAJOR === 18 && nodeVersion.NODE_MINOR >= 19);
let unsubscribe;
if (useNewSubscribe) {
diagch.subscribe?.(diagnosticChannel, onMessage);
unsubscribe = () => diagch.unsubscribe?.(diagnosticChannel, onMessage);
} else {
const channel = diagch.channel(diagnosticChannel);
channel.subscribe(onMessage);
unsubscribe = () => channel.unsubscribe(onMessage);
}
this._channelSubs.push({
name: diagnosticChannel,
unsubscribe,
});
}
/**
* Check if the given outgoing request should be ignored.
*/
_shouldIgnoreOutgoingRequest(request) {
if (core$1.isTracingSuppressed(api.context.active())) {
return true;
}
// Add trace propagation headers
const url = outgoingFetchRequest.getAbsoluteUrl(request.origin, request.path);
const ignoreOutgoingRequests = this.getConfig().ignoreOutgoingRequests;
if (typeof ignoreOutgoingRequests !== 'function' || !url) {
return false;
}
return ignoreOutgoingRequests(url);
}
}
exports.SentryNodeFetchInstrumentation = SentryNodeFetchInstrumentation;
//# sourceMappingURL=SentryNodeFetchInstrumentation.js.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 VibrateOff = createLucideIcon("VibrateOff", [
["path", { d: "m2 8 2 2-2 2 2 2-2 2", key: "sv1b1" }],
["path", { d: "m22 8-2 2 2 2-2 2 2 2", key: "101i4y" }],
["path", { d: "M8 8v10c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2", key: "1hbad5" }],
["path", { d: "M16 10.34V6c0-.55-.45-1-1-1h-4.34", key: "1x5tf0" }],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { VibrateOff as default };
//# sourceMappingURL=vibrate-off.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sanitizeResizeConfig.d.ts","sourceRoot":"","sources":["../../../src/uploads/image-resizing/sanitizeResizeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,iBAAkB,SAAS,KAAG,SAU9D,CAAA"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"versions.js","names":[],"sources":["../../../../src/rest/commands/utils/versions.ts"],"sourcesContent":["import type { DirectusVersion } from '../../../schema/version.js';\nimport type { NestedPartial, UnpackList } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Save item changes to an existing Content Version.\n *\n * @param id Primary key of the Content Version.\n * @param item The item changes to save to the specified Content Version.\n *\n * @returns State of the item after save.\n */\nexport const saveToContentVersion =\n\t<Schema, Collection extends keyof Schema, Item = UnpackList<Schema[Collection]>>(\n\t\tid: DirectusVersion<Schema>['id'],\n\t\titem: NestedPartial<Item>,\n\t): RestCommand<Item, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(id, 'ID cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/versions/${id}/save`,\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify(item),\n\t\t};\n\t};\n\n/**\n * Compare an existing Content Version with the main version of the item.\n *\n * @param id Primary key of the Content Version.\n *\n * @returns All fields with different values, along with the hash of the main version of the item and the information\nwhether the Content Version is outdated (i.e. main version of the item has been updated since the creation of the\nContent Version)\n */\nexport const compareContentVersion =\n\t<Schema, Collection extends keyof Schema, Item = UnpackList<Schema[Collection]>>(\n\t\tid: DirectusVersion<Schema>['id'],\n\t): RestCommand<\n\t\t{\n\t\t\toutdated: boolean;\n\t\t\tmainHash: string;\n\t\t\tcurrent: Partial<Item>;\n\t\t\tmain: Item;\n\t\t},\n\t\tSchema\n\t> =>\n\t() => {\n\t\tthrowIfEmpty(id, 'ID cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/versions/${id}/compare`,\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n\n/**\n * Promote an existing Content Version to become the new main version of the item.\n *\n * @param id Primary key of the version.\n * @param mainHash The current hash of the main version of the item (obtained from the `compare` endpoint).\n * @param fields Optional array of field names of which the values are to be promoted. By default, all fields are selected.\n *\n * @returns The primary key of the promoted item.\n */\nexport const promoteContentVersion =\n\t<Schema, Collection extends keyof Schema, Item = UnpackList<Schema[Collection]>>(\n\t\tid: DirectusVersion<Schema>['id'],\n\t\tmainHash: string,\n\t\tfields?: (keyof UnpackList<Item>)[],\n\t): RestCommand<string | number, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(id, 'ID cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/versions/${id}/promote`,\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify(fields ? { mainHash, fields } : { mainHash }),\n\t\t};\n\t};\n"],"mappings":"6DAaA,MAAa,GAEX,EACA,SAGA,EAAa,EAAI,qBAAqB,CAE/B,CACN,KAAM,aAAa,EAAG,OACtB,OAAQ,OACR,KAAM,KAAK,UAAU,EAAK,CAC1B,EAYU,EAEX,QAWA,EAAa,EAAI,qBAAqB,CAE/B,CACN,KAAM,aAAa,EAAG,UACtB,OAAQ,MACR,EAYU,GAEX,EACA,EACA,SAGA,EAAa,EAAI,qBAAqB,CAE/B,CACN,KAAM,aAAa,EAAG,UACtB,OAAQ,OACR,KAAM,KAAK,UAAU,EAAS,CAAE,WAAU,SAAQ,CAAG,CAAE,WAAU,CAAC,CAClE"}

View File

@@ -0,0 +1,2 @@
import { capitalize } from "./index";
export = capitalize;

View File

@@ -0,0 +1,5 @@
'use strict'
const SemVer = require('../classes/semver')
const patch = (a, loose) => new SemVer(a, loose).patch
module.exports = patch

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","ListSelection","baseClass","GroupByHeader","collectionConfig","groupByFieldPath","groupByValue","heading","_jsxs","className","_jsx","label","modalPrefix","where","equals"],"sources":["../../../../src/views/List/GroupByHeader/index.tsx"],"sourcesContent":["import type { ClientCollectionConfig } from 'payload'\n\nimport React from 'react'\n\nimport { ListSelection } from '../ListSelection/index.js'\nimport './index.scss'\n\nconst baseClass = 'group-by-header'\n\nexport const GroupByHeader: React.FC<{\n collectionConfig?: ClientCollectionConfig\n groupByFieldPath: string\n groupByValue: string\n heading: string\n}> = ({ collectionConfig, groupByFieldPath, groupByValue, heading }) => {\n return (\n <header className={baseClass}>\n <h4 className={`${baseClass}__heading`} data-group-id={groupByValue}>\n {heading}\n </h4>\n <ListSelection\n collectionConfig={collectionConfig}\n label={heading}\n modalPrefix={groupByValue}\n where={{\n [groupByFieldPath]: {\n equals: groupByValue,\n },\n }}\n />\n </header>\n )\n}\n"],"mappings":";AAEA,OAAOA,KAAA,MAAW;AAElB,SAASC,aAAa,QAAQ;AAC9B,OAAO;AAEP,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,aAAA,GAKRA,CAAC;EAAEC,gBAAgB;EAAEC,gBAAgB;EAAEC,YAAY;EAAEC;AAAO,CAAE;EACjE,oBACEC,KAAA,CAAC;IAAOC,SAAA,EAAWP,SAAA;4BACjBQ,IAAA,CAAC;MAAGD,SAAA,EAAW,GAAGP,SAAA,WAAoB;MAAE,iBAAeI,YAAA;gBACpDC;qBAEHG,IAAA,CAACT,aAAA;MACCG,gBAAA,EAAkBA,gBAAA;MAClBO,KAAA,EAAOJ,OAAA;MACPK,WAAA,EAAaN,YAAA;MACbO,KAAA,EAAO;QACL,CAACR,gBAAA,GAAmB;UAClBS,MAAA,EAAQR;QACV;MACF;;;AAIR","ignoreList":[]}

View File

@@ -0,0 +1,4 @@
import type { SaveDraftButtonClientProps } from 'payload';
import React from 'react';
export declare function SaveDraftButton(props: SaveDraftButtonClientProps): React.JSX.Element;
//# sourceMappingURL=index.d.ts.map

View File

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

View File

@@ -0,0 +1,6 @@
import React from 'react';
import './index.scss';
export declare const DefaultAccountIcon: React.FC<{
active: boolean;
}>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,33 @@
"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 view_base_exports = {};
__export(view_base_exports, {
SQLiteViewBase: () => SQLiteViewBase
});
module.exports = __toCommonJS(view_base_exports);
var import_entity = require("../entity.cjs");
var import_sql = require("../sql/sql.cjs");
class SQLiteViewBase extends import_sql.View {
static [import_entity.entityKind] = "SQLiteViewBase";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SQLiteViewBase
});
//# sourceMappingURL=view-base.cjs.map

View File

@@ -0,0 +1,8 @@
import type { Job } from '../../index.js';
import type { JobTaskStatus } from '../config/types/workflowTypes.js';
type Args = {
jobLog: Job['log'];
};
export declare const getJobTaskStatus: ({ jobLog }: Args) => JobTaskStatus;
export {};
//# sourceMappingURL=getJobTaskStatus.d.ts.map

View File

@@ -0,0 +1,22 @@
/**
* @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 Camera = createLucideIcon("Camera", [
[
"path",
{
d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",
key: "1tc9qg"
}
],
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
]);
export { Camera as default };
//# sourceMappingURL=camera.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"build-source-map-tree.d.ts","sourceRoot":"","sources":["../src/build-source-map-tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,SAAS,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAO9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,GACtB,aAAa,CAkBf"}

View File

@@ -0,0 +1,18 @@
'use strict'
const SemVer = require('../classes/semver')
const parse = (version, options, throwErrors = false) => {
if (version instanceof SemVer) {
return version
}
try {
return new SemVer(version, options)
} catch (er) {
if (!throwErrors) {
return null
}
throw er
}
}
module.exports = parse

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleRecordingEmit.d.ts","sourceRoot":"","sources":["../../../../src/util/handleRecordingEmit.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIxF,KAAK,qBAAqB,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAEnF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,qBAAqB,CAiGrF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,sBAAsB,CAuBlF"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"comments.cjs","names":["payload: Record<string, any>"],"sources":["../../../../src/rest/commands/delete/comments.ts"],"sourcesContent":["import type { DirectusComment } from '../../../schema/comment.js';\nimport type { Query } from '../../../types/query.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing comments.\n * @param keysOrQuery The primary keys or a query\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deleteComments =\n\t<Schema>(\n\t\tkeysOrQuery: DirectusComment<Schema>['id'][] | Query<Schema, DirectusComment<Schema>>,\n\t): RestCommand<void, Schema> =>\n\t() => {\n\t\tlet payload: Record<string, any> = {};\n\n\t\tif (Array.isArray(keysOrQuery)) {\n\t\t\tthrowIfEmpty(keysOrQuery, 'keysOrQuery cannot be empty');\n\t\t\tpayload = { keys: keysOrQuery };\n\t\t} else {\n\t\t\tthrowIfEmpty(Object.keys(keysOrQuery), 'keysOrQuery cannot be empty');\n\t\t\tpayload = { query: keysOrQuery };\n\t\t}\n\n\t\treturn {\n\t\t\tpath: `/comments`,\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing comment.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deleteComment =\n\t<Schema>(key: DirectusComment<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/comments/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAWa,EAEX,OAEK,CACL,IAAIA,EAA+B,EAAE,CAUrC,OARI,MAAM,QAAQ,EAAY,EAC7B,EAAA,aAAa,EAAa,8BAA8B,CACxD,EAAU,CAAE,KAAM,EAAa,GAE/B,EAAA,aAAa,OAAO,KAAK,EAAY,CAAE,8BAA8B,CACrE,EAAU,CAAE,MAAO,EAAa,EAG1B,CACN,KAAM,YACN,KAAM,KAAK,UAAU,EAAQ,CAC7B,OAAQ,SACR,EASU,EACH,QAER,EAAA,aAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,aAAa,IACnB,OAAQ,SACR"}

View File

@@ -0,0 +1,12 @@
import type { Validate } from '../fields/config/types.js';
/**
* Prevents "accidental lockouts" where a user makes an update that removes their own access to the preset.
* This is effectively an access control function proxied through a `validate` function.
* How it works:
* 1. Creates a temporary record with the incoming data
* 2. Attempts to read and update that record with the incoming user
* 3. If either of those fail, throws an error to the user
* 4. Once finished, prevents the temp record from persisting to the database
*/
export declare const preventLockout: Validate;
//# sourceMappingURL=preventLockout.d.ts.map

View File

@@ -0,0 +1,73 @@
/**
* This code was originally forked from https://github.com/TooTallNate/proxy-agents/tree/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7
* With the following LICENSE:
*
* (The MIT License)
*
* Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>*
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* 'Software'), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:*
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.*
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import * as http from 'node:http';
import { OutgoingHttpHeaders } from 'node:http';
import * as net from 'node:net';
import * as tls from 'node:tls';
import { AgentConnectOpts } from './base';
import { Agent } from './base';
type Protocol<T> = T extends string ? Protocol : never;
type ConnectOptsMap = {
http: Pick<net.TcpNetConnectOpts, Exclude<keyof net.TcpNetConnectOpts, 'host' | 'port'>>;
https: Pick<tls.ConnectionOptions, Exclude<keyof tls.ConnectionOptions, 'host' | 'port'>>;
};
type ConnectOpts<T> = {
[P in keyof ConnectOptsMap]: Protocol<T> extends P ? ConnectOptsMap[P] : never;
}[keyof ConnectOptsMap];
export type HttpsProxyAgentOptions<T> = ConnectOpts<T> & http.AgentOptions & {
headers?: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
};
/**
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
*
* Outgoing HTTP requests are first tunneled through the proxy server using the
* `CONNECT` HTTP request method to establish a connection to the proxy server,
* and then the proxy server connects to the destination target and issues the
* HTTP request from the proxy server.
*
* `https:` requests have their socket connection upgraded to TLS once
* the connection to the proxy server has been established.
*/
export declare class HttpsProxyAgent<Uri extends string> extends Agent {
static protocols: readonly [
"http",
"https"
];
readonly proxy: URL;
proxyHeaders: OutgoingHttpHeaders | (() => OutgoingHttpHeaders);
connectOpts: net.TcpNetConnectOpts & tls.ConnectionOptions;
constructor(proxy: Uri | URL, opts?: HttpsProxyAgentOptions<Uri>);
/**
* Called when the node-core HTTP client library is creating a
* new HTTP request.
*/
connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<net.Socket>;
}
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,16 @@
/**
* Captures culture context from the browser.
*
* Enabled by default.
*
* @example
* ```js
* import * as Sentry from '@sentry/browser';
*
* Sentry.init({
* integrations: [Sentry.cultureContextIntegration()],
* });
* ```
*/
export declare const cultureContextIntegration: () => import("@sentry/core").Integration;
//# sourceMappingURL=culturecontext.d.ts.map

View File

@@ -0,0 +1,14 @@
"use client";
// Workaround for react-datepicker and other cjs dependencies potentially inserting require("react") statements
import * as requireReact from 'react';
import * as requireReactDom from 'react-dom';
function require(m) {
if (m === 'react') return requireReact;
if (m === 'react-dom') return requireReactDom;
throw new Error(`Unknown module ${m}`);
}
// Workaround end
var h=Object.create;var e=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(a&&(b=a(a=0)),b);var o=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),p=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of j(b))!l.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=i(b,d))||f.enumerable});return a};var q=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a)),r=a=>g(e({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e,r as f};
//# sourceMappingURL=chunk-5LKBKI4T.js.map

View File

@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
export declare function useLexicalIsTextContentEmpty(editor: LexicalEditor, trim?: boolean): boolean;

View File

@@ -0,0 +1,124 @@
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: "caractères", verb: "avoir" },
file: { unit: "octets", verb: "avoir" },
array: { unit: "éléments", verb: "avoir" },
set: { unit: "éléments", verb: "avoir" },
};
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" : "nombre";
}
case "object": {
if (Array.isArray(data)) {
return "tableau";
}
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: "entrée",
email: "adresse e-mail",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "date et heure ISO",
date: "date ISO",
time: "heure ISO",
duration: "durée ISO",
ipv4: "adresse IPv4",
ipv6: "adresse IPv6",
cidrv4: "plage IPv4",
cidrv6: "plage IPv6",
base64: "chaîne encodée en base64",
base64url: "chaîne encodée en base64url",
json_string: "chaîne JSON",
e164: "numéro E.164",
jwt: "JWT",
template_literal: "entrée",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Entrée invalide : ${issue.expected} attendu, ${parsedType(issue.input)} reçu`;
case "invalid_value":
if (issue.values.length === 1) return `Entrée invalide : ${util.stringifyPrimitive(issue.values[0])} attendu`;
return `Option invalide : une valeur parmi ${util.joinValues(issue.values, "|")} attendue`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Trop grand : ${issue.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "élément(s)"}`;
return `Trop grand : ${issue.origin ?? "valeur"} doit être ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Trop petit : ${issue.origin} doit ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Trop petit : ${issue.origin} doit être ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
if (_issue.format === "ends_with") return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
if (_issue.format === "includes") return `Chaîne invalide : doit inclure "${_issue.includes}"`;
if (_issue.format === "regex") return `Chaîne invalide : doit correspondre au modèle ${_issue.pattern}`;
return `${Nouns[_issue.format] ?? issue.format} invalide`;
}
case "not_multiple_of":
return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
case "unrecognized_keys":
return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Clé invalide dans ${issue.origin}`;
case "invalid_union":
return "Entrée invalide";
case "invalid_element":
return `Valeur invalide dans ${issue.origin}`;
default:
return `Entrée invalide`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1,21 @@
@layer payload-default {
%btn-reset {
border: 0;
background: none;
box-shadow: none;
border-radius: 0;
padding: 0;
color: currentColor;
font-family: var(--font-body);
}
}
@mixin btn-reset {
border: 0;
background: none;
box-shadow: none;
border-radius: 0;
padding: 0;
color: currentColor;
font-family: var(--font-body);
}

View File

@@ -0,0 +1,45 @@
import { WebSocketAuthModes } from "../../../realtime/types.cjs";
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/server/info.d.ts
type ServerInfoOutput = {
project: {
project_name: string;
default_language: string;
public_registration: boolean;
public_registration_verify_email: boolean;
};
mcp_enabled?: boolean;
ai_enabled?: boolean;
rateLimit?: {
points: number;
duration: number;
} | false;
rateLimitGlobal?: {
points: number;
duration: number;
} | false;
queryLimit?: {
default: number;
max: number;
};
websocket?: {
rest: {
authentication: WebSocketAuthModes;
path: string;
} | false;
graphql: {
authentication: WebSocketAuthModes;
path: string;
} | false;
heartbeat: number | false;
} | false;
};
/**
* Get information about the current installation.
* @returns Information about the current installation.
*/
declare const serverInfo: <Schema>() => RestCommand<ServerInfoOutput, Schema>;
//#endregion
export { ServerInfoOutput, serverInfo };
//# sourceMappingURL=info.d.cts.map

View File

@@ -0,0 +1,68 @@
/*
This source code has been taken and modified from https://github.com/vercel/next.js/blob/41a80533f900467e1b788bd2673abe2dca20be6a/packages/next/src/lib/has-necessary-dependencies.ts
License:
The MIT License (MIT)
Copyright (c) 2024 Vercel, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ import { promises as fs } from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { findUp } from '../findUp.js';
import { resolveFrom } from './resolveFrom.js';
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
const payloadPkgDirname = path.resolve(dirname, '../../../') // pkg dir (outside src)
;
const resolvedCwd = path.resolve(process.cwd());
export async function getDependencies(baseDir, requiredPackages) {
const resolutions = new Map();
const missingPackages = [];
await Promise.all(requiredPackages.map(async (pkg)=>{
try {
const pkgPath = await fs.realpath(resolveFrom(baseDir, pkg));
const pkgDir = path.dirname(pkgPath);
let packageJsonFilePath = null;
const foundPackageJsonDir = await findUp({
dir: pkgDir,
fileNames: [
'package.json'
]
});
if (foundPackageJsonDir) {
const resolvedFoundPath = path.resolve(foundPackageJsonDir);
if (resolvedFoundPath.startsWith(resolvedCwd) || resolvedFoundPath.startsWith(payloadPkgDirname)) {
// We don't want to match node modules outside the user's project. Checking for both process.cwd and dirname is a reliable way to do this.
packageJsonFilePath = resolvedFoundPath;
}
}
// No need to check if packageJsonFilePath exists - findUp checks that for us
if (packageJsonFilePath) {
// parse version
const packageJson = JSON.parse(await fs.readFile(packageJsonFilePath, 'utf8'));
const version = packageJson.version;
resolutions.set(pkg, {
path: packageJsonFilePath,
version
});
} else {
return missingPackages.push(pkg);
}
} catch (_) {
return missingPackages.push(pkg);
}
}));
return {
missing: missingPackages,
resolved: resolutions
};
}
//# sourceMappingURL=getDependencies.js.map

View File

@@ -0,0 +1 @@
[class*=lang-] script[type='text/plain'],[class*=language-] script[type='text/plain'],script[type='text/plain'][class*=lang-],script[type='text/plain'][class*=language-]{display:block;font:100% Consolas,Monaco,monospace;white-space:pre;overflow:auto}

View File

@@ -0,0 +1,61 @@
// @ts-check
/** @typedef { import('estree').BaseNode} BaseNode */
/** @typedef {{
skip: () => void;
remove: () => void;
replace: (node: BaseNode) => void;
}} WalkerContext */
export class WalkerBase {
constructor() {
/** @type {boolean} */
this.should_skip = false;
/** @type {boolean} */
this.should_remove = false;
/** @type {BaseNode | null} */
this.replacement = null;
/** @type {WalkerContext} */
this.context = {
skip: () => (this.should_skip = true),
remove: () => (this.should_remove = true),
replace: (node) => (this.replacement = node)
};
}
/**
*
* @param {any} parent
* @param {string} prop
* @param {number} index
* @param {BaseNode} node
*/
replace(parent, prop, index, node) {
if (parent) {
if (index !== null) {
parent[prop][index] = node;
} else {
parent[prop] = node;
}
}
}
/**
*
* @param {any} parent
* @param {string} prop
* @param {number} index
*/
remove(parent, prop, index) {
if (parent) {
if (index !== null) {
parent[prop].splice(index, 1);
} else {
delete parent[prop];
}
}
}
}

View File

@@ -0,0 +1,10 @@
import type { ClientField } from '../../fields/config/types.js';
export type Column = {
readonly accessor: string;
readonly active: boolean;
readonly CustomLabel?: React.ReactNode;
readonly field: ClientField;
readonly Heading: React.ReactNode;
readonly renderedCells: React.ReactNode[];
};
//# sourceMappingURL=Table.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Exception } from '@opentelemetry/api';\n\n/**\n * This interface defines the params that are be added to the wrapped function\n * using the \"shimmer.wrap\"\n */\nexport interface ShimWrapped extends Function {\n __wrapped: boolean;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n __unwrap: Function;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n __original: Function;\n}\n\n/**\n * An instrumentation scope consists of the name and optional version\n * used to obtain a tracer or meter from a provider. This metadata is made\n * available on ReadableSpan and MetricRecord for use by the export pipeline.\n */\nexport interface InstrumentationScope {\n readonly name: string;\n readonly version?: string;\n readonly schemaUrl?: string;\n}\n\n/** Defines an error handler function */\nexport type ErrorHandler = (ex: Exception) => void;\n"]}

View File

@@ -0,0 +1,52 @@
import { describe, beforeEach, it, expect, vitest } from 'vitest';
import nodemailer from 'nodemailer';
import { nodemailerAdapter } from './index.js';
const defaultArgs = {
defaultFromAddress: 'test@test.com',
defaultFromName: 'Test'
};
describe('email-nodemailer', ()=>{
describe('transport verification', ()=>{
let mockedVerify;
let mockTransport;
beforeEach(()=>{
mockedVerify = vitest.fn();
mockTransport = nodemailer.createTransport({
name: 'existing-transport',
// eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-misused-promises
send: async (mail)=>{
// eslint-disable-next-line no-console
console.log('mock send', mail);
},
verify: mockedVerify,
version: '0.0.1'
});
});
it('should be invoked when skipVerify = false', async ()=>{
await nodemailerAdapter({
...defaultArgs,
skipVerify: false,
transport: mockTransport
});
expect(mockedVerify.mock.calls).toHaveLength(1);
});
it('should be invoked when skipVerify is undefined', async ()=>{
await nodemailerAdapter({
...defaultArgs,
skipVerify: false,
transport: mockTransport
});
expect(mockedVerify.mock.calls).toHaveLength(1);
});
it('should not be invoked when skipVerify = true', async ()=>{
await nodemailerAdapter({
...defaultArgs,
skipVerify: true,
transport: mockTransport
});
expect(mockedVerify.mock.calls).toHaveLength(0);
});
});
});
//# sourceMappingURL=plugin.spec.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/utils/configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,GAAoC;IACnD,GAAG,EAAE,YAAY,CAAC,GAAG;IACrB,OAAO,EAAE,YAAY,CAAC,OAAO;IAC7B,KAAK,EAAE,YAAY,CAAC,KAAK;IACzB,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,KAAK,EAAE,YAAY,CAAC,KAAK;IACzB,IAAI,EAAE,YAAY,CAAC,IAAI;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAyB;IAEzB,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,yIAAyI;QACzI,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAE1D,IAAI,gBAAgB,IAAI,IAAI,EAAE;QAC5B,IAAI,CAAC,IAAI,CACP,sBAAsB,KAAK,sBAAsB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAC3F,CAAC;QACF,OAAO,YAAY,CAAC,IAAI,CAAC;KAC1B;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { diag, DiagLogLevel } from '@opentelemetry/api';\n\nconst logLevelMap: { [key: string]: DiagLogLevel } = {\n ALL: DiagLogLevel.ALL,\n VERBOSE: DiagLogLevel.VERBOSE,\n DEBUG: DiagLogLevel.DEBUG,\n INFO: DiagLogLevel.INFO,\n WARN: DiagLogLevel.WARN,\n ERROR: DiagLogLevel.ERROR,\n NONE: DiagLogLevel.NONE,\n};\n\n/**\n * Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined.\n * @param value\n */\nexport function diagLogLevelFromString(\n value: string | undefined\n): DiagLogLevel | undefined {\n if (value == null) {\n // don't fall back to default - no value set has different semantics for ús than an incorrect value (do not set vs. fall back to default)\n return undefined;\n }\n\n const resolvedLogLevel = logLevelMap[value.toUpperCase()];\n\n if (resolvedLogLevel == null) {\n diag.warn(\n `Unknown log level \"${value}\", expected one of ${Object.keys(logLevelMap)}, using default`\n );\n return DiagLogLevel.INFO;\n }\n\n return resolvedLogLevel;\n}\n"]}

View File

@@ -0,0 +1,234 @@
'use strict'
const os = require('node:os')
const stdSerializers = require('pino-std-serializers')
const caller = require('./lib/caller')
const redaction = require('./lib/redaction')
const time = require('./lib/time')
const proto = require('./lib/proto')
const symbols = require('./lib/symbols')
const { configure } = require('safe-stable-stringify')
const { assertDefaultLevelFound, mappings, genLsCache, genLevelComparison, assertLevelComparison } = require('./lib/levels')
const { DEFAULT_LEVELS, SORTING_ORDER } = require('./lib/constants')
const {
createArgsNormalizer,
asChindings,
buildSafeSonicBoom,
buildFormatters,
stringify,
normalizeDestFileDescriptor,
noop
} = require('./lib/tools')
const { version } = require('./lib/meta')
const {
chindingsSym,
redactFmtSym,
serializersSym,
timeSym,
timeSliceIndexSym,
streamSym,
stringifySym,
stringifySafeSym,
stringifiersSym,
setLevelSym,
endSym,
formatOptsSym,
messageKeySym,
errorKeySym,
nestedKeySym,
mixinSym,
levelCompSym,
useOnlyCustomLevelsSym,
formattersSym,
hooksSym,
nestedKeyStrSym,
mixinMergeStrategySym,
msgPrefixSym
} = symbols
const { epochTime, nullTime } = time
const { pid } = process
const hostname = os.hostname()
const defaultErrorSerializer = stdSerializers.err
const defaultOptions = {
level: 'info',
levelComparison: SORTING_ORDER.ASC,
levels: DEFAULT_LEVELS,
messageKey: 'msg',
errorKey: 'err',
nestedKey: null,
enabled: true,
base: { pid, hostname },
serializers: Object.assign(Object.create(null), {
err: defaultErrorSerializer
}),
formatters: Object.assign(Object.create(null), {
bindings (bindings) {
return bindings
},
level (label, number) {
return { level: number }
}
}),
hooks: {
logMethod: undefined,
streamWrite: undefined
},
timestamp: epochTime,
name: undefined,
redact: null,
customLevels: null,
useOnlyCustomLevels: false,
depthLimit: 5,
edgeLimit: 100
}
const normalize = createArgsNormalizer(defaultOptions)
const serializers = Object.assign(Object.create(null), stdSerializers)
function pino (...args) {
const instance = {}
const { opts, stream } = normalize(instance, caller(), ...args)
if (opts.level && typeof opts.level === 'string' && DEFAULT_LEVELS[opts.level.toLowerCase()] !== undefined) opts.level = opts.level.toLowerCase()
const {
redact,
crlf,
serializers,
timestamp,
messageKey,
errorKey,
nestedKey,
base,
name,
level,
customLevels,
levelComparison,
mixin,
mixinMergeStrategy,
useOnlyCustomLevels,
formatters,
hooks,
depthLimit,
edgeLimit,
onChild,
msgPrefix
} = opts
const stringifySafe = configure({
maximumDepth: depthLimit,
maximumBreadth: edgeLimit
})
const allFormatters = buildFormatters(
formatters.level,
formatters.bindings,
formatters.log
)
const stringifyFn = stringify.bind({
[stringifySafeSym]: stringifySafe
})
const stringifiers = redact ? redaction(redact, stringifyFn) : {}
const formatOpts = redact
? { stringify: stringifiers[redactFmtSym] }
: { stringify: stringifyFn }
const end = '}' + (crlf ? '\r\n' : '\n')
const coreChindings = asChindings.bind(null, {
[chindingsSym]: '',
[serializersSym]: serializers,
[stringifiersSym]: stringifiers,
[stringifySym]: stringify,
[stringifySafeSym]: stringifySafe,
[formattersSym]: allFormatters
})
let chindings = ''
if (base !== null) {
if (name === undefined) {
chindings = coreChindings(base)
} else {
chindings = coreChindings(Object.assign({}, base, { name }))
}
}
const time = (timestamp instanceof Function)
? timestamp
: (timestamp ? epochTime : nullTime)
const timeSliceIndex = time().indexOf(':') + 1
if (useOnlyCustomLevels && !customLevels) throw Error('customLevels is required if useOnlyCustomLevels is set true')
if (mixin && typeof mixin !== 'function') throw Error(`Unknown mixin type "${typeof mixin}" - expected "function"`)
if (msgPrefix && typeof msgPrefix !== 'string') throw Error(`Unknown msgPrefix type "${typeof msgPrefix}" - expected "string"`)
assertDefaultLevelFound(level, customLevels, useOnlyCustomLevels)
const levels = mappings(customLevels, useOnlyCustomLevels)
if (typeof stream.emit === 'function') {
stream.emit('message', { code: 'PINO_CONFIG', config: { levels, messageKey, errorKey } })
}
assertLevelComparison(levelComparison)
const levelCompFunc = genLevelComparison(levelComparison)
Object.assign(instance, {
levels,
[levelCompSym]: levelCompFunc,
[useOnlyCustomLevelsSym]: useOnlyCustomLevels,
[streamSym]: stream,
[timeSym]: time,
[timeSliceIndexSym]: timeSliceIndex,
[stringifySym]: stringify,
[stringifySafeSym]: stringifySafe,
[stringifiersSym]: stringifiers,
[endSym]: end,
[formatOptsSym]: formatOpts,
[messageKeySym]: messageKey,
[errorKeySym]: errorKey,
[nestedKeySym]: nestedKey,
// protect against injection
[nestedKeyStrSym]: nestedKey ? `,${JSON.stringify(nestedKey)}:{` : '',
[serializersSym]: serializers,
[mixinSym]: mixin,
[mixinMergeStrategySym]: mixinMergeStrategy,
[chindingsSym]: chindings,
[formattersSym]: allFormatters,
[hooksSym]: hooks,
silent: noop,
onChild,
[msgPrefixSym]: msgPrefix
})
Object.setPrototypeOf(instance, proto())
genLsCache(instance)
instance[setLevelSym](level)
return instance
}
module.exports = pino
module.exports.destination = (dest = process.stdout.fd) => {
if (typeof dest === 'object') {
dest.dest = normalizeDestFileDescriptor(dest.dest || process.stdout.fd)
return buildSafeSonicBoom(dest)
} else {
return buildSafeSonicBoom({ dest: normalizeDestFileDescriptor(dest), minLength: 0 })
}
}
module.exports.transport = require('./lib/transport')
module.exports.multistream = require('./lib/multistream')
module.exports.levels = mappings()
module.exports.stdSerializers = serializers
module.exports.stdTimeFunctions = Object.assign({}, time)
module.exports.symbols = symbols
module.exports.version = version
// Enables default and name export with TypeScript and Babel
module.exports.default = pino
module.exports.pino = pino

View File

@@ -0,0 +1,62 @@
import type { BatchItem } from "../batch.js";
import { type Cache } from "../cache/core/index.js";
import type { WithCacheConfig } from "../cache/core/types.js";
import { entityKind } from "../entity.js";
import type { Logger } from "../logger.js";
import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js";
import { type Query } from "../sql/sql.js";
import type { SQLiteAsyncDialect } from "../sqlite-core/dialect.js";
import { SQLiteTransaction } from "../sqlite-core/index.js";
import type { SelectedFieldsOrdered } from "../sqlite-core/query-builders/select.types.js";
import type { PreparedQueryConfig as PreparedQueryConfigBase, SQLiteExecuteMethod, SQLiteTransactionConfig } from "../sqlite-core/session.js";
import { SQLitePreparedQuery, SQLiteSession } from "../sqlite-core/session.js";
export interface SQLiteD1SessionOptions {
logger?: Logger;
cache?: Cache;
}
type PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;
export declare class SQLiteD1Session<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteSession<'async', D1Result, TFullSchema, TSchema> {
private client;
private schema;
private options;
static readonly [entityKind]: string;
private logger;
private cache;
constructor(client: D1Database, dialect: SQLiteAsyncDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: SQLiteD1SessionOptions);
prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => unknown, queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
}, cacheConfig?: WithCacheConfig): D1PreparedQuery;
batch<T extends BatchItem<'sqlite'>[] | readonly BatchItem<'sqlite'>[]>(queries: T): Promise<unknown[]>;
extractRawAllValueFromBatchResult(result: unknown): unknown;
extractRawGetValueFromBatchResult(result: unknown): unknown;
extractRawValuesValueFromBatchResult(result: unknown): unknown;
transaction<T>(transaction: (tx: D1Transaction<TFullSchema, TSchema>) => T | Promise<T>, config?: SQLiteTransactionConfig): Promise<T>;
}
export declare class D1Transaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteTransaction<'async', D1Result, TFullSchema, TSchema> {
static readonly [entityKind]: string;
transaction<T>(transaction: (tx: D1Transaction<TFullSchema, TSchema>) => Promise<T>): Promise<T>;
}
export declare class D1PreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<{
type: 'async';
run: D1Response;
all: T['all'];
get: T['get'];
values: T['values'];
execute: T['execute'];
}> {
private logger;
private _isResponseInArrayMode;
static readonly [entityKind]: string;
constructor(stmt: D1PreparedStatement, query: Query, logger: Logger, cache: Cache, queryMetadata: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
} | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, _isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => unknown);
run(placeholderValues?: Record<string, unknown>): Promise<D1Response>;
all(placeholderValues?: Record<string, unknown>): Promise<T['all']>;
mapAllResult(rows: unknown, isFromBatch?: boolean): unknown;
get(placeholderValues?: Record<string, unknown>): Promise<T['get']>;
mapGetResult(result: unknown, isFromBatch?: boolean): unknown;
values<T extends any[] = unknown[]>(placeholderValues?: Record<string, unknown>): Promise<T[]>;
}
export {};

View File

@@ -0,0 +1,658 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AnyTypeAnnotation = AnyTypeAnnotation;
exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
exports.DeclareClass = DeclareClass;
exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
exports.DeclareExportDeclaration = DeclareExportDeclaration;
exports.DeclareFunction = DeclareFunction;
exports.DeclareInterface = DeclareInterface;
exports.DeclareModule = DeclareModule;
exports.DeclareModuleExports = DeclareModuleExports;
exports.DeclareOpaqueType = DeclareOpaqueType;
exports.DeclareTypeAlias = DeclareTypeAlias;
exports.DeclareVariable = DeclareVariable;
exports.DeclaredPredicate = DeclaredPredicate;
exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
exports.EnumBooleanBody = EnumBooleanBody;
exports.EnumBooleanMember = EnumBooleanMember;
exports.EnumDeclaration = EnumDeclaration;
exports.EnumDefaultedMember = EnumDefaultedMember;
exports.EnumNumberBody = EnumNumberBody;
exports.EnumNumberMember = EnumNumberMember;
exports.EnumStringBody = EnumStringBody;
exports.EnumStringMember = EnumStringMember;
exports.EnumSymbolBody = EnumSymbolBody;
exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
exports.FunctionTypeParam = FunctionTypeParam;
exports.IndexedAccessType = IndexedAccessType;
exports.InferredPredicate = InferredPredicate;
exports.InterfaceDeclaration = InterfaceDeclaration;
exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;
exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
exports.MixedTypeAnnotation = MixedTypeAnnotation;
exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
exports.NullableTypeAnnotation = NullableTypeAnnotation;
Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
enumerable: true,
get: function () {
return _types2.NumericLiteral;
}
});
exports.NumberTypeAnnotation = NumberTypeAnnotation;
exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
exports.ObjectTypeIndexer = ObjectTypeIndexer;
exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
exports.ObjectTypeProperty = ObjectTypeProperty;
exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
exports.OpaqueType = OpaqueType;
exports.OptionalIndexedAccessType = OptionalIndexedAccessType;
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
enumerable: true,
get: function () {
return _types2.StringLiteral;
}
});
exports.StringTypeAnnotation = StringTypeAnnotation;
exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
exports.ThisTypeAnnotation = ThisTypeAnnotation;
exports.TupleTypeAnnotation = TupleTypeAnnotation;
exports.TypeAlias = TypeAlias;
exports.TypeAnnotation = TypeAnnotation;
exports.TypeCastExpression = TypeCastExpression;
exports.TypeParameter = TypeParameter;
exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;
exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
exports.UnionTypeAnnotation = UnionTypeAnnotation;
exports.Variance = Variance;
exports.VoidTypeAnnotation = VoidTypeAnnotation;
exports._interfaceish = _interfaceish;
exports._variance = _variance;
var _t = require("@babel/types");
var _modules = require("./modules.js");
var _index = require("../node/index.js");
var _types2 = require("./types.js");
const {
isDeclareExportDeclaration,
isStatement
} = _t;
function AnyTypeAnnotation() {
this.word("any");
}
function ArrayTypeAnnotation(node) {
this.print(node.elementType, true);
this.tokenChar(91);
this.tokenChar(93);
}
function BooleanTypeAnnotation() {
this.word("boolean");
}
function BooleanLiteralTypeAnnotation(node) {
this.word(node.value ? "true" : "false");
}
function NullLiteralTypeAnnotation() {
this.word("null");
}
function DeclareClass(node, parent) {
if (!isDeclareExportDeclaration(parent)) {
this.word("declare");
this.space();
}
this.word("class");
this.space();
_interfaceish.call(this, node);
}
function DeclareFunction(node, parent) {
if (!isDeclareExportDeclaration(parent)) {
this.word("declare");
this.space();
}
this.word("function");
this.space();
this.print(node.id);
this.print(node.id.typeAnnotation.typeAnnotation);
if (node.predicate) {
this.space();
this.print(node.predicate);
}
this.semicolon();
}
function InferredPredicate() {
this.tokenChar(37);
this.word("checks");
}
function DeclaredPredicate(node) {
this.tokenChar(37);
this.word("checks");
this.tokenChar(40);
this.print(node.value);
this.tokenChar(41);
}
function DeclareInterface(node) {
this.word("declare");
this.space();
InterfaceDeclaration.call(this, node);
}
function DeclareModule(node) {
this.word("declare");
this.space();
this.word("module");
this.space();
this.print(node.id);
this.space();
this.print(node.body);
}
function DeclareModuleExports(node) {
this.word("declare");
this.space();
this.word("module");
this.tokenChar(46);
this.word("exports");
this.print(node.typeAnnotation);
}
function DeclareTypeAlias(node) {
this.word("declare");
this.space();
TypeAlias.call(this, node);
}
function DeclareOpaqueType(node, parent) {
if (!isDeclareExportDeclaration(parent)) {
this.word("declare");
this.space();
}
OpaqueType.call(this, node);
}
function DeclareVariable(node, parent) {
if (!isDeclareExportDeclaration(parent)) {
this.word("declare");
this.space();
}
this.word("var");
this.space();
this.print(node.id);
this.print(node.id.typeAnnotation);
this.semicolon();
}
function DeclareExportDeclaration(node) {
this.word("declare");
this.space();
this.word("export");
this.space();
if (node.default) {
this.word("default");
this.space();
}
FlowExportDeclaration.call(this, node);
}
function DeclareExportAllDeclaration(node) {
this.word("declare");
this.space();
_modules.ExportAllDeclaration.call(this, node);
}
function EnumDeclaration(node) {
const {
id,
body
} = node;
this.word("enum");
this.space();
this.print(id);
this.print(body);
}
function enumExplicitType(context, name, hasExplicitType) {
if (hasExplicitType) {
context.space();
context.word("of");
context.space();
context.word(name);
}
context.space();
}
function enumBody(context, node) {
const {
members
} = node;
context.token("{");
context.indent();
context.newline();
for (const member of members) {
context.print(member);
context.newline();
}
if (node.hasUnknownMembers) {
context.token("...");
context.newline();
}
context.dedent();
context.token("}");
}
function EnumBooleanBody(node) {
const {
explicitType
} = node;
enumExplicitType(this, "boolean", explicitType);
enumBody(this, node);
}
function EnumNumberBody(node) {
const {
explicitType
} = node;
enumExplicitType(this, "number", explicitType);
enumBody(this, node);
}
function EnumStringBody(node) {
const {
explicitType
} = node;
enumExplicitType(this, "string", explicitType);
enumBody(this, node);
}
function EnumSymbolBody(node) {
enumExplicitType(this, "symbol", true);
enumBody(this, node);
}
function EnumDefaultedMember(node) {
const {
id
} = node;
this.print(id);
this.tokenChar(44);
}
function enumInitializedMember(context, node) {
context.print(node.id);
context.space();
context.token("=");
context.space();
context.print(node.init);
context.token(",");
}
function EnumBooleanMember(node) {
enumInitializedMember(this, node);
}
function EnumNumberMember(node) {
enumInitializedMember(this, node);
}
function EnumStringMember(node) {
enumInitializedMember(this, node);
}
function FlowExportDeclaration(node) {
if (node.declaration) {
const declar = node.declaration;
this.print(declar);
if (!isStatement(declar)) this.semicolon();
} else {
this.tokenChar(123);
if (node.specifiers.length) {
this.space();
this.printList(node.specifiers);
this.space();
}
this.tokenChar(125);
if (node.source) {
this.space();
this.word("from");
this.space();
this.print(node.source);
}
this.semicolon();
}
}
function ExistsTypeAnnotation() {
this.tokenChar(42);
}
function FunctionTypeAnnotation(node, parent) {
this.print(node.typeParameters);
this.tokenChar(40);
if (node.this) {
this.word("this");
this.tokenChar(58);
this.space();
this.print(node.this.typeAnnotation);
if (node.params.length || node.rest) {
this.tokenChar(44);
this.space();
}
}
this.printList(node.params);
if (node.rest) {
if (node.params.length) {
this.tokenChar(44);
this.space();
}
this.token("...");
this.print(node.rest);
}
this.tokenChar(41);
const type = parent == null ? void 0 : parent.type;
if (type != null && (type === "ObjectTypeCallProperty" || type === "ObjectTypeInternalSlot" || type === "DeclareFunction" || type === "ObjectTypeProperty" && parent.method)) {
this.tokenChar(58);
} else {
this.space();
this.token("=>");
}
this.space();
this.print(node.returnType);
}
function FunctionTypeParam(node) {
this.print(node.name);
if (node.optional) this.tokenChar(63);
if (node.name) {
this.tokenChar(58);
this.space();
}
this.print(node.typeAnnotation);
}
function InterfaceExtends(node) {
this.print(node.id);
this.print(node.typeParameters, true);
}
function _interfaceish(node) {
var _node$extends;
this.print(node.id);
this.print(node.typeParameters);
if ((_node$extends = node.extends) != null && _node$extends.length) {
this.space();
this.word("extends");
this.space();
this.printList(node.extends);
}
if (node.type === "DeclareClass") {
var _node$mixins, _node$implements;
if ((_node$mixins = node.mixins) != null && _node$mixins.length) {
this.space();
this.word("mixins");
this.space();
this.printList(node.mixins);
}
if ((_node$implements = node.implements) != null && _node$implements.length) {
this.space();
this.word("implements");
this.space();
this.printList(node.implements);
}
}
this.space();
this.print(node.body);
}
function _variance(node) {
var _node$variance;
const kind = (_node$variance = node.variance) == null ? void 0 : _node$variance.kind;
if (kind != null) {
if (kind === "plus") {
this.tokenChar(43);
} else if (kind === "minus") {
this.tokenChar(45);
}
}
}
function InterfaceDeclaration(node) {
this.word("interface");
this.space();
_interfaceish.call(this, node);
}
function andSeparator(occurrenceCount) {
this.space();
this.token("&", false, occurrenceCount);
this.space();
}
function InterfaceTypeAnnotation(node) {
var _node$extends2;
this.word("interface");
if ((_node$extends2 = node.extends) != null && _node$extends2.length) {
this.space();
this.word("extends");
this.space();
this.printList(node.extends);
}
this.space();
this.print(node.body);
}
function IntersectionTypeAnnotation(node) {
this.printJoin(node.types, undefined, undefined, andSeparator);
}
function MixedTypeAnnotation() {
this.word("mixed");
}
function EmptyTypeAnnotation() {
this.word("empty");
}
function NullableTypeAnnotation(node) {
this.tokenChar(63);
this.print(node.typeAnnotation);
}
function NumberTypeAnnotation() {
this.word("number");
}
function StringTypeAnnotation() {
this.word("string");
}
function ThisTypeAnnotation() {
this.word("this");
}
function TupleTypeAnnotation(node) {
this.tokenChar(91);
this.printList(node.types);
this.tokenChar(93);
}
function TypeofTypeAnnotation(node) {
this.word("typeof");
this.space();
this.print(node.argument);
}
function TypeAlias(node) {
this.word("type");
this.space();
this.print(node.id);
this.print(node.typeParameters);
this.space();
this.tokenChar(61);
this.space();
this.print(node.right);
this.semicolon();
}
function TypeAnnotation(node, parent) {
this.tokenChar(58);
this.space();
if (parent.type === "ArrowFunctionExpression") {
this.tokenContext |= _index.TokenContext.arrowFlowReturnType;
} else if (node.optional) {
this.tokenChar(63);
}
this.print(node.typeAnnotation);
}
function TypeParameterInstantiation(node) {
this.tokenChar(60);
this.printList(node.params);
this.tokenChar(62);
}
function TypeParameter(node) {
_variance.call(this, node);
this.word(node.name);
if (node.bound) {
this.print(node.bound);
}
if (node.default) {
this.space();
this.tokenChar(61);
this.space();
this.print(node.default);
}
}
function OpaqueType(node) {
this.word("opaque");
this.space();
this.word("type");
this.space();
this.print(node.id);
this.print(node.typeParameters);
if (node.supertype) {
this.tokenChar(58);
this.space();
this.print(node.supertype);
}
if (node.impltype) {
this.space();
this.tokenChar(61);
this.space();
this.print(node.impltype);
}
this.semicolon();
}
function ObjectTypeAnnotation(node) {
if (node.exact) {
this.token("{|");
} else {
this.tokenChar(123);
}
const props = [...node.properties, ...(node.callProperties || []), ...(node.indexers || []), ...(node.internalSlots || [])];
if (props.length) {
this.newline();
this.space();
this.printJoin(props, true, true, () => {
if (props.length !== 1 || node.inexact) {
this.tokenChar(44);
this.space();
}
}, true);
this.space();
}
if (node.inexact) {
this.indent();
this.token("...");
if (props.length) {
this.newline();
}
this.dedent();
}
if (node.exact) {
this.token("|}");
} else {
this.tokenChar(125);
}
}
function ObjectTypeInternalSlot(node) {
if (node.static) {
this.word("static");
this.space();
}
this.tokenChar(91);
this.tokenChar(91);
this.print(node.id);
this.tokenChar(93);
this.tokenChar(93);
if (node.optional) this.tokenChar(63);
if (!node.method) {
this.tokenChar(58);
this.space();
}
this.print(node.value);
}
function ObjectTypeCallProperty(node) {
if (node.static) {
this.word("static");
this.space();
}
this.print(node.value);
}
function ObjectTypeIndexer(node) {
if (node.static) {
this.word("static");
this.space();
}
_variance.call(this, node);
this.tokenChar(91);
if (node.id) {
this.print(node.id);
this.tokenChar(58);
this.space();
}
this.print(node.key);
this.tokenChar(93);
this.tokenChar(58);
this.space();
this.print(node.value);
}
function ObjectTypeProperty(node) {
if (node.proto) {
this.word("proto");
this.space();
}
if (node.static) {
this.word("static");
this.space();
}
if (node.kind === "get" || node.kind === "set") {
this.word(node.kind);
this.space();
}
_variance.call(this, node);
this.print(node.key);
if (node.optional) this.tokenChar(63);
if (!node.method) {
this.tokenChar(58);
this.space();
}
this.print(node.value);
}
function ObjectTypeSpreadProperty(node) {
this.token("...");
this.print(node.argument);
}
function QualifiedTypeIdentifier(node) {
this.print(node.qualification);
this.tokenChar(46);
this.print(node.id);
}
function SymbolTypeAnnotation() {
this.word("symbol");
}
function orSeparator(occurrenceCount) {
this.space();
this.token("|", false, occurrenceCount);
this.space();
}
function UnionTypeAnnotation(node) {
this.printJoin(node.types, undefined, undefined, orSeparator);
}
function TypeCastExpression(node) {
this.tokenChar(40);
this.print(node.expression);
this.print(node.typeAnnotation);
this.tokenChar(41);
}
function Variance(node) {
if (node.kind === "plus") {
this.tokenChar(43);
} else {
this.tokenChar(45);
}
}
function VoidTypeAnnotation() {
this.word("void");
}
function IndexedAccessType(node) {
this.print(node.objectType, true);
this.tokenChar(91);
this.print(node.indexType);
this.tokenChar(93);
}
function OptionalIndexedAccessType(node) {
this.print(node.objectType);
if (node.optional) {
this.token("?.");
}
this.tokenChar(91);
this.print(node.indexType);
this.tokenChar(93);
}
//# sourceMappingURL=flow.js.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":"0 1 2 3 4 5 6 7 8 9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B 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 5C","2":"0C VC 4C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R 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"},E:{"1":"J bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"6C bC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 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 MD PC xC ND QC","2":"F JD KD LD"},G:{"1":"E QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"bC OD yC PD"},H:{"130":"mD"},I:{"130":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","130":"A B C PC xC QC"},L:{"132":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"130":"RC"},P:{"130":"J","132":"9 AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"132":"4D"},R:{"132":"5D"},S:{"1":"7D","2":"6D"}},B:1,C:"Multiple file selection",D:true};

View File

@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLHSLA = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const HSLA_REGEX = /^hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (!HSLA_REGEX.test(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid HSLA color: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
exports.GraphQLHSLA = new graphql_1.GraphQLScalarType({
name: `HSLA`,
description: `A field whose value is a CSS HSLA color: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla().`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Can only validate strings as HSLA colors but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'HSLA',
type: 'string',
pattern: HSLA_REGEX.source,
},
},
});

View File

@@ -0,0 +1,4 @@
'use strict';
var argv = require('../')(process.argv.slice(2));
console.log(argv);

View File

@@ -0,0 +1,6 @@
export declare const previousSaturdayWithOptions: import("./types.js").FPFn2<
Date,
| import("../previousSaturday.js").PreviousSaturdayOptions<Date>
| undefined,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/transactions/rollbackTransaction.ts"],"sourcesContent":["import type { RollbackTransaction } from 'payload'\n\nexport const rollbackTransaction: RollbackTransaction = async function rollbackTransaction(\n incomingID = '',\n) {\n const transactionID = incomingID instanceof Promise ? await incomingID : incomingID\n\n // if multiple operations are using the same transaction, the first will flow through and delete the session.\n // subsequent calls should be ignored.\n if (!this.sessions[transactionID]) {\n return\n }\n\n const session = this.sessions[transactionID]\n\n // Delete from registry FIRST to prevent race conditions\n // This ensures other operations can't retrieve this session while we're ending it\n delete this.sessions[transactionID]\n\n // end the session promise in failure by calling reject\n await session.reject()\n}\n"],"names":["rollbackTransaction","incomingID","transactionID","Promise","sessions","session","reject"],"mappings":"AAEA,OAAO,MAAMA,sBAA2C,eAAeA,oBACrEC,aAAa,EAAE;IAEf,MAAMC,gBAAgBD,sBAAsBE,UAAU,MAAMF,aAAaA;IAEzE,6GAA6G;IAC7G,sCAAsC;IACtC,IAAI,CAAC,IAAI,CAACG,QAAQ,CAACF,cAAc,EAAE;QACjC;IACF;IAEA,MAAMG,UAAU,IAAI,CAACD,QAAQ,CAACF,cAAc;IAE5C,wDAAwD;IACxD,kFAAkF;IAClF,OAAO,IAAI,CAACE,QAAQ,CAACF,cAAc;IAEnC,uDAAuD;IACvD,MAAMG,QAAQC,MAAM;AACtB,EAAC"}

View File

@@ -0,0 +1,92 @@
"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 bigint_exports = {};
__export(bigint_exports, {
PgBigInt53: () => PgBigInt53,
PgBigInt53Builder: () => PgBigInt53Builder,
PgBigInt64: () => PgBigInt64,
PgBigInt64Builder: () => PgBigInt64Builder,
bigint: () => bigint
});
module.exports = __toCommonJS(bigint_exports);
var import_entity = require("../../entity.cjs");
var import_utils = require("../../utils.cjs");
var import_common = require("./common.cjs");
var import_int_common = require("./int.common.cjs");
class PgBigInt53Builder extends import_int_common.PgIntColumnBaseBuilder {
static [import_entity.entityKind] = "PgBigInt53Builder";
constructor(name) {
super(name, "number", "PgBigInt53");
}
/** @internal */
build(table) {
return new PgBigInt53(table, this.config);
}
}
class PgBigInt53 extends import_common.PgColumn {
static [import_entity.entityKind] = "PgBigInt53";
getSQLType() {
return "bigint";
}
mapFromDriverValue(value) {
if (typeof value === "number") {
return value;
}
return Number(value);
}
}
class PgBigInt64Builder extends import_int_common.PgIntColumnBaseBuilder {
static [import_entity.entityKind] = "PgBigInt64Builder";
constructor(name) {
super(name, "bigint", "PgBigInt64");
}
/** @internal */
build(table) {
return new PgBigInt64(
table,
this.config
);
}
}
class PgBigInt64 extends import_common.PgColumn {
static [import_entity.entityKind] = "PgBigInt64";
getSQLType() {
return "bigint";
}
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
mapFromDriverValue(value) {
return BigInt(value);
}
}
function bigint(a, b) {
const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
if (config.mode === "number") {
return new PgBigInt53Builder(name);
}
return new PgBigInt64Builder(name);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgBigInt53,
PgBigInt53Builder,
PgBigInt64,
PgBigInt64Builder,
bigint
});
//# sourceMappingURL=bigint.cjs.map

View File

@@ -0,0 +1 @@
!function(e){var a=e.languages.javascript,n="\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})+\\}",t="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(t+"(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?=\\s|$)"),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(t+"\\[(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?:=[^[\\]]+)?\\](?=\\s|$)"),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:a,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp("(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\\s+(?:<TYPE>\\s+)?)[A-Z]\\w*(?:\\.[A-Z]\\w*)*".replace(/<TYPE>/g,(function(){return n}))),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:a.string,number:a.number,boolean:a.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:a,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(Prism);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './alias.ts';\nexport * from './column-builder.ts';\nexport * from './column.ts';\nexport * from './entity.ts';\nexport * from './errors.ts';\nexport * from './logger.ts';\nexport * from './operations.ts';\nexport * from './query-promise.ts';\nexport * from './relations.ts';\nexport * from './sql/index.ts';\nexport * from './subquery.ts';\nexport * from './table.ts';\nexport * from './utils.ts';\nexport * from './view-common.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,uBAAd;AACA,0BAAc,gCADd;AAEA,0BAAc,wBAFd;AAGA,0BAAc,wBAHd;AAIA,0BAAc,wBAJd;AAKA,0BAAc,wBALd;AAMA,0BAAc,4BANd;AAOA,0BAAc,+BAPd;AAQA,0BAAc,2BARd;AASA,0BAAc,2BATd;AAUA,0BAAc,0BAVd;AAWA,0BAAc,uBAXd;AAYA,0BAAc,uBAZd;AAaA,0BAAc,6BAbd;","names":[]}

View File

@@ -0,0 +1,100 @@
declare const AUTH_OPERATIONS_TO_INSTRUMENT: string[];
declare const AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT: string[];
export declare const FILTER_MAPPINGS: {
eq: string;
neq: string;
gt: string;
gte: string;
lt: string;
lte: string;
like: string;
'like(all)': string;
'like(any)': string;
ilike: string;
'ilike(all)': string;
'ilike(any)': string;
is: string;
in: string;
cs: string;
cd: string;
sr: string;
nxl: string;
sl: string;
nxr: string;
adj: string;
ov: string;
fts: string;
plfts: string;
phfts: string;
wfts: string;
not: string;
};
export declare const DB_OPERATIONS_TO_INSTRUMENT: string[];
type AuthOperationFn = (...args: unknown[]) => Promise<unknown>;
type AuthOperationName = (typeof AUTH_OPERATIONS_TO_INSTRUMENT)[number];
type AuthAdminOperationName = (typeof AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT)[number];
type PostgRESTQueryOperationFn = (...args: unknown[]) => PostgRESTFilterBuilder;
export interface SupabaseClientInstance {
auth: {
admin: Record<AuthAdminOperationName, AuthOperationFn>;
} & Record<AuthOperationName, AuthOperationFn>;
}
export interface PostgRESTQueryBuilder {
[key: string]: PostgRESTQueryOperationFn;
}
export interface PostgRESTFilterBuilder {
method: string;
headers: Record<string, string>;
url: URL;
schema: string;
body: any;
}
export interface SupabaseResponse {
status?: number;
error?: {
message: string;
code?: string;
details?: unknown;
};
}
export interface SupabaseError extends Error {
code?: string;
details?: unknown;
}
export interface SupabaseBreadcrumb {
type: string;
category: string;
message: string;
data?: {
query?: string[];
body?: Record<string, unknown>;
};
}
export interface SupabaseClientConstructor {
prototype: {
from: (table: string) => PostgRESTQueryBuilder;
};
}
export interface PostgRESTProtoThenable {
then: <T>(onfulfilled?: ((value: T) => T | PromiseLike<T>) | null, onrejected?: ((reason: any) => T | PromiseLike<T>) | null) => Promise<T>;
}
/**
* Extracts the database operation type from the HTTP method and headers
* @param method - The HTTP method of the request
* @param headers - The request headers
* @returns The database operation type ('select', 'insert', 'upsert', 'update', or 'delete')
*/
export declare function extractOperation(method: string, headers?: Record<string, string>): string;
/**
* Translates Supabase filter parameters into readable method names for tracing
* @param key - The filter key from the URL search parameters
* @param query - The filter value from the URL search parameters
* @returns A string representation of the filter as a method call
*/
export declare function translateFiltersIntoMethods(key: string, query: string): string;
export declare const instrumentSupabaseClient: (supabaseClient: unknown) => void;
export declare const supabaseIntegration: (options: {
supabaseClient: any;
}) => import("../types-hoist/integration").Integration;
export {};
//# sourceMappingURL=supabase.d.ts.map

View File

@@ -0,0 +1,2 @@
import{throwIfEmpty as e}from"../../utils/throw-if-empty.js";const t=e=>()=>({path:`/roles`,params:e??{},method:`GET`}),n=(t,n)=>()=>(e(String(t),`Key cannot be empty`),{path:`/roles/${t}`,params:n??{},method:`GET`}),r=e=>()=>({path:`/roles/me`,params:e??{},method:`GET`});export{n as readRole,t as readRoles,r as readRolesMe};
//# sourceMappingURL=roles.js.map

View File

@@ -0,0 +1,35 @@
"use strict";
exports.constructNow = constructNow;
var _index = require("./constructFrom.cjs");
/**
* @name constructNow
* @category Generic Helpers
* @summary Constructs a new current date using the passed value constructor.
* @pure false
*
* @description
* The function constructs a new current date using the constructor from
* the reference date. It helps to build generic functions that accept date
* extensions and use the current date.
*
* It defaults to `Date` if the passed reference date is a number or a string.
*
* @param date - The reference date to take constructor from
*
* @returns Current date initialized using the given date constructor
*
* @example
* import { constructNow, isSameDay } from 'date-fns'
*
* function isToday<DateType extends Date>(
* date: DateArg<DateType>,
* ): boolean {
* // If we were to use `new Date()` directly, the function would behave
* // differently in different timezones and return false for the same date.
* return isSameDay(date, constructNow(date));
* }
*/
function constructNow(date) {
return (0, _index.constructFrom)(date, Date.now());
}

View File

@@ -0,0 +1,21 @@
/**
* @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 CloudHail = createLucideIcon("CloudHail", [
["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
["path", { d: "M16 14v2", key: "a1is7l" }],
["path", { d: "M8 14v2", key: "1e9m6t" }],
["path", { d: "M16 20h.01", key: "xwek51" }],
["path", { d: "M8 20h.01", key: "1vjney" }],
["path", { d: "M12 16v2", key: "z66u1j" }],
["path", { d: "M12 22h.01", key: "1urd7a" }]
]);
export { CloudHail as default };
//# sourceMappingURL=cloud-hail.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/exports/i18n/is.ts"],"sourcesContent":["export { is } from '@payloadcms/translations/languages/is'\n"],"names":["is"],"mappings":"AAAA,SAASA,EAAE,QAAQ,wCAAuC"}

View File

@@ -0,0 +1,141 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)(வது)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(கி.மு.|கி.பி.)/i,
abbreviated: /^(கி\.?\s?மு\.?|கி\.?\s?பி\.?)/,
wide: /^(கிறிஸ்துவுக்கு\sமுன்|அன்னோ\sடோமினி)/i,
};
const parseEraPatterns = {
any: [/கி\.?\s?மு\.?/, /கி\.?\s?பி\.?/],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^காலா.[1234]/i,
wide: /^(ஒன்றாம்|இரண்டாம்|மூன்றாம்|நான்காம்) காலாண்டு/i,
};
const parseQuarterPatterns = {
narrow: [/1/i, /2/i, /3/i, /4/i],
any: [
/(1|காலா.1|ஒன்றாம்)/i,
/(2|காலா.2|இரண்டாம்)/i,
/(3|காலா.3|மூன்றாம்)/i,
/(4|காலா.4|நான்காம்)/i,
],
};
const matchMonthPatterns = {
narrow: /^(ஜ|பி|மா|ஏ|மே|ஜூ|ஆ|செ|அ|ந|டி)$/i,
abbreviated: /^(ஜன.|பிப்.|மார்.|ஏப்.|மே|ஜூன்|ஜூலை|ஆக.|செப்.|அக்.|நவ.|டிச.)/i,
wide: /^(ஜனவரி|பிப்ரவரி|மார்ச்|ஏப்ரல்|மே|ஜூன்|ஜூலை|ஆகஸ்ட்|செப்டம்பர்|அக்டோபர்|நவம்பர்|டிசம்பர்)/i,
};
const parseMonthPatterns = {
narrow: [
/^ஜ$/i,
/^பி/i,
/^மா/i,
/^ஏ/i,
/^மே/i,
/^ஜூ/i,
/^ஜூ/i,
/^ஆ/i,
/^செ/i,
/^அ/i,
/^ந/i,
/^டி/i,
],
any: [
/^ஜன/i,
/^பி/i,
/^மா/i,
/^ஏ/i,
/^மே/i,
/^ஜூன்/i,
/^ஜூலை/i,
/^ஆ/i,
/^செ/i,
/^அ/i,
/^ந/i,
/^டி/i,
],
};
const matchDayPatterns = {
narrow: /^(ஞா|தி|செ|பு|வி|வெ|ச)/i,
short: /^(ஞா|தி|செ|பு|வி|வெ|ச)/i,
abbreviated: /^(ஞாயி.|திங்.|செவ்.|புத.|வியா.|வெள்.|சனி)/i,
wide: /^(ஞாயிறு|திங்கள்|செவ்வாய்|புதன்|வியாழன்|வெள்ளி|சனி)/i,
};
const parseDayPatterns = {
narrow: [/^ஞா/i, /^தி/i, /^செ/i, /^பு/i, /^வி/i, /^வெ/i, /^ச/i],
any: [/^ஞா/i, /^தி/i, /^செ/i, /^பு/i, /^வி/i, /^வெ/i, /^ச/i],
};
const matchDayPeriodPatterns = {
narrow: /^(மு.ப|பி.ப|நள்|நண்|காலை|மதியம்|மாலை|இரவு)/i,
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,16 @@
import type { Data, PayloadRequest, SanitizedCollectionConfig, SanitizedDocumentPermissions, SanitizedGlobalConfig } from 'payload';
export declare const getDocumentPermissions: (args: {
collectionConfig?: SanitizedCollectionConfig;
data: Data;
globalConfig?: SanitizedGlobalConfig;
/**
* When called for creating a new document, id is not provided.
*/
id?: number | string;
req: PayloadRequest;
}) => Promise<{
docPermissions: SanitizedDocumentPermissions;
hasPublishPermission: boolean;
hasSavePermission: boolean;
}>;
//# sourceMappingURL=getDocumentPermissions.d.ts.map

View File

@@ -0,0 +1,28 @@
import type { Maybe } from '../jsutils/Maybe';
import type { ValueNode } from '../language/ast';
import type { GraphQLInputType } from '../type/definition';
/**
* Produces a GraphQL Value AST given a JavaScript object.
* Function will match JavaScript/JSON values to GraphQL AST schema format
* by using suggested GraphQLInputType. For example:
*
* astFromValue("value", GraphQLString)
*
* A GraphQL type must be provided, which will be used to interpret different
* JavaScript values.
*
* | JSON Value | GraphQL Value |
* | ------------- | -------------------- |
* | Object | Input Object |
* | Array | List |
* | Boolean | Boolean |
* | String | String / Enum Value |
* | Number | Int / Float |
* | Unknown | Enum Value |
* | null | NullValue |
*
*/
export declare function astFromValue(
value: unknown,
type: GraphQLInputType,
): Maybe<ValueNode>;

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const AlignCenter = createLucideIcon("AlignCenter", [
["line", { x1: "21", x2: "3", y1: "6", y2: "6", key: "1fp77t" }],
["line", { x1: "17", x2: "7", y1: "12", y2: "12", key: "rsh8ii" }],
["line", { x1: "19", x2: "5", y1: "18", y2: "18", key: "1t0tuv" }]
]);
export { AlignCenter as default };
//# sourceMappingURL=align-center.js.map

View File

@@ -0,0 +1,88 @@
import { isValid } from "./isValid.mjs";
import { toDate } from "./toDate.mjs";
import { addLeadingZeros } from "./_lib/addLeadingZeros.mjs";
/**
* The {@link formatISO9075} function options.
*/
/**
* @name formatISO9075
* @category Common Helpers
* @summary Format the date according to the ISO 9075 standard (https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_get-format).
*
* @description
* Return the formatted date string in ISO 9075 format. Options may be passed to control the parts and notations of the date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
* @param options - An object with options.
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 18 September 2019 in ISO 9075 format:
* const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52))
* //=> '2019-09-18 19:00:52'
*
* @example
* // Represent 18 September 2019 in ISO 9075, short format:
* const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })
* //=> '20190918 190052'
*
* @example
* // Represent 18 September 2019 in ISO 9075 format, date only:
* const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })
* //=> '2019-09-18'
*
* @example
* // Represent 18 September 2019 in ISO 9075 format, time only:
* const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })
* //=> '19:00:52'
*/
export function formatISO9075(date, options) {
const _date = toDate(date);
if (!isValid(_date)) {
throw new RangeError("Invalid time value");
}
const format = options?.format ?? "extended";
const representation = options?.representation ?? "complete";
let result = "";
const dateDelimiter = format === "extended" ? "-" : "";
const timeDelimiter = format === "extended" ? ":" : "";
// Representation is either 'date' or 'complete'
if (representation !== "time") {
const day = addLeadingZeros(_date.getDate(), 2);
const month = addLeadingZeros(_date.getMonth() + 1, 2);
const year = addLeadingZeros(_date.getFullYear(), 4);
// yyyyMMdd or yyyy-MM-dd.
result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`;
}
// Representation is either 'time' or 'complete'
if (representation !== "date") {
const hour = addLeadingZeros(_date.getHours(), 2);
const minute = addLeadingZeros(_date.getMinutes(), 2);
const second = addLeadingZeros(_date.getSeconds(), 2);
// If there's also date, separate it with time with a space
const separator = result === "" ? "" : " ";
// HHmmss or HH:mm:ss.
result = `${result}${separator}${hour}${timeDelimiter}${minute}${timeDelimiter}${second}`;
}
return result;
}
// Fallback for modularized imports:
export default formatISO9075;

View File

@@ -0,0 +1,148 @@
import fetchJwks from '../runtime/fetch_jwks.js';
import { JWKSNoMatchingKey } from '../util/errors.js';
import { createLocalJWKSet } from './local.js';
import isObject from '../lib/is_object.js';
function isCloudflareWorkers() {
return (typeof WebSocketPair !== 'undefined' ||
(typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers') ||
(typeof EdgeRuntime !== 'undefined' && EdgeRuntime === 'vercel'));
}
let USER_AGENT;
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
const NAME = 'jose';
const VERSION = 'v5.9.6';
USER_AGENT = `${NAME}/${VERSION}`;
}
export const jwksCache = Symbol();
function isFreshJwksCache(input, cacheMaxAge) {
if (typeof input !== 'object' || input === null) {
return false;
}
if (!('uat' in input) || typeof input.uat !== 'number' || Date.now() - input.uat >= cacheMaxAge) {
return false;
}
if (!('jwks' in input) ||
!isObject(input.jwks) ||
!Array.isArray(input.jwks.keys) ||
!Array.prototype.every.call(input.jwks.keys, isObject)) {
return false;
}
return true;
}
class RemoteJWKSet {
_url;
_timeoutDuration;
_cooldownDuration;
_cacheMaxAge;
_jwksTimestamp;
_pendingFetch;
_options;
_local;
_cache;
constructor(url, options) {
if (!(url instanceof URL)) {
throw new TypeError('url must be an instance of URL');
}
this._url = new URL(url.href);
this._options = { agent: options?.agent, headers: options?.headers };
this._timeoutDuration =
typeof options?.timeoutDuration === 'number' ? options?.timeoutDuration : 5000;
this._cooldownDuration =
typeof options?.cooldownDuration === 'number' ? options?.cooldownDuration : 30000;
this._cacheMaxAge = typeof options?.cacheMaxAge === 'number' ? options?.cacheMaxAge : 600000;
if (options?.[jwksCache] !== undefined) {
this._cache = options?.[jwksCache];
if (isFreshJwksCache(options?.[jwksCache], this._cacheMaxAge)) {
this._jwksTimestamp = this._cache.uat;
this._local = createLocalJWKSet(this._cache.jwks);
}
}
}
coolingDown() {
return typeof this._jwksTimestamp === 'number'
? Date.now() < this._jwksTimestamp + this._cooldownDuration
: false;
}
fresh() {
return typeof this._jwksTimestamp === 'number'
? Date.now() < this._jwksTimestamp + this._cacheMaxAge
: false;
}
async getKey(protectedHeader, token) {
if (!this._local || !this.fresh()) {
await this.reload();
}
try {
return await this._local(protectedHeader, token);
}
catch (err) {
if (err instanceof JWKSNoMatchingKey) {
if (this.coolingDown() === false) {
await this.reload();
return this._local(protectedHeader, token);
}
}
throw err;
}
}
async reload() {
if (this._pendingFetch && isCloudflareWorkers()) {
this._pendingFetch = undefined;
}
const headers = new Headers(this._options.headers);
if (USER_AGENT && !headers.has('User-Agent')) {
headers.set('User-Agent', USER_AGENT);
this._options.headers = Object.fromEntries(headers.entries());
}
this._pendingFetch ||= fetchJwks(this._url, this._timeoutDuration, this._options)
.then((json) => {
this._local = createLocalJWKSet(json);
if (this._cache) {
this._cache.uat = Date.now();
this._cache.jwks = json;
}
this._jwksTimestamp = Date.now();
this._pendingFetch = undefined;
})
.catch((err) => {
this._pendingFetch = undefined;
throw err;
});
await this._pendingFetch;
}
}
export function createRemoteJWKSet(url, options) {
const set = new RemoteJWKSet(url, options);
const remoteJWKSet = async (protectedHeader, token) => set.getKey(protectedHeader, token);
Object.defineProperties(remoteJWKSet, {
coolingDown: {
get: () => set.coolingDown(),
enumerable: true,
configurable: false,
},
fresh: {
get: () => set.fresh(),
enumerable: true,
configurable: false,
},
reload: {
value: () => set.reload(),
enumerable: true,
configurable: false,
writable: false,
},
reloading: {
get: () => !!set._pendingFetch,
enumerable: true,
configurable: false,
},
jwks: {
value: () => set._local?.jwks(),
enumerable: true,
configurable: false,
writable: false,
},
});
return remoteJWKSet;
}
export const experimental_jwksCache = jwksCache;

View File

@@ -0,0 +1 @@
{"version":3,"names":["inherit","key","child","parent","Array","from","Set","concat","filter","Boolean"],"sources":["../../src/utils/inherit.ts"],"sourcesContent":["import type * as t from \"../index.ts\";\n\nexport default function inherit<\n C extends t.Node | undefined,\n P extends t.Node | undefined,\n>(key: keyof C & keyof P, child: C, parent: P): void {\n if (child && parent) {\n // @ts-expect-error Could further refine key definitions\n child[key] = Array.from(\n new Set([].concat(child[key], parent[key]).filter(Boolean)),\n );\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,OAAOA,CAG7BC,GAAsB,EAAEC,KAAQ,EAAEC,MAAS,EAAQ;EACnD,IAAID,KAAK,IAAIC,MAAM,EAAE;IAEnBD,KAAK,CAACD,GAAG,CAAC,GAAGG,KAAK,CAACC,IAAI,CACrB,IAAIC,GAAG,CAAC,EAAE,CAACC,MAAM,CAACL,KAAK,CAACD,GAAG,CAAC,EAAEE,MAAM,CAACF,GAAG,CAAC,CAAC,CAACO,MAAM,CAACC,OAAO,CAAC,CAC5D,CAAC;EACH;AACF","ignoreList":[]}

View File

@@ -0,0 +1,14 @@
import type { Match } from "../../../locale/types.js";
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult } from "../types.js";
export declare class StandAloneQuarterParser extends Parser<number> {
priority: number;
parse(dateString: string, token: string, match: Match): ParseResult<number>;
validate<DateType extends Date>(_date: DateType, value: number): boolean;
set<DateType extends Date>(
date: DateType,
_flags: ParseFlags,
value: number,
): DateType;
incompatibleTokens: string[];
}

View File

@@ -0,0 +1,71 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
const minTwo = z.string().array().min(2);
const maxTwo = z.string().array().max(2);
const justTwo = z.string().array().length(2);
const intNum = z.string().array().nonempty();
const nonEmptyMax = z.string().array().nonempty().max(2);
type t1 = z.infer<typeof nonEmptyMax>;
util.assertEqual<[string, ...string[]], t1>(true);
type t2 = z.infer<typeof minTwo>;
util.assertEqual<string[], t2>(true);
test("passing validations", () => {
minTwo.parse(["a", "a"]);
minTwo.parse(["a", "a", "a"]);
maxTwo.parse(["a", "a"]);
maxTwo.parse(["a"]);
justTwo.parse(["a", "a"]);
intNum.parse(["a"]);
nonEmptyMax.parse(["a"]);
});
test("failing validations", () => {
expect(() => minTwo.parse(["a"])).toThrow();
expect(() => maxTwo.parse(["a", "a", "a"])).toThrow();
expect(() => justTwo.parse(["a"])).toThrow();
expect(() => justTwo.parse(["a", "a", "a"])).toThrow();
expect(() => intNum.parse([])).toThrow();
expect(() => nonEmptyMax.parse([])).toThrow();
expect(() => nonEmptyMax.parse(["a", "a", "a"])).toThrow();
});
test("parse empty array in nonempty", () => {
expect(() =>
z
.array(z.string())
.nonempty()
.parse([] as any)
).toThrow();
});
test("get element", () => {
justTwo.element.parse("asdf");
expect(() => justTwo.element.parse(12)).toThrow();
});
test("continue parsing despite array size error", () => {
const schema = z.object({
people: z.string().array().min(2),
});
const result = schema.safeParse({
people: [123],
});
expect(result.success).toEqual(false);
if (!result.success) {
expect(result.error.issues.length).toEqual(2);
}
});
test("parse should fail given sparse array", () => {
const schema = z.array(z.string()).nonempty().min(1).max(3);
expect(() => schema.parse(new Array(3))).toThrow();
});

View File

@@ -0,0 +1,93 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Dependency = require("../Dependency");
const makeSerializable = require("../util/makeSerializable");
const ModuleDependency = require("./ModuleDependency");
/** @typedef {import("../Dependency").ReferencedExports} ReferencedExports */
/** @typedef {import("../Dependency").TRANSITIVE} TRANSITIVE */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {import("../util/runtime").RuntimeSpec} RuntimeSpec */
class WebAssemblyExportImportedDependency extends ModuleDependency {
/**
* @param {string} exportName export name
* @param {string} request request
* @param {string} name name
* @param {string} valueType value type
*/
constructor(exportName, request, name, valueType) {
super(request);
/** @type {string} */
this.exportName = exportName;
/** @type {string} */
this.name = name;
/** @type {string} */
this.valueType = valueType;
}
/**
* @returns {boolean | TRANSITIVE} true, when changes to the referenced module could affect the referencing module; TRANSITIVE, when changes to the referenced module could affect referencing modules of the referencing module
*/
couldAffectReferencingModule() {
return Dependency.TRANSITIVE;
}
/**
* Returns list of exports referenced by this dependency
* @param {ModuleGraph} moduleGraph module graph
* @param {RuntimeSpec} runtime the runtime for which the module is analysed
* @returns {ReferencedExports} referenced exports
*/
getReferencedExports(moduleGraph, runtime) {
return [[this.name]];
}
get type() {
return "wasm export import";
}
get category() {
return "wasm";
}
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
const { write } = context;
write(this.exportName);
write(this.name);
write(this.valueType);
super.serialize(context);
}
/**
* @param {ObjectDeserializerContext} context context
*/
deserialize(context) {
const { read } = context;
this.exportName = read();
this.name = read();
this.valueType = read();
super.deserialize(context);
}
}
makeSerializable(
WebAssemblyExportImportedDependency,
"webpack/lib/dependencies/WebAssemblyExportImportedDependency"
);
module.exports = WebAssemblyExportImportedDependency;

View File

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

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