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,2 @@
import { isArrayLike } from "../fp";
export = isArrayLike;

View File

@@ -0,0 +1,67 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = exports.onceSupported = exports.optionsSupported = void 0;
var _canUseDOM = _interopRequireDefault(require("./canUseDOM"));
/* eslint-disable no-return-assign */
var optionsSupported = false;
exports.optionsSupported = optionsSupported;
var onceSupported = false;
exports.onceSupported = onceSupported;
try {
var options = {
get passive() {
return exports.optionsSupported = optionsSupported = true;
},
get once() {
// eslint-disable-next-line no-multi-assign
return exports.onceSupported = onceSupported = exports.optionsSupported = optionsSupported = true;
}
};
if (_canUseDOM.default) {
window.addEventListener('test', options, options);
window.removeEventListener('test', options, true);
}
} catch (e) {
/* */
}
/**
* An `addEventListener` ponyfill, supports the `once` option
*
* @param node the element
* @param eventName the event name
* @param handle the handler
* @param options event options
*/
function addEventListener(node, eventName, handler, options) {
if (options && typeof options !== 'boolean' && !onceSupported) {
var once = options.once,
capture = options.capture;
var wrappedHandler = handler;
if (!onceSupported && once) {
wrappedHandler = handler.__once || function onceHandler(event) {
this.removeEventListener(eventName, onceHandler, capture);
handler.call(this, event);
};
handler.__once = wrappedHandler;
}
node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);
}
node.addEventListener(eventName, handler, options);
}
var _default = addEventListener;
exports.default = _default;

View File

@@ -0,0 +1,4 @@
export declare const endOfQuarter: import("./types.js").FPFn1<
Date,
string | number | Date
>;

View File

@@ -0,0 +1,361 @@
'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { formatAdminURL } from 'payload/shared';
import * as qs from 'qs-esm';
import React, { createContext, use, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useControllableState } from '../../hooks/useControllableState.js';
import { useAuth } from '../../providers/Auth/index.js';
import { requests } from '../../utilities/api.js';
import { formatDocTitle } from '../../utilities/formatDocTitle/index.js';
import { useConfig } from '../Config/index.js';
import { DocumentTitleProvider } from '../DocumentTitle/index.js';
import { useLocale, useLocaleLoading } from '../Locale/index.js';
import { usePreferences } from '../Preferences/index.js';
import { useTranslation } from '../Translation/index.js';
import { UploadEditsProvider, useUploadEdits } from '../UploadEdits/index.js';
import { useGetDocPermissions } from './useGetDocPermissions.js';
const Context = /*#__PURE__*/createContext({});
export const useDocumentInfo = () => use(Context);
const DocumentInfo = ({
children,
...props
}) => {
const {
id,
collectionSlug,
currentEditor: currentEditorFromProps,
docPermissions: docPermissionsFromProps,
globalSlug,
hasPublishedDoc: hasPublishedDocFromProps,
hasPublishPermission: hasPublishPermissionFromProps,
hasSavePermission: hasSavePermissionFromProps,
initialData,
initialState,
isLocked: isLockedFromProps,
lastUpdateTime: lastUpdateTimeFromProps,
mostRecentVersionIsAutosaved: mostRecentVersionIsAutosavedFromProps,
unpublishedVersionCount: unpublishedVersionCountFromProps,
versionCount: versionCountFromProps
} = props;
const [docPermissions, setDocPermissions] = useControllableState(docPermissionsFromProps);
const [hasSavePermission, setHasSavePermission] = useControllableState(hasSavePermissionFromProps);
const [hasPublishPermission, setHasPublishPermission] = useControllableState(hasPublishPermissionFromProps);
const {
permissions
} = useAuth();
const {
config: {
admin: {
dateFormat
},
collections,
routes: {
api
}
},
getEntityConfig
} = useConfig();
const collectionConfig = getEntityConfig({
collectionSlug
});
const globalConfig = getEntityConfig({
globalSlug
});
// Check if the locked-documents collection exists in the config
const hasLockedDocumentsCollection = collections.some(collection => collection.slug === 'payload-locked-documents');
const abortControllerRef = useRef(new AbortController());
const docConfig = collectionConfig || globalConfig;
const {
i18n
} = useTranslation();
const {
uploadEdits
} = useUploadEdits();
/**
* @deprecated This state will be removed in v4.
* This is for performance reasons. Use the `DocumentTitleContext` instead.
*/
const [title, setDocumentTitle] = useState(() => formatDocTitle({
collectionConfig,
data: {
...(initialData || {}),
id
},
dateFormat,
fallback: id?.toString(),
globalConfig,
i18n
}));
const [mostRecentVersionIsAutosaved, setMostRecentVersionIsAutosaved] = useState(mostRecentVersionIsAutosavedFromProps);
const [versionCount, setVersionCount] = useState(versionCountFromProps);
const [hasPublishedDoc, setHasPublishedDoc] = useState(hasPublishedDocFromProps);
const [unpublishedVersionCount, setUnpublishedVersionCount] = useState(unpublishedVersionCountFromProps);
const [documentIsLocked, setDocumentIsLocked] = useControllableState(isLockedFromProps);
const [currentEditor, setCurrentEditor] = useControllableState(currentEditorFromProps);
const [lastUpdateTime, setLastUpdateTime] = useControllableState(lastUpdateTimeFromProps);
const [data, setData] = useControllableState(initialData);
const [uploadStatus, setUploadStatus] = useControllableState('idle');
const documentLockState = useRef({
hasShownLockedModal: false,
isLocked: false,
user: null
});
const updateUploadStatus = useCallback(status => {
setUploadStatus(status);
}, [setUploadStatus]);
const {
getPreference,
setPreference
} = usePreferences();
const {
code: locale
} = useLocale();
const {
localeIsLoading
} = useLocaleLoading();
const isInitializing = useMemo(() => initialState === undefined || initialData === undefined || localeIsLoading, [initialData, initialState, localeIsLoading]);
const baseAPIPath = formatAdminURL({
apiRoute: api,
path: ''
});
let slug;
let pluralType;
let preferencesKey;
if (globalSlug) {
slug = globalSlug;
pluralType = 'globals';
preferencesKey = `global-${slug}`;
}
if (collectionSlug) {
slug = collectionSlug;
pluralType = 'collections';
if (id) {
preferencesKey = `collection-${slug}-${id}`;
}
}
const unlockDocument = useCallback(async (docID, slug_0) => {
// Check if the locked-documents collection exists before making API calls
if (!hasLockedDocumentsCollection) {
return;
}
try {
const isGlobal = slug_0 === globalSlug;
const request = await requests.get(`${baseAPIPath}/payload-locked-documents`, {
credentials: 'include',
params: isGlobal ? {
'where[globalSlug][equals]': slug_0
} : {
'where[document.relationTo][equals]': slug_0,
'where[document.value][equals]': docID
}
});
const {
docs
} = await request.json();
if (docs?.length > 0) {
const lockID = docs[0].id;
await requests.delete(`${baseAPIPath}/payload-locked-documents/${lockID}`, {
credentials: 'include',
headers: {
'Content-Type': 'application/json'
}
});
setDocumentIsLocked(false);
}
} catch (error) {
// eslint-disable-next-line no-console
console.error('Failed to unlock the document', error);
}
}, [baseAPIPath, globalSlug, setDocumentIsLocked, hasLockedDocumentsCollection]);
const updateDocumentEditor = useCallback(async (docID_0, slug_1, user) => {
// Check if the locked-documents collection exists before making API calls
if (!hasLockedDocumentsCollection) {
return;
}
try {
const isGlobal_0 = slug_1 === globalSlug;
// Check if the document is already locked
const request_0 = await requests.get(`${baseAPIPath}/payload-locked-documents`, {
credentials: 'include',
params: isGlobal_0 ? {
'where[globalSlug][equals]': slug_1
} : {
'where[document.relationTo][equals]': slug_1,
'where[document.value][equals]': docID_0
}
});
const {
docs: docs_0
} = await request_0.json();
if (docs_0?.length > 0) {
const lockID_0 = docs_0[0].id;
const userData = typeof user === 'object' ? {
relationTo: user.collection,
value: user.id
} : {
relationTo: 'users',
value: user
};
// Send a patch request to update the _lastEdited info
await requests.patch(`${baseAPIPath}/payload-locked-documents/${lockID_0}`, {
body: JSON.stringify({
user: userData
}),
credentials: 'include',
headers: {
'Content-Type': 'application/json'
}
});
}
} catch (error_0) {
// eslint-disable-next-line no-console
console.error('Failed to update the document editor', error_0);
}
}, [baseAPIPath, globalSlug, hasLockedDocumentsCollection]);
const getDocPermissions = useGetDocPermissions({
id: id,
api,
collectionSlug,
globalSlug,
i18n,
locale,
permissions,
setDocPermissions,
setHasPublishPermission,
setHasSavePermission
});
const getDocPreferences = useCallback(() => {
return getPreference(preferencesKey);
}, [getPreference, preferencesKey]);
const setDocFieldPreferences = useCallback(async (path, fieldPreferences) => {
const allPreferences = await getDocPreferences();
if (preferencesKey) {
try {
await setPreference(preferencesKey, {
...allPreferences,
fields: {
...(allPreferences?.fields || {}),
[path]: {
...allPreferences?.fields?.[path],
...fieldPreferences
}
}
});
} catch (e) {
console.error(e); // eslint-disable-line no-console
}
}
}, [setPreference, preferencesKey, getDocPreferences]);
const incrementVersionCount = useCallback(() => {
const newCount = versionCount + 1;
if (collectionConfig && collectionConfig.versions) {
if (collectionConfig.versions.maxPerDoc > 0) {
setVersionCount(Math.min(newCount, collectionConfig.versions.maxPerDoc));
} else {
setVersionCount(newCount);
}
} else if (globalConfig && globalConfig.versions) {
if (globalConfig.versions.max > 0) {
setVersionCount(Math.min(newCount, globalConfig.versions.max));
} else {
setVersionCount(newCount);
}
}
}, [collectionConfig, globalConfig, versionCount]);
/**
* @todo: Remove this in v4
* Users should use the `DocumentTitleContext` instead.
*/
useEffect(() => {
setDocumentTitle(formatDocTitle({
collectionConfig,
data: {
...data,
id
},
dateFormat,
fallback: id?.toString(),
globalConfig,
i18n
}));
}, [collectionConfig, globalConfig, data, dateFormat, i18n, id]);
// clean on unmount
useEffect(() => {
const re1 = abortControllerRef.current;
return () => {
if (re1) {
try {
re1.abort();
} catch (_err) {
// swallow error
}
}
};
}, []);
const action = React.useMemo(() => {
const docPath = `${pluralType === 'globals' ? `/globals` : ''}/${slug}${id ? `/${id}` : ''}`;
return `${baseAPIPath}${docPath}${qs.stringify({
depth: 0,
'fallback-locale': 'null',
locale,
uploadEdits: uploadEdits || undefined
}, {
addQueryPrefix: true
})}`;
}, [baseAPIPath, locale, pluralType, id, slug, uploadEdits]);
const value = {
...props,
action,
currentEditor,
data,
docConfig,
docPermissions,
documentIsLocked,
documentLockState,
getDocPermissions,
getDocPreferences,
hasPublishedDoc,
hasPublishPermission,
hasSavePermission,
incrementVersionCount,
initialData,
initialState,
isInitializing,
lastUpdateTime,
mostRecentVersionIsAutosaved,
preferencesKey,
savedDocumentData: data,
setCurrentEditor,
setData,
setDocFieldPreferences,
setDocumentIsLocked,
setDocumentTitle,
setHasPublishedDoc,
setLastUpdateTime,
setMostRecentVersionIsAutosaved,
setUnpublishedVersionCount,
setUploadStatus: updateUploadStatus,
title,
unlockDocument,
unpublishedVersionCount,
updateDocumentEditor,
updateSavedDocumentData: setData,
uploadStatus,
versionCount
};
return /*#__PURE__*/_jsx(Context, {
value: value,
children: /*#__PURE__*/_jsx(DocumentTitleProvider, {
children: children
})
});
};
export const DocumentInfoProvider = props => {
return /*#__PURE__*/_jsx(UploadEditsProvider, {
children: /*#__PURE__*/_jsx(DocumentInfo, {
...props
})
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,6 @@
/**
* Re-export the core GrowthBook integration for Node.js usage.
* The core integration is runtime-agnostic and works in both browser and Node environments.
*/
export declare const growthbookIntegrationShim: import("@sentry/core").IntegrationFn;
//# sourceMappingURL=growthbook.d.ts.map

View File

@@ -0,0 +1,17 @@
export function toObjMap(obj) {
if (obj == null) {
return Object.create(null);
}
if (Object.getPrototypeOf(obj) === null) {
return obj;
}
const map = Object.create(null);
for (const [key, value] of Object.entries(obj)) {
map[key] = value;
}
return map;
}

View File

@@ -0,0 +1 @@
module.exports={A:{D:{"1":"0 1 2 3 4 5 6 7 8 vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB"},L:{"1":"I"},B:{"1":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"0C VC J bB K D E F A B C L M G N 4C 5C","33":"9 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"},M:{"1":"OC"},A:{"2":"K D E F A B zC"},F:{"1":"0 1 2 3 4 5 6 7 8 iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB JD KD LD MD PC xC ND QC"},K:{"1":"H","2":"A B C PC xC QC"},E:{"1":"B C L M G 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","2":"J bB K 6C bC 7C 8C ID","33":"D E F A 9C AD cC"},G:{"1":"XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"bC OD yC PD QD","33":"E RD SD TD UD VD WD"},P:{"1":"9 AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"}},B:6,C:"isolate-override from unicode-bidi",D:undefined};

View File

@@ -0,0 +1,16 @@
export declare const eachHourOfIntervalWithOptions: import("./types.js").FPFn2<
import("../eachHourOfInterval.js").EachHourOfIntervalResult<
import("../fp.js").Interval<
import("../fp.js").DateArg<Date>,
import("../fp.js").DateArg<Date>
>,
| import("../eachHourOfInterval.js").EachHourOfIntervalOptions<Date>
| undefined
>,
| import("../eachHourOfInterval.js").EachHourOfIntervalOptions<Date>
| undefined,
import("../fp.js").Interval<
import("../fp.js").DateArg<Date>,
import("../fp.js").DateArg<Date>
>
>;

View File

@@ -0,0 +1,46 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const integration = require('../../integration.js');
const featureFlags = require('../../utils/featureFlags.js');
/**
* Sentry integration for buffering feature flag evaluations manually with an API, and
* capturing them on error events and spans.
*
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
*
* @example
* ```
* import * as Sentry from '@sentry/browser';
* import { type FeatureFlagsIntegration } from '@sentry/browser';
*
* // Setup
* Sentry.init(..., integrations: [Sentry.featureFlagsIntegration()])
*
* // Verify
* const flagsIntegration = Sentry.getClient()?.getIntegrationByName<FeatureFlagsIntegration>('FeatureFlags');
* if (flagsIntegration) {
* flagsIntegration.addFeatureFlag('my-flag', true);
* } else {
* // check your setup
* }
* Sentry.captureException(Exception('broke')); // 'my-flag' should be captured to this Sentry event.
* ```
*/
const featureFlagsIntegration = integration.defineIntegration(() => {
return {
name: 'FeatureFlags',
processEvent(event, _hint, _client) {
return featureFlags._INTERNAL_copyFlagsFromScopeToEvent(event);
},
addFeatureFlag(name, value) {
featureFlags._INTERNAL_insertFlagToScope(name, value);
featureFlags._INTERNAL_addFeatureFlagToActiveSpan(name, value);
},
};
}) ;
exports.featureFlagsIntegration = featureFlagsIntegration;
//# sourceMappingURL=featureFlagsIntegration.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"merge.js","sources":["../../../src/utils/merge.ts"],"sourcesContent":["/**\n * Shallow merge two objects.\n * Does not mutate the passed in objects.\n * Undefined/empty values in the merge object will overwrite existing values.\n *\n * By default, this merges 2 levels deep.\n */\nexport function merge<T>(initialObj: T, mergeObj: T, levels = 2): T {\n // If the merge value is not an object, or we have no merge levels left,\n // we just set the value to the merge value\n if (!mergeObj || typeof mergeObj !== 'object' || levels <= 0) {\n return mergeObj;\n }\n\n // If the merge object is an empty object, and the initial object is not undefined, we return the initial object\n if (initialObj && Object.keys(mergeObj).length === 0) {\n return initialObj;\n }\n\n // Clone object\n const output = { ...initialObj };\n\n // Merge values into output, resursively\n for (const key in mergeObj) {\n if (Object.prototype.hasOwnProperty.call(mergeObj, key)) {\n output[key] = merge(output[key], mergeObj[key], levels - 1);\n }\n }\n\n return output;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAI,UAAU,EAAK,QAAQ,EAAK,MAAA,GAAS,CAAC,EAAK;AACpE;AACA;AACA,EAAE,IAAI,CAAC,QAAA,IAAY,OAAO,QAAA,KAAa,QAAA,IAAY,MAAA,IAAU,CAAC,EAAE;AAChE,IAAI,OAAO,QAAQ;AACnB,EAAE;;AAEF;AACA,EAAE,IAAI,UAAA,IAAc,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAA,KAAW,CAAC,EAAE;AACxD,IAAI,OAAO,UAAU;AACrB,EAAE;;AAEF;AACA,EAAE,MAAM,MAAA,GAAS,EAAE,GAAG,YAAY;;AAElC;AACA,EAAE,KAAK,MAAM,GAAA,IAAO,QAAQ,EAAE;AAC9B,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE;AAC7D,MAAM,MAAM,CAAC,GAAG,CAAA,GAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAA,GAAS,CAAC,CAAC;AACjE,IAAI;AACJ,EAAE;;AAEF,EAAE,OAAO,MAAM;AACf;;;;"}

View File

@@ -0,0 +1,9 @@
/**
* The name of the runtime of this process.
*
* @example OpenJDK Runtime Environment
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*/
export declare const ATTR_PROCESS_RUNTIME_NAME: "process.runtime.name";
//# sourceMappingURL=semconv.d.ts.map

View File

@@ -0,0 +1,43 @@
name: Publish release
on:
workflow_dispatch:
inputs:
version:
description: 'The version number to tag and release'
required: true
type: string
prerelease:
description: 'Release as pre-release'
required: false
type: boolean
default: false
jobs:
release-npm:
runs-on: ubuntu-latest
environment: main
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- run: npm install npm -g
- run: npm install
- name: Change version number and sync
run: |
node build/sync-version.js ${{ inputs.version }}
- name: GIT commit and push all changed files
run: |
git config --global user.name "mcollina"
git config --global user.email "hello@matteocollina.com"
git commit -n -a -m "Bumped v${{ inputs.version }}"
git push origin HEAD:${{ github.ref }}
- run: npm publish --access public --tag ${{ inputs.prerelease == true && 'next' || 'latest' }}
- name: 'Create release notes'
run: |
npx @matteo.collina/release-notes -a ${{ secrets.GITHUB_TOKEN }} -t v${{ inputs.version }} -r pino -o pinojs ${{ github.event.inputs.prerelease == 'true' && '-p' || '' }} -c ${{ github.ref }}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Slug/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,KAAgC,MAAM,OAAO,CAAA;AAUpD,OAAO,cAAc,CAAA;AAErB;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+EpD,CAAA"}

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDebugging = void 0;
var elementDebuggerAttribute = 'data-html2canvas-debug';
var getElementDebugType = function (element) {
var attribute = element.getAttribute(elementDebuggerAttribute);
switch (attribute) {
case 'all':
return 1 /* ALL */;
case 'clone':
return 2 /* CLONE */;
case 'parse':
return 3 /* PARSE */;
case 'render':
return 4 /* RENDER */;
default:
return 0 /* NONE */;
}
};
var isDebugging = function (element, type) {
var elementType = getElementDebugType(element);
return elementType === 1 /* ALL */ || type === elementType;
};
exports.isDebugging = isDebugging;
//# sourceMappingURL=debugger.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getActiveSpan.d.ts","sourceRoot":"","sources":["../../../src/utils/getActiveSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG/C;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,GAAG,SAAS,CAEhD"}

View File

@@ -0,0 +1,33 @@
var baseIteratee = require('./_baseIteratee'),
baseSortedIndexBy = require('./_baseSortedIndexBy');
/**
* This method is like `_.sortedLastIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* var objects = [{ 'x': 4 }, { 'x': 5 }];
*
* _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
* // => 1
*
* // The `_.property` iteratee shorthand.
* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
* // => 1
*/
function sortedLastIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2), true);
}
module.exports = sortedLastIndexBy;

View File

@@ -0,0 +1,34 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link previousThursday} function options.
*/
export interface PreviousThursdayOptions<DateType extends Date = Date>
extends ContextOptions<DateType> {}
/**
* @name previousThursday
* @category Weekday Helpers
* @summary When is the previous Thursday?
*
* @description
* When is the previous Thursday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to start counting from
* @param options - An object with options
*
* @returns The previous Thursday
*
* @example
* // When is the previous Thursday before Jun, 18, 2021?
* const result = previousThursday(new Date(2021, 5, 18))
* //=> Thu June 17 2021 00:00:00
*/
export declare function previousThursday<
DateType extends Date,
ResultDate extends Date = DateType,
>(
date: DateArg<DateType>,
options?: PreviousThursdayOptions<ResultDate> | undefined,
): ResultDate;

View File

@@ -0,0 +1,183 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["前", "公元"],
abbreviated: ["前", "公元"],
wide: ["公元前", "公元"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["第一刻", "第二刻", "第三刻", "第四刻"],
wide: ["第一刻鐘", "第二刻鐘", "第三刻鐘", "第四刻鐘"],
};
const monthValues = {
narrow: [
"一",
"二",
"三",
"四",
"五",
"六",
"七",
"八",
"九",
"十",
"十一",
"十二",
],
abbreviated: [
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月",
],
wide: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
};
const dayValues = {
narrow: ["日", "一", "二", "三", "四", "五", "六"],
short: ["日", "一", "二", "三", "四", "五", "六"],
abbreviated: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"],
wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
};
const dayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
switch (options?.unit) {
case "date":
return number + "日";
case "hour":
return number + "時";
case "minute":
return number + "分";
case "second":
return number + "秒";
default:
return "第 " + number;
}
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,37 @@
import type { CompiledGraph, LangGraphOptions } from './types';
/**
* Instruments StateGraph's compile method to create spans for agent creation and invocation
*
* Wraps the compile() method to:
* - Create a `gen_ai.create_agent` span when compile() is called
* - Automatically wrap the invoke() method on the returned compiled graph with a `gen_ai.invoke_agent` span
*
*/
export declare function instrumentStateGraphCompile(originalCompile: (...args: unknown[]) => CompiledGraph, options: LangGraphOptions): (...args: unknown[]) => CompiledGraph;
/**
* Directly instruments a StateGraph instance to add tracing spans
*
* This function can be used to manually instrument LangGraph StateGraph instances
* in environments where automatic instrumentation is not available or desired.
*
* @param stateGraph - The StateGraph instance to instrument
* @param options - Optional configuration for recording inputs/outputs
*
* @example
* ```typescript
* import { instrumentLangGraph } from '@sentry/cloudflare';
* import { StateGraph } from '@langchain/langgraph';
*
* const graph = new StateGraph(MessagesAnnotation)
* .addNode('agent', mockLlm)
* .addEdge(START, 'agent')
* .addEdge('agent', END);
*
* instrumentLangGraph(graph, { recordInputs: true, recordOutputs: true });
* const compiled = graph.compile({ name: 'my_agent' });
* ```
*/
export declare function instrumentLangGraph<T extends {
compile: (...args: any[]) => any;
}>(stateGraph: T, options?: LangGraphOptions): T;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,30 @@
"use strict";
exports.monthsToQuarters = monthsToQuarters;
var _index = require("./constants.js");
/**
* @name monthsToQuarters
* @category Conversion Helpers
* @summary Convert number of months to quarters.
*
* @description
* Convert a number of months to a full number of quarters.
*
* @param months - The number of months to be converted.
*
* @returns The number of months converted in quarters
*
* @example
* // Convert 6 months to quarters:
* const result = monthsToQuarters(6)
* //=> 2
*
* @example
* // It uses floor rounding:
* const result = monthsToQuarters(7)
* //=> 2
*/
function monthsToQuarters(months) {
const quarters = months / _index.monthsInQuarter;
return Math.trunc(quarters);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/WindowInfo/index.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAQ,kBAAkB,iHAGa,CAAA;AACvC,QAAA,MAAQ,aAAa,gGAGa,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAA"}

View File

@@ -0,0 +1,35 @@
'use strict';
// This is an example of using tokens to add a custom behaviour.
//
// Require the use of `=` for long options and values by blocking
// the use of space separated values.
// So allow `--foo=bar`, and not allow `--foo bar`.
//
// Note: this is not a common behaviour, most CLIs allow both forms.
// 1. const { parseArgs } = require('node:util'); // from node
// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package
const { parseArgs } = require('..'); // in repo
const options = {
file: { short: 'f', type: 'string' },
log: { type: 'string' },
};
const { values, tokens } = parseArgs({ options, tokens: true });
const badToken = tokens.find((token) => token.kind === 'option' &&
token.value != null &&
token.rawName.startsWith('--') &&
!token.inlineValue
);
if (badToken) {
throw new Error(`Option value for '${badToken.rawName}' must be inline, like '${badToken.rawName}=VALUE'`);
}
console.log(values);
// Try the following:
// node limit-long-syntax.js -f FILE --log=LOG
// node limit-long-syntax.js --file FILE

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/views/Account/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAA+B,MAAM,SAAS,CAAA;AAOhF,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,wBAAsB,WAAW,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,oBAAoB,8BAyJ/F"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"triangle.js","sources":["../../../src/icons/triangle.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Triangle\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMuNzMgNGEyIDIgMCAwIDAtMy40NiAwbC04IDE0QTIgMiAwIDAgMCA0IDIxaDE2YTIgMiAwIDAgMCAxLjczLTNaIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/triangle\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 Triangle = createLucideIcon('Triangle', [\n [\n 'path',\n { d: 'M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z', key: '14u9p9' },\n ],\n]);\n\nexport default Triangle;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAC5C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC5F,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,3 @@
import type { SensorActivatorFunction, SensorDescriptor } from '../../sensors';
import type { SyntheticListener, SyntheticListeners } from './useSyntheticListeners';
export declare function useCombineActivators(sensors: SensorDescriptor<any>[], getSyntheticHandler: (handler: SensorActivatorFunction<any>, sensor: SensorDescriptor<any>) => SyntheticListener['handler']): SyntheticListeners;

View File

@@ -0,0 +1 @@
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/api/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,SAAS,EACT,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,UAAU,EACV,aAAa,EACb,OAAO,EACP,cAAc,EACd,OAAO,EACP,cAAc,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,IAAM,QAAQ,GAAG,OAAO,CAAC;AAEzB;;GAEG;AACH;IAKE,+FAA+F;IAC/F;QAHQ,yBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAmDlD,oBAAe,GAAG,eAAe,CAAC;QAElC,uBAAkB,GAAG,kBAAkB,CAAC;QAExC,eAAU,GAAG,UAAU,CAAC;QAExB,YAAO,GAAG,OAAO,CAAC;QAElB,kBAAa,GAAG,aAAa,CAAC;QAE9B,mBAAc,GAAG,cAAc,CAAC;QAEhC,YAAO,GAAG,OAAO,CAAC;QAElB,mBAAc,GAAG,cAAc,CAAC;IA9DhB,CAAC;IAExB,kDAAkD;IACpC,oBAAW,GAAzB;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;SACjC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,0CAAuB,GAA9B,UAA+B,QAAwB;QACrD,IAAM,OAAO,GAAG,cAAc,CAC5B,QAAQ,EACR,IAAI,CAAC,oBAAoB,EACzB,OAAO,CAAC,QAAQ,EAAE,CACnB,CAAC;QACF,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SACjD;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACI,oCAAiB,GAAxB;QACE,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,oBAAoB,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,4BAAS,GAAhB,UAAiB,IAAY,EAAE,OAAgB;QAC7C,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,wCAAwC;IACjC,0BAAO,GAAd;QACE,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACxD,CAAC;IAiBH,eAAC;AAAD,CAAC,AArED,IAqEC","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 {\n getGlobal,\n registerGlobal,\n unregisterGlobal,\n} from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport {\n isSpanContextValid,\n wrapSpanContext,\n} from '../trace/spancontext-utils';\nimport { Tracer } from '../trace/tracer';\nimport { TracerProvider } from '../trace/tracer_provider';\nimport {\n deleteSpan,\n getActiveSpan,\n getSpan,\n getSpanContext,\n setSpan,\n setSpanContext,\n} from '../trace/context-utils';\nimport { DiagAPI } from './diag';\n\nconst API_NAME = 'trace';\n\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n */\nexport class TraceAPI {\n private static _instance?: TraceAPI;\n\n private _proxyTracerProvider = new ProxyTracerProvider();\n\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n private constructor() {}\n\n /** Get the singleton instance of the Trace API */\n public static getInstance(): TraceAPI {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n\n return this._instance;\n }\n\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n public setGlobalTracerProvider(provider: TracerProvider): boolean {\n const success = registerGlobal(\n API_NAME,\n this._proxyTracerProvider,\n DiagAPI.instance()\n );\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n\n /**\n * Returns the global tracer provider.\n */\n public getTracerProvider(): TracerProvider {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n }\n\n /**\n * Returns a tracer from the global tracer provider.\n */\n public getTracer(name: string, version?: string): Tracer {\n return this.getTracerProvider().getTracer(name, version);\n }\n\n /** Remove the global tracer provider */\n public disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n }\n\n public wrapSpanContext = wrapSpanContext;\n\n public isSpanContextValid = isSpanContextValid;\n\n public deleteSpan = deleteSpan;\n\n public getSpan = getSpan;\n\n public getActiveSpan = getActiveSpan;\n\n public getSpanContext = getSpanContext;\n\n public setSpan = setSpan;\n\n public setSpanContext = setSpanContext;\n}\n"]}

View File

@@ -0,0 +1,28 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
test("check any inference", () => {
const t1 = z.any();
t1.optional();
t1.nullable();
type t1 = z.infer<typeof t1>;
util.assertEqual<t1, any>(true);
});
test("check unknown inference", () => {
const t1 = z.unknown();
t1.optional();
t1.nullable();
type t1 = z.infer<typeof t1>;
util.assertEqual<t1, unknown>(true);
});
test("check never inference", () => {
const t1 = z.never();
expect(() => t1.parse(undefined)).toThrow();
expect(() => t1.parse("asdf")).toThrow();
expect(() => t1.parse(null)).toThrow();
});

View File

@@ -0,0 +1,13 @@
import type { ASTVisitor } from '../../language/visitor';
import type { ValidationContext } from '../ValidationContext';
/**
* Subscriptions must only include a non-introspection field.
*
* A GraphQL subscription is valid only if it contains a single root field and
* that root field is not an introspection field.
*
* See https://spec.graphql.org/draft/#sec-Single-root-field
*/
export declare function SingleFieldSubscriptionsRule(
context: ValidationContext,
): ASTVisitor;

View File

@@ -0,0 +1,529 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/en-US/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
// lib/locale/en-US/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/en-US/_lib/localize.mjs
var eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
var monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"]
};
var dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"]
};
var dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
var rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/en-US/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns = {
any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/en-GB/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, d MMMM yyyy",
long: "d MMMM yyyy",
medium: "d MMM yyyy",
short: "dd/MM/yyyy"
};
var timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/en-IE.mjs
var enIE = {
code: "en-IE",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/en-IE/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
enIE: enIE }) });
//# debugId=3AA532F219EC77E664756e2164756e21
})();
//# sourceMappingURL=cdn.js.map

View File

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

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"networkUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/networkUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,KAAK,EAEV,kBAAkB,EAClB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAmCzE;AAED,4DAA4D;AAC5D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAO9F;AAED,iEAAiE;AACjE,wBAAgB,YAAY,CAC1B,IAAI,EAAE,8BAA8B,GAAG,SAAS,EAChD,OAAO,EAAE,kBAAkB,GAC1B,8BAA8B,CAiBhC;AAED,8DAA8D;AAC9D,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,wBAAwB,GAAG,IAAI,GACpC,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAqBnD;AAED,0FAA0F;AAC1F,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,8BAA8B,CAQjH;AAED,yEAAyE;AACzE,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,8BAA8B,GAAG,SAAS,CAgC5C;AAED,8BAA8B;AAC9B,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASnH;AAuDD,oDAAoD;AACpD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAI1E;AAED,yBAAyB;AACzB,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,SAA0B,GAAG,MAAM,CAoBjF"}

View File

@@ -0,0 +1,239 @@
'use strict'
const os = require('node:os')
const { join } = require('node:path')
const { readFile, symlink, unlink, mkdir, writeFile } = require('node:fs').promises
const { test } = require('tap')
const { isWin, isYarnPnp, watchFileCreated, file } = require('../helper')
const { once } = require('node:events')
const execa = require('execa')
const pino = require('../../')
const rimraf = require('rimraf')
const { pid } = process
const hostname = os.hostname()
async function installTransportModule (target) {
if (isYarnPnp) {
return
}
try {
await uninstallTransportModule()
} catch {}
if (!target) {
target = join(__dirname, '..', '..')
}
await symlink(
join(__dirname, '..', 'fixtures', 'transport'),
join(target, 'node_modules', 'transport')
)
}
async function uninstallTransportModule () {
if (isYarnPnp) {
return
}
await unlink(join(__dirname, '..', '..', 'node_modules', 'transport'))
}
// TODO make this test pass on Windows
test('pino.transport with package', { skip: isWin }, async ({ same, teardown }) => {
const destination = file()
await installTransportModule()
const transport = pino.transport({
target: 'transport',
options: { destination }
})
teardown(async () => {
await uninstallTransportModule()
transport.end()
})
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destination)
const result = JSON.parse(await readFile(destination))
delete result.time
same(result, {
pid,
hostname,
level: 30,
msg: 'hello'
})
})
// TODO make this test pass on Windows
test('pino.transport with package as a target', { skip: isWin }, async ({ same, teardown }) => {
const destination = file()
await installTransportModule()
const transport = pino.transport({
targets: [{
target: 'transport',
options: { destination }
}]
})
teardown(async () => {
await uninstallTransportModule()
transport.end()
})
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destination)
const result = JSON.parse(await readFile(destination))
delete result.time
same(result, {
pid,
hostname,
level: 30,
msg: 'hello'
})
})
// TODO make this test pass on Windows
test('pino({ transport })', { skip: isWin || isYarnPnp }, async ({ same, teardown }) => {
const folder = join(
os.tmpdir(),
'_' + Math.random().toString(36).substr(2, 9)
)
teardown(() => {
rimraf.sync(folder)
})
const destination = join(folder, 'output')
await mkdir(join(folder, 'node_modules'), { recursive: true })
// Link pino
await symlink(
join(__dirname, '..', '..'),
join(folder, 'node_modules', 'pino')
)
await installTransportModule(folder)
const toRun = join(folder, 'index.js')
const toRunContent = `
const pino = require('pino')
const logger = pino({
transport: {
target: 'transport',
options: { destination: '${destination}' }
}
})
logger.info('hello')
`
await writeFile(toRun, toRunContent)
const child = execa(process.argv[0], [toRun])
await once(child, 'close')
const result = JSON.parse(await readFile(destination))
delete result.time
same(result, {
pid: child.pid,
hostname,
level: 30,
msg: 'hello'
})
})
// TODO make this test pass on Windows
test('pino({ transport }) from a wrapped dependency', { skip: isWin || isYarnPnp }, async ({ same, teardown }) => {
const folder = join(
os.tmpdir(),
'_' + Math.random().toString(36).substr(2, 9)
)
const wrappedFolder = join(
os.tmpdir(),
'_' + Math.random().toString(36).substr(2, 9)
)
const destination = join(folder, 'output')
await mkdir(join(folder, 'node_modules'), { recursive: true })
await mkdir(join(wrappedFolder, 'node_modules'), { recursive: true })
teardown(() => {
rimraf.sync(wrappedFolder)
rimraf.sync(folder)
})
// Link pino
await symlink(
join(__dirname, '..', '..'),
join(wrappedFolder, 'node_modules', 'pino')
)
// Link get-caller-file
await symlink(
join(__dirname, '..', '..', 'node_modules', 'get-caller-file'),
join(wrappedFolder, 'node_modules', 'get-caller-file')
)
// Link wrapped
await symlink(
wrappedFolder,
join(folder, 'node_modules', 'wrapped')
)
await installTransportModule(folder)
const pkgjsonContent = {
name: 'pino'
}
await writeFile(join(wrappedFolder, 'package.json'), JSON.stringify(pkgjsonContent))
const wrapped = join(wrappedFolder, 'index.js')
const wrappedContent = `
const pino = require('pino')
const getCaller = require('get-caller-file')
module.exports = function build () {
const logger = pino({
transport: {
caller: getCaller(),
target: 'transport',
options: { destination: '${destination}' }
}
})
return logger
}
`
await writeFile(wrapped, wrappedContent)
const toRun = join(folder, 'index.js')
const toRunContent = `
const logger = require('wrapped')()
logger.info('hello')
`
await writeFile(toRun, toRunContent)
const child = execa(process.argv[0], [toRun])
await once(child, 'close')
const result = JSON.parse(await readFile(destination))
delete result.time
same(result, {
pid: child.pid,
hostname,
level: 30,
msg: 'hello'
})
})

View File

@@ -0,0 +1,9 @@
import { _ as _assert_this_initialized } from "./_assert_this_initialized.js";
import { _ as _type_of } from "./_type_of.js";
function _possible_constructor_return(self, call) {
if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
return _assert_this_initialized(self);
}
export { _possible_constructor_return as _ };

View File

@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CloudRainWind = createLucideIcon("CloudRainWind", [
["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: "m9.2 22 3-7", key: "sb5f6j" }],
["path", { d: "m9 13-3 7", key: "500co5" }],
["path", { d: "m17 13-3 7", key: "8t2fiy" }]
]);
export { CloudRainWind as default };
//# sourceMappingURL=cloud-rain-wind.js.map

View File

@@ -0,0 +1,483 @@
/* eslint max-statements:0 */
'use strict';
var assert = require('assert');
var parseUrl = require('url').parse;
var getProxyForUrl = require('./').getProxyForUrl;
// Runs the callback with process.env temporarily set to env.
function runWithEnv(env, callback) {
var originalEnv = process.env;
process.env = env;
try {
callback();
} finally {
process.env = originalEnv;
}
}
// Defines a test case that checks whether getProxyForUrl(input) === expected.
function testProxyUrl(env, expected, input) {
assert(typeof env === 'object' && env !== null);
// Copy object to make sure that the in param does not get modified between
// the call of this function and the use of it below.
env = JSON.parse(JSON.stringify(env));
var title = 'getProxyForUrl(' + JSON.stringify(input) + ')' +
' === ' + JSON.stringify(expected);
// Save call stack for later use.
var stack = {};
Error.captureStackTrace(stack, testProxyUrl);
// Only use the last stack frame because that shows where this function is
// called, and that is sufficient for our purpose. No need to flood the logs
// with an uninteresting stack trace.
stack = stack.stack.split('\n', 2)[1];
it(title, function() {
var actual;
runWithEnv(env, function() {
actual = getProxyForUrl(input);
});
if (expected === actual) {
return; // Good!
}
try {
assert.strictEqual(expected, actual); // Create a formatted error message.
// Should not happen because previously we determined expected !== actual.
throw new Error('assert.strictEqual passed. This is impossible!');
} catch (e) {
// Use the original stack trace, so we can see a helpful line number.
e.stack = e.message + stack;
throw e;
}
});
}
describe('getProxyForUrl', function() {
describe('No proxy variables', function() {
var env = {};
testProxyUrl(env, '', 'http://example.com');
testProxyUrl(env, '', 'https://example.com');
testProxyUrl(env, '', 'ftp://example.com');
});
describe('Invalid URLs', function() {
var env = {};
env.ALL_PROXY = 'http://unexpected.proxy';
testProxyUrl(env, '', 'bogus');
testProxyUrl(env, '', '//example.com');
testProxyUrl(env, '', '://example.com');
testProxyUrl(env, '', '://');
testProxyUrl(env, '', '/path');
testProxyUrl(env, '', '');
testProxyUrl(env, '', 'http:');
testProxyUrl(env, '', 'http:/');
testProxyUrl(env, '', 'http://');
testProxyUrl(env, '', 'prototype://');
testProxyUrl(env, '', 'hasOwnProperty://');
testProxyUrl(env, '', '__proto__://');
testProxyUrl(env, '', undefined);
testProxyUrl(env, '', null);
testProxyUrl(env, '', {});
testProxyUrl(env, '', {host: 'x', protocol: 1});
testProxyUrl(env, '', {host: 1, protocol: 'x'});
});
describe('http_proxy and HTTP_PROXY', function() {
var env = {};
env.HTTP_PROXY = 'http://http-proxy';
testProxyUrl(env, '', 'https://example');
testProxyUrl(env, 'http://http-proxy', 'http://example');
testProxyUrl(env, 'http://http-proxy', parseUrl('http://example'));
// eslint-disable-next-line camelcase
env.http_proxy = 'http://priority';
testProxyUrl(env, 'http://priority', 'http://example');
});
describe('http_proxy with non-sensical value', function() {
var env = {};
// Crazy values should be passed as-is. It is the responsibility of the
// one who launches the application that the value makes sense.
// TODO: Should we be stricter and perform validation?
env.HTTP_PROXY = 'Crazy \n!() { ::// }';
testProxyUrl(env, 'Crazy \n!() { ::// }', 'http://wow');
// The implementation assumes that the HTTP_PROXY environment variable is
// somewhat reasonable, and if the scheme is missing, it is added.
// Garbage in, garbage out some would say...
env.HTTP_PROXY = 'crazy without colon slash slash';
testProxyUrl(env, 'http://crazy without colon slash slash', 'http://wow');
});
describe('https_proxy and HTTPS_PROXY', function() {
var env = {};
// Assert that there is no fall back to http_proxy
env.HTTP_PROXY = 'http://unexpected.proxy';
testProxyUrl(env, '', 'https://example');
env.HTTPS_PROXY = 'http://https-proxy';
testProxyUrl(env, 'http://https-proxy', 'https://example');
// eslint-disable-next-line camelcase
env.https_proxy = 'http://priority';
testProxyUrl(env, 'http://priority', 'https://example');
});
describe('ftp_proxy', function() {
var env = {};
// Something else than http_proxy / https, as a sanity check.
env.FTP_PROXY = 'http://ftp-proxy';
testProxyUrl(env, 'http://ftp-proxy', 'ftp://example');
testProxyUrl(env, '', 'ftps://example');
});
describe('all_proxy', function() {
var env = {};
env.ALL_PROXY = 'http://catch-all';
testProxyUrl(env, 'http://catch-all', 'https://example');
// eslint-disable-next-line camelcase
env.all_proxy = 'http://priority';
testProxyUrl(env, 'http://priority', 'https://example');
});
describe('all_proxy without scheme', function() {
var env = {};
env.ALL_PROXY = 'noscheme';
testProxyUrl(env, 'http://noscheme', 'http://example');
testProxyUrl(env, 'https://noscheme', 'https://example');
// The module does not impose restrictions on the scheme.
testProxyUrl(env, 'bogus-scheme://noscheme', 'bogus-scheme://example');
// But the URL should still be valid.
testProxyUrl(env, '', 'bogus');
});
describe('no_proxy empty', function() {
var env = {};
env.HTTPS_PROXY = 'http://proxy';
// NO_PROXY set but empty.
env.NO_PROXY = '';
testProxyUrl(env, 'http://proxy', 'https://example');
// No entries in NO_PROXY (comma).
env.NO_PROXY = ',';
testProxyUrl(env, 'http://proxy', 'https://example');
// No entries in NO_PROXY (whitespace).
env.NO_PROXY = ' ';
testProxyUrl(env, 'http://proxy', 'https://example');
// No entries in NO_PROXY (multiple whitespace / commas).
env.NO_PROXY = ',\t,,,\n, ,\r';
testProxyUrl(env, 'http://proxy', 'https://example');
});
describe('no_proxy=example (single host)', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = 'example';
testProxyUrl(env, '', 'http://example');
testProxyUrl(env, '', 'http://example:80');
testProxyUrl(env, '', 'http://example:0');
testProxyUrl(env, '', 'http://example:1337');
testProxyUrl(env, 'http://proxy', 'http://sub.example');
testProxyUrl(env, 'http://proxy', 'http://prefexample');
testProxyUrl(env, 'http://proxy', 'http://example.no');
testProxyUrl(env, 'http://proxy', 'http://a.b.example');
testProxyUrl(env, 'http://proxy', 'http://host/example');
});
describe('no_proxy=sub.example (subdomain)', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = 'sub.example';
testProxyUrl(env, 'http://proxy', 'http://example');
testProxyUrl(env, 'http://proxy', 'http://example:80');
testProxyUrl(env, 'http://proxy', 'http://example:0');
testProxyUrl(env, 'http://proxy', 'http://example:1337');
testProxyUrl(env, '', 'http://sub.example');
testProxyUrl(env, 'http://proxy', 'http://no.sub.example');
testProxyUrl(env, 'http://proxy', 'http://sub-example');
testProxyUrl(env, 'http://proxy', 'http://example.sub');
});
describe('no_proxy=example:80 (host + port)', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = 'example:80';
testProxyUrl(env, '', 'http://example');
testProxyUrl(env, '', 'http://example:80');
testProxyUrl(env, '', 'http://example:0');
testProxyUrl(env, 'http://proxy', 'http://example:1337');
testProxyUrl(env, 'http://proxy', 'http://sub.example');
testProxyUrl(env, 'http://proxy', 'http://prefexample');
testProxyUrl(env, 'http://proxy', 'http://example.no');
testProxyUrl(env, 'http://proxy', 'http://a.b.example');
});
describe('no_proxy=.example (host suffix)', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = '.example';
testProxyUrl(env, 'http://proxy', 'http://example');
testProxyUrl(env, 'http://proxy', 'http://example:80');
testProxyUrl(env, 'http://proxy', 'http://example:1337');
testProxyUrl(env, '', 'http://sub.example');
testProxyUrl(env, '', 'http://sub.example:80');
testProxyUrl(env, '', 'http://sub.example:1337');
testProxyUrl(env, 'http://proxy', 'http://prefexample');
testProxyUrl(env, 'http://proxy', 'http://example.no');
testProxyUrl(env, '', 'http://a.b.example');
});
describe('no_proxy=*', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = '*';
testProxyUrl(env, '', 'http://example.com');
});
describe('no_proxy=*.example (host suffix with *.)', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = '*.example';
testProxyUrl(env, 'http://proxy', 'http://example');
testProxyUrl(env, 'http://proxy', 'http://example:80');
testProxyUrl(env, 'http://proxy', 'http://example:1337');
testProxyUrl(env, '', 'http://sub.example');
testProxyUrl(env, '', 'http://sub.example:80');
testProxyUrl(env, '', 'http://sub.example:1337');
testProxyUrl(env, 'http://proxy', 'http://prefexample');
testProxyUrl(env, 'http://proxy', 'http://example.no');
testProxyUrl(env, '', 'http://a.b.example');
});
describe('no_proxy=*example (substring suffix)', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = '*example';
testProxyUrl(env, '', 'http://example');
testProxyUrl(env, '', 'http://example:80');
testProxyUrl(env, '', 'http://example:1337');
testProxyUrl(env, '', 'http://sub.example');
testProxyUrl(env, '', 'http://sub.example:80');
testProxyUrl(env, '', 'http://sub.example:1337');
testProxyUrl(env, '', 'http://prefexample');
testProxyUrl(env, '', 'http://a.b.example');
testProxyUrl(env, 'http://proxy', 'http://example.no');
testProxyUrl(env, 'http://proxy', 'http://host/example');
});
describe('no_proxy=.*example (arbitrary wildcards are NOT supported)',
function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = '.*example';
testProxyUrl(env, 'http://proxy', 'http://example');
testProxyUrl(env, 'http://proxy', 'http://sub.example');
testProxyUrl(env, 'http://proxy', 'http://sub.example');
testProxyUrl(env, 'http://proxy', 'http://prefexample');
testProxyUrl(env, 'http://proxy', 'http://x.prefexample');
testProxyUrl(env, 'http://proxy', 'http://a.b.example');
});
describe('no_proxy=[::1],[::2]:80,10.0.0.1,10.0.0.2:80 (IP addresses)',
function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = '[::1],[::2]:80,10.0.0.1,10.0.0.2:80';
testProxyUrl(env, '', 'http://[::1]/');
testProxyUrl(env, '', 'http://[::1]:80/');
testProxyUrl(env, '', 'http://[::1]:1337/');
testProxyUrl(env, '', 'http://[::2]/');
testProxyUrl(env, '', 'http://[::2]:80/');
testProxyUrl(env, 'http://proxy', 'http://[::2]:1337/');
testProxyUrl(env, '', 'http://10.0.0.1/');
testProxyUrl(env, '', 'http://10.0.0.1:80/');
testProxyUrl(env, '', 'http://10.0.0.1:1337/');
testProxyUrl(env, '', 'http://10.0.0.2/');
testProxyUrl(env, '', 'http://10.0.0.2:80/');
testProxyUrl(env, 'http://proxy', 'http://10.0.0.2:1337/');
});
describe('no_proxy=127.0.0.1/32 (CIDR is NOT supported)', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = '127.0.0.1/32';
testProxyUrl(env, 'http://proxy', 'http://127.0.0.1');
testProxyUrl(env, 'http://proxy', 'http://127.0.0.1/32');
});
describe('no_proxy=127.0.0.1 does NOT match localhost', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = '127.0.0.1';
testProxyUrl(env, '', 'http://127.0.0.1');
// We're not performing DNS queries, so this shouldn't match.
testProxyUrl(env, 'http://proxy', 'http://localhost');
});
describe('no_proxy with protocols that have a default port', function() {
var env = {};
env.WS_PROXY = 'http://ws';
env.WSS_PROXY = 'http://wss';
env.HTTP_PROXY = 'http://http';
env.HTTPS_PROXY = 'http://https';
env.GOPHER_PROXY = 'http://gopher';
env.FTP_PROXY = 'http://ftp';
env.ALL_PROXY = 'http://all';
env.NO_PROXY = 'xxx:21,xxx:70,xxx:80,xxx:443';
testProxyUrl(env, '', 'http://xxx');
testProxyUrl(env, '', 'http://xxx:80');
testProxyUrl(env, 'http://http', 'http://xxx:1337');
testProxyUrl(env, '', 'ws://xxx');
testProxyUrl(env, '', 'ws://xxx:80');
testProxyUrl(env, 'http://ws', 'ws://xxx:1337');
testProxyUrl(env, '', 'https://xxx');
testProxyUrl(env, '', 'https://xxx:443');
testProxyUrl(env, 'http://https', 'https://xxx:1337');
testProxyUrl(env, '', 'wss://xxx');
testProxyUrl(env, '', 'wss://xxx:443');
testProxyUrl(env, 'http://wss', 'wss://xxx:1337');
testProxyUrl(env, '', 'gopher://xxx');
testProxyUrl(env, '', 'gopher://xxx:70');
testProxyUrl(env, 'http://gopher', 'gopher://xxx:1337');
testProxyUrl(env, '', 'ftp://xxx');
testProxyUrl(env, '', 'ftp://xxx:21');
testProxyUrl(env, 'http://ftp', 'ftp://xxx:1337');
});
describe('no_proxy should not be case-sensitive', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = 'XXX,YYY,ZzZ';
testProxyUrl(env, '', 'http://xxx');
testProxyUrl(env, '', 'http://XXX');
testProxyUrl(env, '', 'http://yyy');
testProxyUrl(env, '', 'http://YYY');
testProxyUrl(env, '', 'http://ZzZ');
testProxyUrl(env, '', 'http://zZz');
});
describe('NPM proxy configuration', function() {
describe('npm_config_http_proxy should work', function() {
var env = {};
// eslint-disable-next-line camelcase
env.npm_config_http_proxy = 'http://http-proxy';
testProxyUrl(env, '', 'https://example');
testProxyUrl(env, 'http://http-proxy', 'http://example');
// eslint-disable-next-line camelcase
env.npm_config_http_proxy = 'http://priority';
testProxyUrl(env, 'http://priority', 'http://example');
});
// eslint-disable-next-line max-len
describe('npm_config_http_proxy should take precedence over HTTP_PROXY and npm_config_proxy', function() {
var env = {};
// eslint-disable-next-line camelcase
env.npm_config_http_proxy = 'http://http-proxy';
// eslint-disable-next-line camelcase
env.npm_config_proxy = 'http://unexpected-proxy';
env.HTTP_PROXY = 'http://unexpected-proxy';
testProxyUrl(env, 'http://http-proxy', 'http://example');
});
describe('npm_config_https_proxy should work', function() {
var env = {};
// eslint-disable-next-line camelcase
env.npm_config_http_proxy = 'http://unexpected.proxy';
testProxyUrl(env, '', 'https://example');
// eslint-disable-next-line camelcase
env.npm_config_https_proxy = 'http://https-proxy';
testProxyUrl(env, 'http://https-proxy', 'https://example');
// eslint-disable-next-line camelcase
env.npm_config_https_proxy = 'http://priority';
testProxyUrl(env, 'http://priority', 'https://example');
});
// eslint-disable-next-line max-len
describe('npm_config_https_proxy should take precedence over HTTPS_PROXY and npm_config_proxy', function() {
var env = {};
// eslint-disable-next-line camelcase
env.npm_config_https_proxy = 'http://https-proxy';
// eslint-disable-next-line camelcase
env.npm_config_proxy = 'http://unexpected-proxy';
env.HTTPS_PROXY = 'http://unexpected-proxy';
testProxyUrl(env, 'http://https-proxy', 'https://example');
});
describe('npm_config_proxy should work', function() {
var env = {};
// eslint-disable-next-line camelcase
env.npm_config_proxy = 'http://http-proxy';
testProxyUrl(env, 'http://http-proxy', 'http://example');
testProxyUrl(env, 'http://http-proxy', 'https://example');
// eslint-disable-next-line camelcase
env.npm_config_proxy = 'http://priority';
testProxyUrl(env, 'http://priority', 'http://example');
testProxyUrl(env, 'http://priority', 'https://example');
});
// eslint-disable-next-line max-len
describe('HTTP_PROXY and HTTPS_PROXY should take precedence over npm_config_proxy', function() {
var env = {};
env.HTTP_PROXY = 'http://http-proxy';
env.HTTPS_PROXY = 'http://https-proxy';
// eslint-disable-next-line camelcase
env.npm_config_proxy = 'http://unexpected-proxy';
testProxyUrl(env, 'http://http-proxy', 'http://example');
testProxyUrl(env, 'http://https-proxy', 'https://example');
});
describe('npm_config_no_proxy should work', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
// eslint-disable-next-line camelcase
env.npm_config_no_proxy = 'example';
testProxyUrl(env, '', 'http://example');
testProxyUrl(env, 'http://proxy', 'http://otherwebsite');
});
// eslint-disable-next-line max-len
describe('npm_config_no_proxy should take precedence over NO_PROXY', function() {
var env = {};
env.HTTP_PROXY = 'http://proxy';
env.NO_PROXY = 'otherwebsite';
// eslint-disable-next-line camelcase
env.npm_config_no_proxy = 'example';
testProxyUrl(env, '', 'http://example');
testProxyUrl(env, 'http://proxy', 'http://otherwebsite');
});
});
});

View File

@@ -0,0 +1,18 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const carrier = require('./carrier.js');
const scope = require('./scope.js');
/** Get the default current scope. */
function getDefaultCurrentScope() {
return carrier.getGlobalSingleton('defaultCurrentScope', () => new scope.Scope());
}
/** Get the default isolation scope. */
function getDefaultIsolationScope() {
return carrier.getGlobalSingleton('defaultIsolationScope', () => new scope.Scope());
}
exports.getDefaultCurrentScope = getDefaultCurrentScope;
exports.getDefaultIsolationScope = getDefaultIsolationScope;
//# sourceMappingURL=defaultScopes.js.map

View File

@@ -0,0 +1,58 @@
import { getTranslation } from '@payloadcms/translations';
import { formatDate } from '@payloadcms/ui/shared';
import { generateMetadata } from '../../utilities/meta.js';
/**
* @todo Remove the `MetaConfig` type assertions. They are currently required because of how the `Metadata` type from `next` consumes the `URL` type.
*/
export const generateVersionViewMetadata = async ({
collectionConfig,
config,
globalConfig,
i18n
}) => {
const {
t
} = i18n;
let metaToUse = {
...(config.admin.meta || {})
};
const doc = {} // TODO: figure this out
;
const formattedCreatedAt = doc?.createdAt ? formatDate({
date: doc.createdAt,
i18n,
pattern: config?.admin?.dateFormat
}) : '';
if (collectionConfig) {
const useAsTitle = collectionConfig?.admin?.useAsTitle || 'id';
const entityLabel = getTranslation(collectionConfig.labels.singular, i18n);
const titleFromData = doc?.[useAsTitle];
metaToUse = {
...(config.admin.meta || {}),
description: t('version:viewingVersion', {
documentTitle: titleFromData,
entityLabel
}),
title: `${t('version:version')}${formattedCreatedAt ? ` - ${formattedCreatedAt}` : ''}${titleFromData ? ` - ${titleFromData}` : ''} - ${entityLabel}`,
...(collectionConfig?.admin?.meta || {}),
...(collectionConfig?.admin?.components?.views?.edit?.version?.meta || {})
};
}
if (globalConfig) {
const entityLabel = getTranslation(globalConfig.label, i18n);
metaToUse = {
...(config.admin.meta || {}),
description: t('version:viewingVersionGlobal', {
entityLabel
}),
title: `${t('version:version')}${formattedCreatedAt ? ` - ${formattedCreatedAt}` : ''}${entityLabel}`,
...(globalConfig?.admin?.meta || {}),
...(globalConfig?.admin?.components?.views?.edit?.version?.meta || {})
};
}
return generateMetadata({
...metaToUse,
serverURL: config.serverURL
});
};
//# sourceMappingURL=metadata.js.map

View File

@@ -0,0 +1,3 @@
import type { MigrationConfig } from "../migrator.js";
import type { SQLJsDatabase } from "./driver.js";
export declare function migrate<TSchema extends Record<string, unknown>>(db: SQLJsDatabase<TSchema>, config: MigrationConfig): void;

View File

@@ -0,0 +1 @@
{"version":3,"file":"public-api.js","sources":["../../../src/metrics/public-api.ts"],"sourcesContent":["import type { Scope } from '../scope';\nimport type { Metric, MetricType } from '../types-hoist/metric';\nimport { _INTERNAL_captureMetric } from './internal';\n\n/**\n * Options for capturing a metric.\n */\nexport interface MetricOptions {\n /**\n * The unit of the metric value.\n */\n unit?: string;\n\n /**\n * Arbitrary structured data that stores information about the metric.\n */\n attributes?: Metric['attributes'];\n\n /**\n * The scope to capture the metric with.\n */\n scope?: Scope;\n}\n\n/**\n * Capture a metric with the given type, name, and value.\n *\n * @param type - The type of the metric.\n * @param name - The name of the metric.\n * @param value - The value of the metric.\n * @param options - Options for capturing the metric.\n */\nfunction captureMetric(type: MetricType, name: string, value: number, options?: MetricOptions): void {\n _INTERNAL_captureMetric(\n { type, name, value, unit: options?.unit, attributes: options?.attributes },\n { scope: options?.scope },\n );\n}\n\n/**\n * @summary Increment a counter metric.\n *\n * @param name - The name of the counter metric.\n * @param value - The value to increment by (defaults to 1).\n * @param options - Options for capturing the metric.\n *\n * @example\n *\n * ```\n * Sentry.metrics.count('api.requests', 1, {\n * attributes: {\n * endpoint: '/api/users',\n * method: 'GET',\n * status: 200\n * }\n * });\n * ```\n *\n * @example With custom value\n *\n * ```\n * Sentry.metrics.count('items.processed', 5, {\n * attributes: {\n * processor: 'batch-processor',\n * queue: 'high-priority'\n * }\n * });\n * ```\n */\nexport function count(name: string, value: number = 1, options?: MetricOptions): void {\n captureMetric('counter', name, value, options);\n}\n\n/**\n * @summary Set a gauge metric to a specific value.\n *\n * @param name - The name of the gauge metric.\n * @param value - The current value of the gauge.\n * @param options - Options for capturing the metric.\n *\n * @example\n *\n * ```\n * Sentry.metrics.gauge('memory.usage', 1024, {\n * unit: 'megabyte',\n * attributes: {\n * process: 'web-server',\n * region: 'us-east-1'\n * }\n * });\n * ```\n *\n * @example Without unit\n *\n * ```\n * Sentry.metrics.gauge('active.connections', 42, {\n * attributes: {\n * server: 'api-1',\n * protocol: 'websocket'\n * }\n * });\n * ```\n */\nexport function gauge(name: string, value: number, options?: MetricOptions): void {\n captureMetric('gauge', name, value, options);\n}\n\n/**\n * @summary Record a value in a distribution metric.\n *\n * @param name - The name of the distribution metric.\n * @param value - The value to record in the distribution.\n * @param options - Options for capturing the metric.\n *\n * @example\n *\n * ```\n * Sentry.metrics.distribution('task.duration', 500, {\n * unit: 'millisecond',\n * attributes: {\n * task: 'data-processing',\n * priority: 'high'\n * }\n * });\n * ```\n *\n * @example Without unit\n *\n * ```\n * Sentry.metrics.distribution('batch.size', 100, {\n * attributes: {\n * processor: 'batch-1',\n * type: 'async'\n * }\n * });\n * ```\n */\nexport function distribution(name: string, value: number, options?: MetricOptions): void {\n captureMetric('distribution', name, value, options);\n}\n"],"names":["_INTERNAL_captureMetric"],"mappings":";;;;AAIA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAc,IAAI,EAAU,KAAK,EAAU,OAAO,EAAwB;AACrG,EAAEA,gCAAuB;AACzB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY;AAC/E,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO;AAC7B,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,IAAI,EAAU,KAAK,GAAW,CAAC,EAAE,OAAO,EAAwB;AACtF,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,IAAI,EAAU,KAAK,EAAU,OAAO,EAAwB;AAClF,EAAE,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,IAAI,EAAU,KAAK,EAAU,OAAO,EAAwB;AACzF,EAAE,aAAa,CAAC,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC;AACrD;;;;;;"}

View File

@@ -0,0 +1,7 @@
import React from 'react';
export type GenerateConfirmationProps = {
highlightField: (Boolean: any) => void;
setKey: () => void;
};
export declare function GenerateConfirmation(props: GenerateConfirmationProps): React.JSX.Element;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
Prism.languages.gap={shell:{pattern:/^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m,greedy:!0,inside:{gap:{pattern:/^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/,lookbehind:!0,inside:null},punctuation:/^gap>/}},comment:{pattern:/#.*/,greedy:!0},string:{pattern:/(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/,lookbehind:!0,greedy:!0,inside:{continuation:{pattern:/([\r\n])>/,lookbehind:!0,alias:"punctuation"}}},keyword:/\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:{pattern:/(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,lookbehind:!0},continuation:{pattern:/([\r\n])>/,lookbehind:!0,alias:"punctuation"},operator:/->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./,punctuation:/[()[\]{},;.:]/},Prism.languages.gap.shell.inside.gap.inside=Prism.languages.gap;

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/AppHeader/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAc1D,OAAO,cAAc,CAAA;AAIrB,KAAK,KAAK,GAAG;IACX,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC7B,CAAA;AACD,wBAAgB,SAAS,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,KAAK,qBAuF5D"}

View File

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

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 Baseline = createLucideIcon("Baseline", [
["path", { d: "M4 20h16", key: "14thso" }],
["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
["path", { d: "M8 12h8", key: "1wcyev" }]
]);
export { Baseline as default };
//# sourceMappingURL=baseline.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getWorkflowRetryBehavior.d.ts","sourceRoot":"","sources":["../../../src/queues/errors/getWorkflowRetryBehavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAI/D;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,GAAG,EACH,aAAa,GACd,EAAE;IACD,GAAG,EAAE,GAAG,CAAA;IACR,aAAa,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;CACrC,GACG;IACE,aAAa,EAAE,KAAK,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,IAAI,CAAA;CACjB,GACD;IACE,aAAa,EAAE,IAAI,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,IAAI,CAAA;CACjB,CAoCJ"}

View File

@@ -0,0 +1,181 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { ConcatSource } = require("webpack-sources");
const ExternalModule = require("../ExternalModule");
const Template = require("../Template");
const AbstractLibraryPlugin = require("./AbstractLibraryPlugin");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */
/** @typedef {import("../../declarations/WebpackOptions").LibraryType} LibraryType */
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Compilation").ChunkHashContext} ChunkHashContext */
/** @typedef {import("../javascript/JavascriptModulesPlugin").RenderContext} RenderContext */
/** @typedef {import("../util/Hash")} Hash */
/**
* @template T
* @typedef {import("./AbstractLibraryPlugin").LibraryContext<T>} LibraryContext<T>
*/
/**
* @typedef {object} AmdLibraryPluginOptions
* @property {LibraryType} type
* @property {boolean=} requireAsWrapper
*/
/**
* @typedef {object} AmdLibraryPluginParsed
* @property {string} name
* @property {string} amdContainer
*/
/**
* @typedef {AmdLibraryPluginParsed} T
* @extends {AbstractLibraryPlugin<AmdLibraryPluginParsed>}
*/
class AmdLibraryPlugin extends AbstractLibraryPlugin {
/**
* @param {AmdLibraryPluginOptions} options the plugin options
*/
constructor(options) {
super({
pluginName: "AmdLibraryPlugin",
type: options.type
});
/** @type {AmdLibraryPluginOptions["requireAsWrapper"]} */
this.requireAsWrapper = options.requireAsWrapper;
}
/**
* @param {LibraryOptions} library normalized library option
* @returns {T} preprocess as needed by overriding
*/
parseOptions(library) {
const { name, amdContainer } = library;
if (this.requireAsWrapper) {
if (name) {
throw new Error(
`AMD library name must be unset. ${AbstractLibraryPlugin.COMMON_LIBRARY_NAME_MESSAGE}`
);
}
} else if (name && typeof name !== "string") {
throw new Error(
`AMD library name must be a simple string or unset. ${AbstractLibraryPlugin.COMMON_LIBRARY_NAME_MESSAGE}`
);
}
const _name = /** @type {string} */ (name);
const _amdContainer = /** @type {string} */ (amdContainer);
return { name: _name, amdContainer: _amdContainer };
}
/**
* @param {Source} source source
* @param {RenderContext} renderContext render context
* @param {LibraryContext<T>} libraryContext context
* @returns {Source} source with library export
*/
render(
source,
{ chunkGraph, chunk, runtimeTemplate },
{ options, compilation }
) {
const modern = runtimeTemplate.supportsArrowFunction();
const modules = chunkGraph
.getChunkModules(chunk)
.filter(
(m) =>
m instanceof ExternalModule &&
(m.externalType === "amd" || m.externalType === "amd-require")
);
const externals = /** @type {ExternalModule[]} */ (modules);
const externalsDepsArray = JSON.stringify(
externals.map((m) =>
typeof m.request === "object" && !Array.isArray(m.request)
? m.request.amd
: m.request
)
);
const externalsArguments = externals
.map(
(m) =>
`__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(
`${chunkGraph.getModuleId(m)}`
)}__`
)
.join(", ");
const iife = runtimeTemplate.isIIFE();
const fnStart =
(modern
? `(${externalsArguments}) => {`
: `function(${externalsArguments}) {`) +
(iife || !chunk.hasRuntime() ? " return " : "\n");
const fnEnd = iife ? ";\n}" : "\n}";
let amdContainerPrefix = "";
if (options.amdContainer) {
amdContainerPrefix = `${options.amdContainer}.`;
}
if (this.requireAsWrapper) {
return new ConcatSource(
`${amdContainerPrefix}require(${externalsDepsArray}, ${fnStart}`,
source,
`${fnEnd});`
);
} else if (options.name) {
const name = compilation.getPath(options.name, {
chunk
});
return new ConcatSource(
`${amdContainerPrefix}define(${JSON.stringify(
name
)}, ${externalsDepsArray}, ${fnStart}`,
source,
`${fnEnd});`
);
} else if (externalsArguments) {
return new ConcatSource(
`${amdContainerPrefix}define(${externalsDepsArray}, ${fnStart}`,
source,
`${fnEnd});`
);
}
return new ConcatSource(
`${amdContainerPrefix}define(${fnStart}`,
source,
`${fnEnd});`
);
}
/**
* @param {Chunk} chunk the chunk
* @param {Hash} hash hash
* @param {ChunkHashContext} chunkHashContext chunk hash context
* @param {LibraryContext<T>} libraryContext context
* @returns {void}
*/
chunkHash(chunk, hash, chunkHashContext, { options, compilation }) {
hash.update("AmdLibraryPlugin");
if (this.requireAsWrapper) {
hash.update("requireAsWrapper");
} else if (options.name) {
hash.update("named");
const name = compilation.getPath(options.name, {
chunk
});
hash.update(name);
} else if (options.amdContainer) {
hash.update("amdContainer");
hash.update(options.amdContainer);
}
}
}
module.exports = AmdLibraryPlugin;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/auth/operations/local/resetPassword.ts"],"sourcesContent":["import type { AuthCollectionSlug, Payload, RequestContext } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\nimport type { Result } from '../resetPassword.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createLocalReq } from '../../../utilities/createLocalReq.js'\nimport { resetPasswordOperation } from '../resetPassword.js'\n\nexport type Options<TSlug extends AuthCollectionSlug> = {\n collection: TSlug\n context?: RequestContext\n data: {\n password: string\n token: string\n }\n overrideAccess: boolean\n req?: Partial<PayloadRequest>\n}\n\nexport async function resetPasswordLocal<TSlug extends AuthCollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<Result> {\n const { collection: collectionSlug, data, overrideAccess } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(\n collectionSlug,\n )} can't be found. Reset Password Operation.`,\n )\n }\n\n const result = await resetPasswordOperation<TSlug>({\n collection,\n data,\n overrideAccess,\n req: await createLocalReq(options, payload),\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return result\n}\n"],"names":["APIError","createLocalReq","resetPasswordOperation","resetPasswordLocal","payload","options","collection","collectionSlug","data","overrideAccess","collections","String","result","req","config","auth","removeTokenFromResponses","token"],"mappings":"AAIA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,sBAAsB,QAAQ,sBAAqB;AAa5D,OAAO,eAAeC,mBACpBC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EAAEC,YAAYC,cAAc,EAAEC,IAAI,EAAEC,cAAc,EAAE,GAAGJ;IAE7D,MAAMC,aAAaF,QAAQM,WAAW,CAACH,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEW,OAC1BJ,gBACA,0CAA0C,CAAC;IAEjD;IAEA,MAAMK,SAAS,MAAMV,uBAA8B;QACjDI;QACAE;QACAC;QACAI,KAAK,MAAMZ,eAAeI,SAASD;IACrC;IAEA,IAAIE,WAAWQ,MAAM,CAACC,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOJ,OAAOK,KAAK;IACrB;IAEA,OAAOL;AACT"}

View File

@@ -0,0 +1,5 @@
/**
* Inclusion list of attributes that we want to record from the DOM element
*/
export declare function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown>;
//# sourceMappingURL=getAttributesToRecord.d.ts.map

View File

@@ -0,0 +1,12 @@
# MockErrors
Undici exposes a variety of mock error objects that you can use to enhance your mock error handling.
You can find all the mock error objects inside the `mockErrors` key.
```js
import { mockErrors } from 'undici'
```
| Mock Error | Mock Error Codes | Description |
| --------------------- | ------------------------------- | ---------------------------------------------------------- |
| `MockNotMatchedError` | `UND_MOCK_ERR_MOCK_NOT_MATCHED` | The request does not match any registered mock dispatches. |

View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLIPCPatent = exports.GraphQLIPCPatentConfig = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../../error.js");
/* 1. [A-H] represents the Section Level of the Classification
2. \d{2} represents the class level
3. [A-Z] represents the subclass level
4. \/ separates the subclass from the subgroup
5. \d{2,4} represents the subgroup level
(Only four levels of subgroup, as far as I know)
*/
const IPC_PATENT_REGEX = /^[A-H]\d{2}[A-Z] \d{1,2}\/\d{2,4}$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Value is not string: ${value}`, { nodes: ast });
}
if (!IPC_PATENT_REGEX.test(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid IPC Class Symbol: ${value}`, { nodes: ast });
}
return value;
};
const specifiedByURL = 'https://www.wipo.int/classifications/ipc/en/';
exports.GraphQLIPCPatentConfig = {
name: 'IPCPatent',
description: `A field whose value is an IPC Class Symbol within the International Patent Classification System: https://www.wipo.int/classifications/ipc/en/`,
serialize: validate,
parseValue: validate,
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Can only validate strings as an IPC Class Symbol but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
specifiedByURL,
specifiedByUrl: specifiedByURL,
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'DeweyDecimal',
type: 'string',
pattern: IPC_PATENT_REGEX.source,
},
},
};
exports.GraphQLIPCPatent = new graphql_1.GraphQLScalarType(exports.GraphQLIPCPatentConfig);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/singlestore-core/columns/varchar.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnySingleStoreTable } from '~/singlestore-core/table.ts';\nimport { getColumnNameAndConfig, type Writable } from '~/utils.ts';\nimport { SingleStoreColumn, SingleStoreColumnBuilder } from './common.ts';\n\nexport type SingleStoreVarCharBuilderInitial<\n\tTName extends string,\n\tTEnum extends [string, ...string[]],\n\tTLength extends number | undefined,\n> = SingleStoreVarCharBuilder<\n\t{\n\t\tname: TName;\n\t\tdataType: 'string';\n\t\tcolumnType: 'SingleStoreVarChar';\n\t\tdata: TEnum[number];\n\t\tdriverParam: number | string;\n\t\tenumValues: TEnum;\n\t\tgenerated: undefined;\n\t\tlength: TLength;\n\t}\n>;\n\nexport class SingleStoreVarCharBuilder<\n\tT extends ColumnBuilderBaseConfig<'string', 'SingleStoreVarChar'> & { length?: number | undefined },\n> extends SingleStoreColumnBuilder<T, SingleStoreVarCharConfig<T['enumValues'], T['length']>, { length: T['length'] }> {\n\tstatic override readonly [entityKind]: string = 'SingleStoreVarCharBuilder';\n\n\t/** @internal */\n\tconstructor(name: T['name'], config: SingleStoreVarCharConfig<T['enumValues'], T['length']>) {\n\t\tsuper(name, 'string', 'SingleStoreVarChar');\n\t\tthis.config.length = config.length;\n\t\tthis.config.enum = config.enum;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySingleStoreTable<{ name: TTableName }>,\n\t): SingleStoreVarChar<MakeColumnConfig<T, TTableName> & { length: T['length']; enumValues: T['enumValues'] }> {\n\t\treturn new SingleStoreVarChar<\n\t\t\tMakeColumnConfig<T, TTableName> & { length: T['length']; enumValues: T['enumValues'] }\n\t\t>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class SingleStoreVarChar<\n\tT extends ColumnBaseConfig<'string', 'SingleStoreVarChar'> & { length?: number | undefined },\n> extends SingleStoreColumn<T, SingleStoreVarCharConfig<T['enumValues'], T['length']>, { length: T['length'] }> {\n\tstatic override readonly [entityKind]: string = 'SingleStoreVarChar';\n\n\treadonly length: T['length'] = this.config.length;\n\toverride readonly enumValues = this.config.enum;\n\n\tgetSQLType(): string {\n\t\treturn this.length === undefined ? `varchar` : `varchar(${this.length})`;\n\t}\n}\n\nexport interface SingleStoreVarCharConfig<\n\tTEnum extends string[] | readonly string[] | undefined = string[] | readonly string[] | undefined,\n\tTLength extends number | undefined = number | undefined,\n> {\n\tenum?: TEnum;\n\tlength: TLength;\n}\n\nexport function varchar<U extends string, T extends Readonly<[U, ...U[]]>, L extends number | undefined>(\n\tconfig: SingleStoreVarCharConfig<T | Writable<T>, L>,\n): SingleStoreVarCharBuilderInitial<'', Writable<T>, L>;\nexport function varchar<\n\tTName extends string,\n\tU extends string,\n\tT extends Readonly<[U, ...U[]]>,\n\tL extends number | undefined,\n>(\n\tname: TName,\n\tconfig: SingleStoreVarCharConfig<T | Writable<T>, L>,\n): SingleStoreVarCharBuilderInitial<TName, Writable<T>, L>;\nexport function varchar(a?: string | SingleStoreVarCharConfig, b?: SingleStoreVarCharConfig): any {\n\tconst { name, config } = getColumnNameAndConfig<SingleStoreVarCharConfig>(a, b);\n\treturn new SingleStoreVarCharBuilder(name, config as any);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAE3B,mBAAsD;AACtD,oBAA4D;AAmBrD,MAAM,kCAEH,uCAA6G;AAAA,EACtH,QAA0B,wBAAU,IAAY;AAAA;AAAA,EAGhD,YAAY,MAAiB,QAAgE;AAC5F,UAAM,MAAM,UAAU,oBAAoB;AAC1C,SAAK,OAAO,SAAS,OAAO;AAC5B,SAAK,OAAO,OAAO,OAAO;AAAA,EAC3B;AAAA;AAAA,EAGS,MACR,OAC6G;AAC7G,WAAO,IAAI;AAAA,MAGV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,2BAEH,gCAAsG;AAAA,EAC/G,QAA0B,wBAAU,IAAY;AAAA,EAEvC,SAAsB,KAAK,OAAO;AAAA,EACzB,aAAa,KAAK,OAAO;AAAA,EAE3C,aAAqB;AACpB,WAAO,KAAK,WAAW,SAAY,YAAY,WAAW,KAAK,MAAM;AAAA,EACtE;AACD;AAsBO,SAAS,QAAQ,GAAuC,GAAmC;AACjG,QAAM,EAAE,MAAM,OAAO,QAAI,qCAAiD,GAAG,CAAC;AAC9E,SAAO,IAAI,0BAA0B,MAAM,MAAa;AACzD;","names":[]}

View File

@@ -0,0 +1,30 @@
"use strict";
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) {
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
}
keys.push.apply(keys, symbols);
}
return keys;
}
function _object_spread_props(target, source) {
source = source != null ? source : {};
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
else {
ownKeys(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
exports._ = _object_spread_props;

View File

@@ -0,0 +1,6 @@
import { IPropertyIdentValueDescriptor } from '../IPropertyDescriptor';
export declare enum LINE_BREAK {
NORMAL = "normal",
STRICT = "strict"
}
export declare const lineBreak: IPropertyIdentValueDescriptor<LINE_BREAK>;

View File

@@ -0,0 +1,90 @@
var composeArgs = require('./_composeArgs'),
composeArgsRight = require('./_composeArgsRight'),
replaceHolders = require('./_replaceHolders');
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and
* `_.rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `_.ary`
* and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo =
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
// Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
}
// Use source `thisArg` if available.
if (srcBitmask & WRAP_BIND_FLAG) {
data[2] = source[2];
// Set when currying a bound function.
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
}
// Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
}
// Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
}
// Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = value;
}
// Use source `ary` if it's smaller.
if (srcBitmask & WRAP_ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
}
// Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
}
// Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
module.exports = mergeData;

View File

@@ -0,0 +1,102 @@
import type { I18nClient } from '@payloadcms/translations';
import type { MarkOptional } from 'ts-essentials';
import type { SanitizedFieldPermissions } from '../../auth/types.js';
import type { ClientBlock, ClientField, Field } from '../../fields/config/types.js';
import type { TypedUser } from '../../index.js';
import type { DocumentPreferences } from '../../preferences/types.js';
import type { Operation, Payload, PayloadRequest } from '../../types/index.js';
import type { ClientFieldSchemaMap, ClientTab, Data, FieldSchemaMap, FormField, FormState, RenderedField } from '../types.js';
export type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>;
export type ClientComponentProps = {
customComponents?: FormField['customComponents'];
field: ClientBlock | ClientField | ClientTab;
/**
* Controls the rendering behavior of the fields, i.e. defers rendering until they intersect with the viewport using the Intersection Observer API.
*
* If true, the fields will be rendered immediately, rather than waiting for them to intersect with the viewport.
*
* If a number is provided, will immediately render fields _up to that index_.
*/
forceRender?: boolean;
permissions?: SanitizedFieldPermissions;
readOnly?: boolean;
renderedBlocks?: RenderedField[];
/**
* Used to extract field configs from a schemaMap.
* Does not include indexes.
*
* @default field.name
**/
schemaPath?: string;
};
export type FieldPaths = {
/**
* @default ''
*/
indexPath?: string;
/**
* @default ''
*/
parentPath?: string;
/**
* The path built up to the point of the field
* excluding the field name.
*
* @default ''
*/
parentSchemaPath?: string;
/**
* A built up path to access FieldState in the form state.
* Nested fields will have a path that includes the parent field names
* if they are nested within a group, array, block or named tab.
*
* Collapsibles and unnamed tabs will have arbitrary paths
* that look like _index-0, _index-1, etc.
*
* Row fields will not have a path.
*
* @example 'parentGroupField.childTextField'
*
* @default field.name
*/
path: string;
};
/**
* TODO: This should be renamed to `FieldComponentServerProps` or similar
*/
export type ServerComponentProps = {
clientField: ClientFieldWithOptionalType;
clientFieldSchemaMap: ClientFieldSchemaMap;
collectionSlug: string;
data: Data;
field: Field;
/**
* The fieldSchemaMap that is created before form state is built is made available here.
*/
fieldSchemaMap: FieldSchemaMap;
/**
* Server Components will also have available to the entire form state.
* We cannot add it to ClientComponentProps as that would blow up the size of the props sent to the client.
*/
formState: FormState;
i18n: I18nClient;
id?: number | string;
operation: Operation;
payload: Payload;
permissions: SanitizedFieldPermissions;
preferences: DocumentPreferences;
req: PayloadRequest;
siblingData: Data;
user: TypedUser;
value?: unknown;
};
export type ClientFieldBase<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = {
readonly field: TFieldClient;
} & Omit<ClientComponentProps, 'customComponents' | 'field'>;
export type ServerFieldBase<TFieldServer extends Field = Field, TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = {
readonly clientField: TFieldClient;
readonly field: TFieldServer;
} & Omit<ClientComponentProps, 'field'> & Omit<ServerComponentProps, 'clientField' | 'field'>;
export type FieldClientComponent<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType, AdditionalProps extends Record<string, unknown> = Record<string, unknown>> = React.ComponentType<AdditionalProps & ClientFieldBase<TFieldClient>>;
export type FieldServerComponent<TFieldServer extends Field = Field, TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType, AdditionalProps extends Record<string, unknown> = Record<string, unknown>> = React.ComponentType<AdditionalProps & ServerFieldBase<TFieldServer, TFieldClient>>;
//# sourceMappingURL=Field.d.ts.map

View File

@@ -0,0 +1,35 @@
"use strict";
exports.endOfYesterday = endOfYesterday;
var _index = require("./constructFrom.cjs");
var _index2 = require("./constructNow.cjs");
/**
* The {@link endOfYesterday} function options.
*/
/**
* @name endOfYesterday
* @category Day Helpers
* @summary Return the end of yesterday.
* @pure false
*
* @description
* Return the end of yesterday.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @returns The end of yesterday
*
* @example
* // If today is 6 October 2014:
* const result = endOfYesterday()
* //=> Sun Oct 5 2014 23:59:59.999
*/
function endOfYesterday(options) {
const now = (0, _index2.constructNow)(options?.in);
const date = (0, _index.constructFrom)(options?.in, 0);
date.setFullYear(now.getFullYear(), now.getMonth(), now.getDate() - 1);
date.setHours(23, 59, 59, 999);
return date;
}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"logError.d.ts","sourceRoot":"","sources":["../../src/utilities/logError.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD,eAAO,MAAM,QAAQ,qBAAsB;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,KAAG,IAyB/E,CAAA"}

View File

@@ -0,0 +1,15 @@
import type { Locale } from "./types.js";
/**
* @category Locales
* @summary Turkish locale.
* @language Turkish
* @iso-639-2 tur
* @author Alpcan Aydın [@alpcanaydin](https://github.com/alpcanaydin)
* @author Berkay Sargın [@berkaey](https://github.com/berkaey)
* @author Fatih Bulut [@bulutfatih](https://github.com/bulutfatih)
* @author Ismail Demirbilek [@dbtek](https://github.com/dbtek)
* @author İsmail Kayar [@ikayar](https://github.com/ikayar)
*
*
*/
export declare const tr: Locale;

View File

@@ -0,0 +1,118 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { Button } from '../../Button/index.js';
import { Thumbnail } from '../../Thumbnail/index.js';
import './index.scss';
const baseClass = 'file-details-draggable';
import { DraggableSortableItem } from '../../../elements/DraggableSortable/DraggableSortableItem/index.js';
import { DragHandleIcon } from '../../../icons/DragHandle/index.js';
import { EditIcon } from '../../../icons/Edit/index.js';
import { useDocumentDrawer } from '../../DocumentDrawer/index.js';
export const DraggableFileDetails = props => {
const $ = _c(20);
const {
collectionSlug,
doc,
hideRemoveFile,
imageCacheTag,
isSortable,
removeItem,
rowIndex,
uploadConfig
} = props;
const {
id,
filename,
thumbnailURL,
url
} = doc;
let t0;
if ($[0] !== collectionSlug || $[1] !== id) {
t0 = {
id,
collectionSlug
};
$[0] = collectionSlug;
$[1] = id;
$[2] = t0;
} else {
t0 = $[2];
}
const [DocumentDrawer, DocumentDrawerToggler] = useDocumentDrawer(t0);
let t1;
if ($[3] !== DocumentDrawer || $[4] !== DocumentDrawerToggler || $[5] !== collectionSlug || $[6] !== doc || $[7] !== filename || $[8] !== hideRemoveFile || $[9] !== imageCacheTag || $[10] !== isSortable || $[11] !== removeItem || $[12] !== rowIndex || $[13] !== thumbnailURL || $[14] !== uploadConfig || $[15] !== url) {
t1 = draggableSortableItemProps => _jsxs("div", {
className: [baseClass, draggableSortableItemProps && isSortable && `${baseClass}--has-drag-handle`].filter(Boolean).join(" "),
ref: draggableSortableItemProps.setNodeRef,
style: {
transform: draggableSortableItemProps.transform,
transition: draggableSortableItemProps.transition,
zIndex: draggableSortableItemProps.isDragging ? 1 : undefined
},
children: [_jsxs("div", {
className: `${baseClass}--drag-wrapper`,
children: [isSortable && draggableSortableItemProps && _jsx("div", {
className: `${baseClass}__drag`,
...draggableSortableItemProps.attributes,
...draggableSortableItemProps.listeners,
children: _jsx(DragHandleIcon, {})
}), _jsx(Thumbnail, {
className: `${baseClass}__thumbnail`,
collectionSlug,
doc,
fileSrc: thumbnailURL || url,
imageCacheTag,
uploadConfig
})]
}), _jsx("div", {
className: `${baseClass}__main-detail`,
children: filename
}), _jsxs("div", {
className: `${baseClass}__actions`,
children: [_jsx(DocumentDrawer, {}), _jsx(DocumentDrawerToggler, {
children: _jsx(EditIcon, {})
}), !hideRemoveFile && removeItem && _jsx(Button, {
buttonStyle: "icon-label",
className: `${baseClass}__remove`,
icon: "x",
iconStyle: "none",
onClick: () => removeItem(rowIndex),
round: true
})]
})]
});
$[3] = DocumentDrawer;
$[4] = DocumentDrawerToggler;
$[5] = collectionSlug;
$[6] = doc;
$[7] = filename;
$[8] = hideRemoveFile;
$[9] = imageCacheTag;
$[10] = isSortable;
$[11] = removeItem;
$[12] = rowIndex;
$[13] = thumbnailURL;
$[14] = uploadConfig;
$[15] = url;
$[16] = t1;
} else {
t1 = $[16];
}
let t2;
if ($[17] !== id || $[18] !== t1) {
t2 = _jsx(DraggableSortableItem, {
id,
children: t1
}, id);
$[17] = id;
$[18] = t1;
$[19] = t2;
} else {
t2 = $[19];
}
return t2;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,70 @@
// lib/types/utils.ts
var decoder = new TextDecoder();
var toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
// lib/types/pnm.ts
var PNMTypes = {
P1: "pbm/ascii",
P2: "pgm/ascii",
P3: "ppm/ascii",
P4: "pbm",
P5: "pgm",
P6: "ppm",
P7: "pam",
PF: "pfm"
};
var handlers = {
default: (lines) => {
let dimensions = [];
while (lines.length > 0) {
const line = lines.shift();
if (line[0] === "#") {
continue;
}
dimensions = line.split(" ");
break;
}
if (dimensions.length === 2) {
return {
height: Number.parseInt(dimensions[1], 10),
width: Number.parseInt(dimensions[0], 10)
};
}
throw new TypeError("Invalid PNM");
},
pam: (lines) => {
const size = {};
while (lines.length > 0) {
const line = lines.shift();
if (line.length > 16 || line.charCodeAt(0) > 128) {
continue;
}
const [key, value] = line.split(" ");
if (key && value) {
size[key.toLowerCase()] = Number.parseInt(value, 10);
}
if (size.height && size.width) {
break;
}
}
if (size.height && size.width) {
return {
height: size.height,
width: size.width
};
}
throw new TypeError("Invalid PAM");
}
};
var PNM = {
validate: (input) => toUTF8String(input, 0, 2) in PNMTypes,
calculate(input) {
const signature = toUTF8String(input, 0, 2);
const type = PNMTypes[signature];
const lines = toUTF8String(input, 3).split(/[\r\n]+/);
const handler = handlers[type] || handlers.default;
return handler(lines);
}
};
export { PNM };

View File

@@ -0,0 +1,54 @@
{
"name": "@emotion/serialize",
"version": "1.3.3",
"description": "serialization utils for emotion",
"main": "dist/emotion-serialize.cjs.js",
"module": "dist/emotion-serialize.esm.js",
"types": "dist/emotion-serialize.cjs.d.ts",
"license": "MIT",
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/serialize",
"publishConfig": {
"access": "public"
},
"scripts": {
"test:typescript": "dtslint types"
},
"dependencies": {
"@emotion/hash": "^0.9.2",
"@emotion/memoize": "^0.9.0",
"@emotion/unitless": "^0.10.0",
"@emotion/utils": "^1.4.2",
"csstype": "^3.0.2"
},
"devDependencies": {
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^5.4.5"
},
"files": [
"src",
"dist"
],
"exports": {
".": {
"types": {
"import": "./dist/emotion-serialize.cjs.mjs",
"default": "./dist/emotion-serialize.cjs.js"
},
"development": {
"module": "./dist/emotion-serialize.development.esm.js",
"import": "./dist/emotion-serialize.development.cjs.mjs",
"default": "./dist/emotion-serialize.development.cjs.js"
},
"module": "./dist/emotion-serialize.esm.js",
"import": "./dist/emotion-serialize.cjs.mjs",
"default": "./dist/emotion-serialize.cjs.js"
},
"./package.json": "./package.json"
},
"imports": {
"#is-development": {
"development": "./src/conditions/true.ts",
"default": "./src/conditions/false.ts"
}
}
}

View File

@@ -0,0 +1,30 @@
var baseRange = require('./_baseRange'),
isIterateeCall = require('./_isIterateeCall'),
toFinite = require('./toFinite');
/**
* Creates a `_.range` or `_.rangeRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new range function.
*/
function createRange(fromRight) {
return function(start, end, step) {
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
end = step = undefined;
}
// Ensure the sign of `-0` is preserved.
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
return baseRange(start, end, step, fromRight);
};
}
module.exports = createRange;

View File

@@ -0,0 +1,214 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const fs = require('fs');
const module$1 = require('module');
const path = require('path');
/**
* Returns the version of Next.js installed in the project, or undefined if it cannot be determined.
*/
function getNextjsVersion() {
const nextjsPackageJsonPath = resolveNextjsPackageJson();
if (nextjsPackageJsonPath) {
try {
const nextjsPackageJson = JSON.parse(
fs.readFileSync(nextjsPackageJsonPath, { encoding: 'utf-8' }),
);
return nextjsPackageJson.version;
} catch {
// noop
}
}
return undefined;
}
function resolveNextjsPackageJson() {
try {
return module$1.createRequire(`${process.cwd()}/`).resolve('next/package.json');
} catch {
return undefined;
}
}
/**
* Checks if the current Next.js version supports the runAfterProductionCompile hook.
* This hook was introduced in Next.js 15.4.1. (https://github.com/vercel/next.js/pull/77345)
*
* @param version - version string to check.
* @returns true if Next.js version is 15.4.1 or higher
*/
function supportsProductionCompileHook(version) {
const versionToCheck = version;
if (!versionToCheck) {
return false;
}
const { major, minor, patch } = core.parseSemver(versionToCheck);
if (major === undefined || minor === undefined || patch === undefined) {
return false;
}
if (major > 15) {
return true;
}
// For major version 15, check if it's 15.4.1 or higher
if (major === 15) {
if (minor > 4) {
return true;
}
if (minor === 4 && patch >= 1) {
return true;
}
return false;
}
return false;
}
/**
* Checks if the current Next.js version supports native debug ids for turbopack.
* This feature was first introduced in Next.js v15.6.0-canary.36 and marked stable in Next.js v16
*
* @param version - version string to check.
* @returns true if Next.js version supports native debug ids for turbopack builds
*/
function supportsNativeDebugIds(version) {
if (!version) {
return false;
}
const { major, minor, prerelease } = core.parseSemver(version);
if (major === undefined || minor === undefined) {
return false;
}
// Next.js 16+ supports native debug ids
if (major >= 16) {
return true;
}
// For Next.js 15, check if it's 15.6.0-canary.36+
if (major === 15 && prerelease?.startsWith('canary.')) {
// Any canary version 15.7+ supports native debug ids
if (minor > 6) {
return true;
}
// For 15.6 canary versions, check if it's canary.36 or higher
if (minor === 6) {
const canaryNumber = parseInt(prerelease.split('.')[1] || '0', 10);
if (canaryNumber >= 36) {
return true;
}
}
}
return false;
}
/**
* Checks if the given Next.js version requires the `experimental.instrumentationHook` option.
* Next.js 15.0.0 and higher (including certain RC and canary versions) no longer require this option
* and will print a warning if it is set.
*
* @param version - version string to check.
* @returns true if the version requires the instrumentationHook option to be set
*/
function requiresInstrumentationHook(version) {
if (!version) {
return true; // Default to requiring it if version cannot be determined
}
const { major, minor, patch, prerelease } = core.parseSemver(version);
if (major === undefined || minor === undefined || patch === undefined) {
return true; // Default to requiring it if parsing fails
}
// Next.js 16+ never requires the hook
if (major >= 16) {
return false;
}
// Next.js 14 and below always require the hook
if (major < 15) {
return true;
}
// At this point, we know it's Next.js 15.x.y
// Stable releases (15.0.0+) don't require the hook
if (!prerelease) {
return false;
}
// Next.js 15.x.y with x > 0 or y > 0 don't require the hook
if (minor > 0 || patch > 0) {
return false;
}
// Check specific prerelease versions that don't require the hook
if (prerelease.startsWith('rc.')) {
const rcNumber = parseInt(prerelease.split('.')[1] || '0', 10);
return rcNumber === 0; // Only rc.0 requires the hook
}
if (prerelease.startsWith('canary.')) {
const canaryNumber = parseInt(prerelease.split('.')[1] || '0', 10);
return canaryNumber < 124; // canary.124+ doesn't require the hook
}
// All other 15.0.0 prerelease versions (alpha, beta, etc.) require the hook
return true;
}
/**
* Determines which bundler is actually being used based on environment variables,
* and CLI flags.
*
* @returns 'turbopack' or 'webpack'
*/
function detectActiveBundler() {
const turbopackEnv = process.env.TURBOPACK;
// Check if TURBOPACK env var is set to a truthy value (excluding falsy strings like 'false', '0', '')
const isTurbopackEnabled = turbopackEnv && turbopackEnv !== 'false' && turbopackEnv !== '0';
if (isTurbopackEnabled || process.argv.includes('--turbo')) {
return 'turbopack';
} else {
return 'webpack';
}
}
/**
* Extract modules from project directory's package.json
*/
function getPackageModules(projectDir) {
try {
const packageJson = path.join(projectDir, 'package.json');
const packageJsonContent = fs.readFileSync(packageJson, 'utf8');
const packageJsonObject = JSON.parse(packageJsonContent)
;
return {
...packageJsonObject.dependencies,
...packageJsonObject.devDependencies,
};
} catch {
return {};
}
}
exports.detectActiveBundler = detectActiveBundler;
exports.getNextjsVersion = getNextjsVersion;
exports.getPackageModules = getPackageModules;
exports.requiresInstrumentationHook = requiresInstrumentationHook;
exports.supportsNativeDebugIds = supportsNativeDebugIds;
exports.supportsProductionCompileHook = supportsProductionCompileHook;
//# sourceMappingURL=util.js.map

View File

@@ -0,0 +1,101 @@
import type { ClientCollectionConfig, ClientGlobalConfig, ClientUser, Data, DocumentPreferences, FormState, InsideFieldsPreferences, SanitizedCollectionConfig, SanitizedDocumentPermissions, SanitizedGlobalConfig, TypedUser } from 'payload';
import React from 'react';
import type { GetDocPermissions } from './useGetDocPermissions.js';
export type DocumentInfoProps = {
readonly action?: string;
readonly AfterDocument?: React.ReactNode;
readonly AfterFields?: React.ReactNode;
readonly apiURL?: string;
readonly BeforeFields?: React.ReactNode;
readonly collectionSlug?: SanitizedCollectionConfig['slug'];
readonly currentEditor: TypedUser;
readonly disableActions?: boolean;
readonly disableCreate?: boolean;
readonly disableLeaveWithoutSaving?: boolean;
readonly docPermissions?: SanitizedDocumentPermissions;
readonly globalSlug?: SanitizedGlobalConfig['slug'];
readonly hasPublishedDoc: boolean;
readonly hasPublishPermission?: boolean;
readonly hasSavePermission?: boolean;
readonly id?: number | string;
readonly initialData?: Data;
readonly initialState?: FormState;
readonly isEditing?: boolean;
readonly isLocked: boolean;
readonly isTrashed?: boolean;
readonly lastUpdateTime: number;
readonly mostRecentVersionIsAutosaved: boolean;
readonly redirectAfterCreate?: boolean;
readonly redirectAfterDelete?: boolean;
readonly redirectAfterDuplicate?: boolean;
readonly redirectAfterRestore?: boolean;
readonly unpublishedVersionCount: number;
readonly Upload?: React.ReactNode;
readonly versionCount: number;
};
export type DocumentInfoContext = {
currentEditor?: ClientUser | null | number | string;
data?: Data;
docConfig?: ClientCollectionConfig | ClientGlobalConfig;
documentIsLocked?: boolean;
documentLockState: React.RefObject<{
hasShownLockedModal: boolean;
isLocked: boolean;
user: ClientUser | number | string;
} | null>;
getDocPermissions: GetDocPermissions;
getDocPreferences: () => Promise<DocumentPreferences>;
incrementVersionCount: () => void;
isInitializing: boolean;
preferencesKey?: string;
/**
* @deprecated This property is deprecated and will be removed in v4.
* Use `data` instead.
*/
savedDocumentData?: Data;
setCurrentEditor?: React.Dispatch<React.SetStateAction<ClientUser>>;
setData: (data: Data) => void;
setDocFieldPreferences: (field: string, fieldPreferences: {
[key: string]: unknown;
} & Partial<InsideFieldsPreferences>) => void;
setDocumentIsLocked?: React.Dispatch<React.SetStateAction<boolean>>;
/**
* @deprecated This property is deprecated and will be removed in v4.
* This is for performance reasons. Use the `DocumentTitleContext` instead
* via the `useDocumentTitle` hook.
* @example
* ```tsx
* import { useDocumentTitle } from '@payloadcms/ui'
* const { setDocumentTitle } = useDocumentTitle()
* ```
*/
setDocumentTitle: React.Dispatch<React.SetStateAction<string>>;
setHasPublishedDoc: React.Dispatch<React.SetStateAction<boolean>>;
setLastUpdateTime: React.Dispatch<React.SetStateAction<number>>;
setMostRecentVersionIsAutosaved: React.Dispatch<React.SetStateAction<boolean>>;
setUnpublishedVersionCount: React.Dispatch<React.SetStateAction<number>>;
setUploadStatus?: (status: 'failed' | 'idle' | 'uploading') => void;
/**
* @deprecated This property is deprecated and will be removed in v4.
* This is for performance reasons. Use the `DocumentTitleContext` instead
* via the `useDocumentTitle` hook.
* @example
* ```tsx
* import { useDocumentTitle } from '@payloadcms/ui'
* const { title } = useDocumentTitle()
* ```
*/
title: string;
unlockDocument: (docID: number | string, slug: string) => Promise<void>;
unpublishedVersionCount: number;
updateDocumentEditor: (docID: number | string, slug: string, user: ClientUser) => Promise<void>;
/**
* @deprecated This property is deprecated and will be removed in v4.
* Use `setData` instead.
*/
updateSavedDocumentData: (data: Data) => void;
uploadStatus?: 'failed' | 'idle' | 'uploading';
versionCount: number;
} & DocumentInfoProps;
export declare const DocumentTitleContext: React.Context<string>;
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/views/CreateFirstUser/index.client.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,SAAS,CAAA;AAgBhB,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC3C,cAAc,EAAE,4BAA4B,CAAA;IAC5C,cAAc,EAAE,mBAAmB,CAAA;IACnC,YAAY,EAAE,SAAS,CAAA;IACvB,iBAAiB,CAAC,EAAE,KAAK,GAAG,wBAAwB,CAAA;IACpD,QAAQ,EAAE,MAAM,CAAA;CACjB,CAsGA,CAAA"}

View File

@@ -0,0 +1,51 @@
import digest from '../runtime/digest.js';
export const encoder = new TextEncoder();
export const decoder = new TextDecoder();
const MAX_INT32 = 2 ** 32;
export function concat(...buffers) {
const size = buffers.reduce((acc, { length }) => acc + length, 0);
const buf = new Uint8Array(size);
let i = 0;
for (const buffer of buffers) {
buf.set(buffer, i);
i += buffer.length;
}
return buf;
}
export function p2s(alg, p2sInput) {
return concat(encoder.encode(alg), new Uint8Array([0]), p2sInput);
}
function writeUInt32BE(buf, value, offset) {
if (value < 0 || value >= MAX_INT32) {
throw new RangeError(`value must be >= 0 and <= ${MAX_INT32 - 1}. Received ${value}`);
}
buf.set([value >>> 24, value >>> 16, value >>> 8, value & 0xff], offset);
}
export function uint64be(value) {
const high = Math.floor(value / MAX_INT32);
const low = value % MAX_INT32;
const buf = new Uint8Array(8);
writeUInt32BE(buf, high, 0);
writeUInt32BE(buf, low, 4);
return buf;
}
export function uint32be(value) {
const buf = new Uint8Array(4);
writeUInt32BE(buf, value);
return buf;
}
export function lengthAndInput(input) {
return concat(uint32be(input.length), input);
}
export async function concatKdf(secret, bits, value) {
const iterations = Math.ceil((bits >> 3) / 32);
const res = new Uint8Array(iterations * 32);
for (let iter = 0; iter < iterations; iter++) {
const buf = new Uint8Array(4 + secret.length + value.length);
buf.set(uint32be(iter + 1));
buf.set(secret, 4);
buf.set(value, 4 + secret.length);
res.set(await digest('sha256', buf), iter * 32);
}
return res.slice(0, bits >> 3);
}

View File

@@ -0,0 +1,13 @@
import * as react from 'react';
// @ts-expect-error -- Ooof, Next.js doesn't make this easy.
// `use` is only available in React 19 canary, but we can
// use it in Next.js already as Next.js "vendors" a fixed
// version of React. However, if we'd simply put `use` in
// ESM code, then the build doesn't work since React does
// not export `use` officially. Therefore, we have to use
// something that is not statically analyzable. Once React
// 19 is out, we can remove this in the next major version.
var use = react['use'.trim()];
export { use as default };

View File

@@ -0,0 +1,116 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var driver_exports = {};
__export(driver_exports, {
PostgresJsDatabase: () => PostgresJsDatabase,
drizzle: () => drizzle
});
module.exports = __toCommonJS(driver_exports);
var import_postgres = __toESM(require("postgres"), 1);
var import_entity = require("../entity.cjs");
var import_logger = require("../logger.cjs");
var import_db = require("../pg-core/db.cjs");
var import_dialect = require("../pg-core/dialect.cjs");
var import_relations = require("../relations.cjs");
var import_utils = require("../utils.cjs");
var import_session = require("./session.cjs");
class PostgresJsDatabase extends import_db.PgDatabase {
static [import_entity.entityKind] = "PostgresJsDatabase";
}
function construct(client, config = {}) {
const transparentParser = (val) => val;
for (const type of ["1184", "1082", "1083", "1114", "1182", "1185", "1115", "1231"]) {
client.options.parsers[type] = transparentParser;
client.options.serializers[type] = transparentParser;
}
client.options.serializers["114"] = transparentParser;
client.options.serializers["3802"] = transparentParser;
const dialect = new import_dialect.PgDialect({ casing: config.casing });
let logger;
if (config.logger === true) {
logger = new import_logger.DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
let schema;
if (config.schema) {
const tablesConfig = (0, import_relations.extractTablesRelationalConfig)(
config.schema,
import_relations.createTableRelationsHelpers
);
schema = {
fullSchema: config.schema,
schema: tablesConfig.tables,
tableNamesMap: tablesConfig.tableNamesMap
};
}
const session = new import_session.PostgresJsSession(client, dialect, schema, { logger, cache: config.cache });
const db = new PostgresJsDatabase(dialect, session, schema);
db.$client = client;
db.$cache = config.cache;
if (db.$cache) {
db.$cache["invalidate"] = config.cache?.onMutate;
}
return db;
}
function drizzle(...params) {
if (typeof params[0] === "string") {
const instance = (0, import_postgres.default)(params[0]);
return construct(instance, params[1]);
}
if ((0, import_utils.isConfig)(params[0])) {
const { connection, client, ...drizzleConfig } = params[0];
if (client) return construct(client, drizzleConfig);
if (typeof connection === "object" && connection.url !== void 0) {
const { url, ...config } = connection;
const instance2 = (0, import_postgres.default)(url, config);
return construct(instance2, drizzleConfig);
}
const instance = (0, import_postgres.default)(connection);
return construct(instance, drizzleConfig);
}
return construct(params[0], params[1]);
}
((drizzle2) => {
function mock(config) {
return construct({
options: {
parsers: {},
serializers: {}
}
}, config);
}
drizzle2.mock = mock;
})(drizzle || (drizzle = {}));
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PostgresJsDatabase,
drizzle
});
//# sourceMappingURL=driver.cjs.map

View File

@@ -0,0 +1,60 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/* eslint-disable jsdoc/require-jsdoc */
/*
* Copyright 2024 Google LLC
*
* 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.
*/
class LayoutShiftManager {constructor() { LayoutShiftManager.prototype.__init.call(this);LayoutShiftManager.prototype.__init2.call(this); }
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
// eslint-disable-next-line @sentry-internal/sdk/no-class-field-initializers, @typescript-eslint/explicit-member-accessibility
__init() {this._sessionValue = 0;}
// eslint-disable-next-line @sentry-internal/sdk/no-class-field-initializers, @typescript-eslint/explicit-member-accessibility
__init2() {this._sessionEntries = [];}
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
_processEntry(entry) {
// Only count layout shifts without recent user input.
if (entry.hadRecentInput) return;
const firstSessionEntry = this._sessionEntries[0];
// This previously used `this._sessionEntries.at(-1)` but that is ES2022. We support ES2021 and earlier.
const lastSessionEntry = this._sessionEntries[this._sessionEntries.length - 1];
// If the entry occurred less than 1 second after the previous entry
// and less than 5 seconds after the first entry in the session,
// include the entry in the current session. Otherwise, start a new
// session.
if (
this._sessionValue &&
firstSessionEntry &&
lastSessionEntry &&
entry.startTime - lastSessionEntry.startTime < 1000 &&
entry.startTime - firstSessionEntry.startTime < 5000
) {
this._sessionValue += entry.value;
this._sessionEntries.push(entry);
} else {
this._sessionValue = entry.value;
this._sessionEntries = [entry];
}
this._onAfterProcessingUnexpectedShift?.(entry);
}
}
exports.LayoutShiftManager = LayoutShiftManager;
//# sourceMappingURL=LayoutShiftManager.js.map

View File

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

View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict'
const LexicalHistory = process.env.NODE_ENV !== 'production' ? require('./LexicalHistory.dev.js') : require('./LexicalHistory.prod.js');
module.exports = LexicalHistory;

View File

@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const FileBadge = createLucideIcon("FileBadge", [
["path", { d: "M12 22h6a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3", key: "12ixgl" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["path", { d: "M5 17a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z", key: "u0c8gj" }],
["path", { d: "M7 16.5 8 22l-3-1-3 1 1-5.5", key: "5gm2nr" }]
]);
export { FileBadge as default };
//# sourceMappingURL=file-badge.js.map

View File

@@ -0,0 +1,34 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { flattenTopLevelFields } from 'payload/shared';
import { useTranslation } from '../providers/Translation/index.js';
export const useUseTitleField = collection => {
const $ = _c(4);
const {
admin: t0,
fields
} = collection;
const {
useAsTitle
} = t0;
const {
i18n
} = useTranslation();
let t1;
if ($[0] !== fields || $[1] !== i18n || $[2] !== useAsTitle) {
const topLevelFields = flattenTopLevelFields(fields, {
i18n,
moveSubFieldsToTop: true
});
t1 = topLevelFields?.find(field => "name" in field && field.name === useAsTitle);
$[0] = fields;
$[1] = i18n;
$[2] = useAsTitle;
$[3] = t1;
} else {
t1 = $[3];
}
return t1;
};
//# sourceMappingURL=useUseAsTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/index.ts"],"names":[],"mappings":";;AACA,mEAA2D;AAC3D,yDAAiD;AAEjD,MAAM,WAAW,GAAe,CAAC,+BAAqB,EAAE,0BAAgB,CAAC,CAAA;AAEzE,kBAAe,WAAW,CAAA"}

View File

@@ -0,0 +1,42 @@
'use strict'
let Warning = require('./warning')
class Result {
constructor(processor, root, opts) {
this.processor = processor
this.messages = []
this.root = root
this.opts = opts
this.css = undefined
this.map = undefined
}
toString() {
return this.css
}
warn(text, opts = {}) {
if (!opts.plugin) {
if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
opts.plugin = this.lastPlugin.postcssPlugin
}
}
let warning = new Warning(text, opts)
this.messages.push(warning)
return warning
}
warnings() {
return this.messages.filter(i => i.type === 'warning')
}
get content() {
return this.css
}
}
module.exports = Result
Result.default = Result

View File

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

View File

@@ -0,0 +1,98 @@
(function (Prism) {
// Many of the following regexes will contain negated lookaheads like `[ \t]+(?![ \t])`. This is a trick to ensure
// that quantifiers behave *atomically*. Atomic quantifiers are necessary to prevent exponential backtracking.
var spaceAfterBackSlash = /\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source;
// At least one space, comment, or line break
var space = /(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source
.replace(/<SP_BS>/g, function () { return spaceAfterBackSlash; });
var string = /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source;
var option = /--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g, function () { return string; });
var stringRule = {
pattern: RegExp(string),
greedy: true
};
var commentRule = {
pattern: /(^[ \t]*)#.*/m,
lookbehind: true,
greedy: true
};
/**
* @param {string} source
* @param {string} flags
* @returns {RegExp}
*/
function re(source, flags) {
source = source
.replace(/<OPT>/g, function () { return option; })
.replace(/<SP>/g, function () { return space; });
return RegExp(source, flags);
}
Prism.languages.docker = {
'instruction': {
pattern: /(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,
lookbehind: true,
greedy: true,
inside: {
'options': {
pattern: re(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source, 'i'),
lookbehind: true,
greedy: true,
inside: {
'property': {
pattern: /(^|\s)--[\w-]+/,
lookbehind: true
},
'string': [
stringRule,
{
pattern: /(=)(?!["'])(?:[^\s\\]|\\.)+/,
lookbehind: true
}
],
'operator': /\\$/m,
'punctuation': /=/
}
},
'keyword': [
{
// https://docs.docker.com/engine/reference/builder/#healthcheck
pattern: re(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source, 'i'),
lookbehind: true,
greedy: true
},
{
// https://docs.docker.com/engine/reference/builder/#from
pattern: re(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source, 'i'),
lookbehind: true,
greedy: true
},
{
// https://docs.docker.com/engine/reference/builder/#onbuild
pattern: re(/(^ONBUILD<SP>)\w+/.source, 'i'),
lookbehind: true,
greedy: true
},
{
pattern: /^\w+/,
greedy: true
}
],
'comment': commentRule,
'string': stringRule,
'variable': /\$(?:\w+|\{[^{}"'\\]*\})/,
'operator': /\\$/m
}
},
'comment': commentRule
};
Prism.languages.dockerfile = Prism.languages.docker;
}(Prism));

View File

@@ -0,0 +1,116 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "字符", verb: "包含" },
file: { unit: "字节", verb: "包含" },
array: { unit: "项", verb: "包含" },
set: { unit: "项", verb: "包含" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "非数字(NaN)" : "数字";
}
case "object": {
if (Array.isArray(data)) {
return "数组";
}
if (data === null) {
return "空值(null)";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "输入",
email: "电子邮件",
url: "URL",
emoji: "表情符号",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO日期时间",
date: "ISO日期",
time: "ISO时间",
duration: "ISO时长",
ipv4: "IPv4地址",
ipv6: "IPv6地址",
cidrv4: "IPv4网段",
cidrv6: "IPv6网段",
base64: "base64编码字符串",
base64url: "base64url编码字符串",
json_string: "JSON字符串",
e164: "E.164号码",
jwt: "JWT",
template_literal: "输入",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `无效输入:期望 ${issue.expected},实际接收 ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `无效输入:期望 ${util.stringifyPrimitive(issue.values[0])}`;
return `无效选项:期望以下之一 ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "个元素"}`;
return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `无效字符串:必须以 "${_issue.prefix}" 开头`;
if (_issue.format === "ends_with")
return `无效字符串:必须以 "${_issue.suffix}" 结尾`;
if (_issue.format === "includes")
return `无效字符串:必须包含 "${_issue.includes}"`;
if (_issue.format === "regex")
return `无效字符串:必须满足正则表达式 ${_issue.pattern}`;
return `无效${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `无效数字:必须是 ${issue.divisor} 的倍数`;
case "unrecognized_keys":
return `出现未知的键(key): ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `${issue.origin} 中的键(key)无效`;
case "invalid_union":
return "无效输入";
case "invalid_element":
return `${issue.origin} 中包含无效值(value)`;
default:
return `无效输入`;
}
};
};
export default function () {
return {
localeError: error(),
};
}

View File

@@ -0,0 +1,17 @@
/**
* 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';
/**
* Place one or multiple newly created Nodes at the current selection. Multiple
* nodes will only be created when the selection spans multiple lines (aka
* client rects).
*
* This function can come useful when you want to show the selection but the
* editor has been focused away.
*/
export default function markSelection(editor: LexicalEditor, onReposition?: (node: Array<HTMLElement>) => void): () => void;

View File

@@ -0,0 +1,6 @@
export { useWindowInfo } from './useWindowInfo/index.js';
export { WindowInfo } from './WindowInfo/index.js';
export { WindowInfoContext } from './WindowInfoProvider/context.js';
export { WindowInfoProvider } from './WindowInfoProvider/index.js';
export { withWindowInfo } from './withWindowInfo/index.js';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/Nav/NavHamburger/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAeA,CAAA"}

View File

@@ -0,0 +1,3 @@
export declare const VERSION: string;
export declare const NAME: string;
export declare const MODULE_NAME = "@prisma/client";

View File

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

View File

@@ -0,0 +1,67 @@
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
/**
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
*/
exports.encode = function (number) {
if (0 <= number && number < intToCharMap.length) {
return intToCharMap[number];
}
throw new TypeError("Must be between 0 and 63: " + number);
};
/**
* Decode a single base 64 character code digit to an integer. Returns -1 on
* failure.
*/
exports.decode = function (charCode) {
var bigA = 65; // 'A'
var bigZ = 90; // 'Z'
var littleA = 97; // 'a'
var littleZ = 122; // 'z'
var zero = 48; // '0'
var nine = 57; // '9'
var plus = 43; // '+'
var slash = 47; // '/'
var littleOffset = 26;
var numberOffset = 52;
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
if (bigA <= charCode && charCode <= bigZ) {
return (charCode - bigA);
}
// 26 - 51: abcdefghijklmnopqrstuvwxyz
if (littleA <= charCode && charCode <= littleZ) {
return (charCode - littleA + littleOffset);
}
// 52 - 61: 0123456789
if (zero <= charCode && charCode <= nine) {
return (charCode - zero + numberOffset);
}
// 62: +
if (charCode == plus) {
return 62;
}
// 63: /
if (charCode == slash) {
return 63;
}
// Invalid base64 digit.
return -1;
};

View File

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

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