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,47 @@
import { jobsCollectionSlug } from '../queues/config/collection.js';
export const deleteScheduledPublishJobs = async ({ id, slug, payload, req })=>{
try {
await payload.db.deleteMany({
collection: jobsCollectionSlug,
req,
where: {
and: [
// only want to delete jobs have not run yet
{
completedAt: {
exists: false
}
},
{
processing: {
equals: false
}
},
{
'input.doc.value': {
equals: id
}
},
{
'input.doc.relationTo': {
equals: slug
}
},
// data.type narrows scheduled publish jobs in case of another job having input.doc.value
{
taskSlug: {
equals: 'schedulePublish'
}
}
]
}
});
} catch (err) {
payload.logger.error({
err,
msg: `There was an error deleting scheduled publish jobs from the queue for ${slug} document with ID ${id}.`
});
}
};
//# sourceMappingURL=deleteScheduledPublishJobs.js.map

View File

@@ -0,0 +1,252 @@
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
import { SDK_VERSION, getClient, handleCallbackErrors, addNonEnumerableProperty, getActiveSpan, _INTERNAL_getSpanForToolCallId, withScope, captureException, _INTERNAL_cleanupToolCallSpan } from '@sentry/core';
import { INTEGRATION_NAME } from './constants.js';
const SUPPORTED_VERSIONS = ['>=3.0.0 <7'];
// List of patched methods
// From: https://sdk.vercel.ai/docs/ai-sdk-core/telemetry#collected-data
const INSTRUMENTED_METHODS = [
'generateText',
'streamText',
'generateObject',
'streamObject',
'embed',
'embedMany',
'rerank',
] ;
function isToolError(obj) {
if (typeof obj !== 'object' || obj === null) {
return false;
}
const candidate = obj ;
return (
'type' in candidate &&
'error' in candidate &&
'toolName' in candidate &&
'toolCallId' in candidate &&
candidate.type === 'tool-error' &&
candidate.error instanceof Error
);
}
/**
* Check for tool errors in the result and capture them
* Tool errors are not rejected in Vercel V5, it is added as metadata to the result content
*/
function checkResultForToolErrors(result) {
if (typeof result !== 'object' || result === null || !('content' in result)) {
return;
}
const resultObj = result ;
if (!Array.isArray(resultObj.content)) {
return;
}
for (const item of resultObj.content) {
if (isToolError(item)) {
// Try to get the span associated with this tool call ID
const associatedSpan = _INTERNAL_getSpanForToolCallId(item.toolCallId) ;
if (associatedSpan) {
// We have the span, so link the error using span and trace IDs from the span
const spanContext = associatedSpan.spanContext();
withScope(scope => {
// Set the span and trace context for proper linking
scope.setContext('trace', {
trace_id: spanContext.traceId,
span_id: spanContext.spanId,
});
scope.setTag('vercel.ai.tool.name', item.toolName);
scope.setTag('vercel.ai.tool.callId', item.toolCallId);
scope.setLevel('error');
captureException(item.error, {
mechanism: {
type: 'auto.vercelai.otel',
handled: false,
},
});
});
// Clean up the span mapping since we've processed this tool error
// We won't get multiple { type: 'tool-error' } parts for the same toolCallId.
_INTERNAL_cleanupToolCallSpan(item.toolCallId);
} else {
// Fallback: capture without span linking
withScope(scope => {
scope.setTag('vercel.ai.tool.name', item.toolName);
scope.setTag('vercel.ai.tool.callId', item.toolCallId);
scope.setLevel('error');
captureException(item.error, {
mechanism: {
type: 'auto.vercelai.otel',
handled: false,
},
});
});
}
}
}
}
/**
* Determines whether to record inputs and outputs for Vercel AI telemetry based on the configuration hierarchy.
*
* The order of precedence is:
* 1. The vercel ai integration options
* 2. The experimental_telemetry options in the vercel ai method calls
* 3. When telemetry is explicitly enabled (isEnabled: true), default to recording
* 4. Otherwise, use the sendDefaultPii option from client options
*/
function determineRecordingSettings(
integrationRecordingOptions,
methodTelemetryOptions,
telemetryExplicitlyEnabled,
defaultRecordingEnabled,
) {
const recordInputs =
integrationRecordingOptions?.recordInputs !== undefined
? integrationRecordingOptions.recordInputs
: methodTelemetryOptions.recordInputs !== undefined
? methodTelemetryOptions.recordInputs
: telemetryExplicitlyEnabled === true
? true // When telemetry is explicitly enabled, default to recording inputs
: defaultRecordingEnabled;
const recordOutputs =
integrationRecordingOptions?.recordOutputs !== undefined
? integrationRecordingOptions.recordOutputs
: methodTelemetryOptions.recordOutputs !== undefined
? methodTelemetryOptions.recordOutputs
: telemetryExplicitlyEnabled === true
? true // When telemetry is explicitly enabled, default to recording inputs
: defaultRecordingEnabled;
return { recordInputs, recordOutputs };
}
/**
* This detects is added by the Sentry Vercel AI Integration to detect if the integration should
* be enabled.
*
* It also patches the `ai` module to enable Vercel AI telemetry automatically for all methods.
*/
class SentryVercelAiInstrumentation extends InstrumentationBase {
__init() {this._isPatched = false;}
__init2() {this._callbacks = [];}
constructor(config = {}) {
super('@sentry/instrumentation-vercel-ai', SDK_VERSION, config);SentryVercelAiInstrumentation.prototype.__init.call(this);SentryVercelAiInstrumentation.prototype.__init2.call(this); }
/**
* Initializes the instrumentation by defining the modules to be patched.
*/
init() {
const module = new InstrumentationNodeModuleDefinition('ai', SUPPORTED_VERSIONS, this._patch.bind(this));
return module;
}
/**
* Call the provided callback when the module is patched.
* If it has already been patched, the callback will be called immediately.
*/
callWhenPatched(callback) {
if (this._isPatched) {
callback();
} else {
this._callbacks.push(callback);
}
}
/**
* Patches module exports to enable Vercel AI telemetry.
*/
_patch(moduleExports) {
this._isPatched = true;
this._callbacks.forEach(callback => callback());
this._callbacks = [];
const generatePatch = (originalMethod) => {
return new Proxy(originalMethod, {
apply: (target, thisArg, args) => {
const existingExperimentalTelemetry = args[0].experimental_telemetry || {};
const isEnabled = existingExperimentalTelemetry.isEnabled;
const client = getClient();
const integration = client?.getIntegrationByName(INTEGRATION_NAME);
const integrationOptions = integration?.options;
const shouldRecordInputsAndOutputs = integration ? Boolean(client?.getOptions().sendDefaultPii) : false;
const { recordInputs, recordOutputs } = determineRecordingSettings(
integrationOptions,
existingExperimentalTelemetry,
isEnabled,
shouldRecordInputsAndOutputs,
);
args[0].experimental_telemetry = {
...existingExperimentalTelemetry,
isEnabled: isEnabled !== undefined ? isEnabled : true,
recordInputs,
recordOutputs,
};
return handleCallbackErrors(
() => Reflect.apply(target, thisArg, args),
error => {
// This error bubbles up to unhandledrejection handler (if not handled before),
// where we do not know the active span anymore
// So to circumvent this, we set the active span on the error object
// which is picked up by the unhandledrejection handler
if (error && typeof error === 'object') {
addNonEnumerableProperty(error, '_sentry_active_span', getActiveSpan());
}
},
() => {},
result => {
checkResultForToolErrors(result);
},
);
},
});
};
// Is this an ESM module?
// https://tc39.es/ecma262/#sec-module-namespace-objects
if (Object.prototype.toString.call(moduleExports) === '[object Module]') {
// In ESM we take the usual route and just replace the exports we want to instrument
for (const method of INSTRUMENTED_METHODS) {
// Skip methods that don't exist in this version of the AI SDK (e.g., rerank was added in v6)
if (moduleExports[method] != null) {
moduleExports[method] = generatePatch(moduleExports[method]);
}
}
return moduleExports;
} else {
// In CJS we can't replace the exports in the original module because they
// don't have setters, so we create a new object with the same properties
const patchedModuleExports = INSTRUMENTED_METHODS.reduce((acc, curr) => {
// Skip methods that don't exist in this version of the AI SDK (e.g., rerank was added in v6)
if (moduleExports[curr] != null) {
acc[curr] = generatePatch(moduleExports[curr]);
}
return acc;
}, {} );
return { ...moduleExports, ...patchedModuleExports };
}
}
}
export { SentryVercelAiInstrumentation, determineRecordingSettings };
//# sourceMappingURL=instrumentation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/gel-core/view-base.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport { type ColumnsSelection, View } from '~/sql/sql.ts';\n\nexport abstract class GelViewBase<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n\tTSelectedFields extends ColumnsSelection = ColumnsSelection,\n> extends View<TName, TExisting, TSelectedFields> {\n\tstatic override readonly [entityKind]: string = 'GelViewBase';\n\n\tdeclare readonly _: View<TName, TExisting, TSelectedFields>['_'] & {\n\t\treadonly viewBrand: 'GelViewBase';\n\t};\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AAC3B,SAAgC,YAAY;AAErC,MAAe,oBAIZ,KAAwC;AAAA,EACjD,QAA0B,UAAU,IAAY;AAKjD;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getFileByPath.d.ts","sourceRoot":"","sources":["../../src/uploads/getFileByPath.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAMvD,eAAO,MAAM,aAAa,aAAoB,MAAM,KAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAoBpF,CAAA"}

View File

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

View File

@@ -0,0 +1,20 @@
import type { Job } from '../../index.js';
import type { RetryConfig } from '../config/types/taskTypes.js';
/**
* Assuming there is no task that has already reached max retries,
* this function determines if the workflow should retry the job
* and if so, when it should retry.
*/
export declare function getWorkflowRetryBehavior({ job, retriesConfig, }: {
job: Job;
retriesConfig?: number | RetryConfig;
}): {
hasFinalError: false;
maxWorkflowRetries?: number;
waitUntil?: Date;
} | {
hasFinalError: true;
maxWorkflowRetries?: number;
waitUntil?: Date;
};
//# sourceMappingURL=getWorkflowRetryBehavior.d.ts.map

View File

@@ -0,0 +1,69 @@
Prism.languages.wgsl = {
'comment': {
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
greedy: true,
},
'builtin-attribute': {
pattern: /(@)builtin\(.*?\)/,
lookbehind: true,
inside: {
'attribute': {
pattern: /^builtin/,
alias: 'attr-name',
},
'punctuation': /[(),]/,
'built-in-values': {
pattern: /\b(?:frag_depth|front_facing|global_invocation_id|instance_index|local_invocation_id|local_invocation_index|num_workgroups|position|sample_index|sample_mask|vertex_index|workgroup_id)\b/,
alias: 'attr-value',
},
},
},
'attributes': {
pattern: /(@)(?:align|binding|compute|const|fragment|group|id|interpolate|invariant|location|size|vertex|workgroup_size)/i,
lookbehind: true,
alias: 'attr-name',
},
'functions': {
pattern: /\b(fn\s+)[_a-zA-Z]\w*(?=[(<])/,
lookbehind: true,
alias: 'function',
},
'keyword': /\b(?:bitcast|break|case|const|continue|continuing|default|discard|else|enable|fallthrough|fn|for|function|if|let|loop|private|return|storage|struct|switch|type|uniform|var|while|workgroup)\b/,
'builtin': /\b(?:abs|acos|acosh|all|any|array|asin|asinh|atan|atan2|atanh|atomic|atomicAdd|atomicAnd|atomicCompareExchangeWeak|atomicExchange|atomicLoad|atomicMax|atomicMin|atomicOr|atomicStore|atomicSub|atomicXor|bool|ceil|clamp|cos|cosh|countLeadingZeros|countOneBits|countTrailingZeros|cross|degrees|determinant|distance|dot|dpdx|dpdxCoarse|dpdxFine|dpdy|dpdyCoarse|dpdyFine|exp|exp2|extractBits|f32|f64|faceForward|firstLeadingBit|floor|fma|fract|frexp|fwidth|fwidthCoarse|fwidthFine|i32|i64|insertBits|inverseSqrt|ldexp|length|log|log2|mat[2-4]x[2-4]|max|min|mix|modf|normalize|override|pack2x16float|pack2x16snorm|pack2x16unorm|pack4x8snorm|pack4x8unorm|pow|ptr|quantizeToF16|radians|reflect|refract|reverseBits|round|sampler|sampler_comparison|select|shiftLeft|shiftRight|sign|sin|sinh|smoothstep|sqrt|staticAssert|step|storageBarrier|tan|tanh|textureDimensions|textureGather|textureGatherCompare|textureLoad|textureNumLayers|textureNumLevels|textureNumSamples|textureSample|textureSampleBias|textureSampleCompare|textureSampleCompareLevel|textureSampleGrad|textureSampleLevel|textureStore|texture_1d|texture_2d|texture_2d_array|texture_3d|texture_cube|texture_cube_array|texture_depth_2d|texture_depth_2d_array|texture_depth_cube|texture_depth_cube_array|texture_depth_multisampled_2d|texture_multisampled_2d|texture_storage_1d|texture_storage_2d|texture_storage_2d_array|texture_storage_3d|transpose|trunc|u32|u64|unpack2x16float|unpack2x16snorm|unpack2x16unorm|unpack4x8snorm|unpack4x8unorm|vec[2-4]|workgroupBarrier)\b/,
'function-calls': {
pattern: /\b[_a-z]\w*(?=\()/i,
alias: 'function',
},
'class-name': /\b(?:[A-Z][A-Za-z0-9]*)\b/,
'bool-literal': {
pattern: /\b(?:false|true)\b/,
alias: 'boolean',
},
'hex-int-literal': {
pattern: /\b0[xX][0-9a-fA-F]+[iu]?\b(?![.pP])/,
alias: 'number',
},
'hex-float-literal': {
pattern: /\b0[xX][0-9a-fA-F]*(?:\.[0-9a-fA-F]*)?(?:[pP][+-]?\d+[fh]?)?/, alias: 'number'
},
'decimal-float-literal': [
{ pattern: /\d*\.\d+(?:[eE](?:\+|-)?\d+)?[fh]?/, alias: 'number' },
{ pattern: /\d+\.\d*(?:[eE](?:\+|-)?\d+)?[fh]?/, alias: 'number' },
{ pattern: /\d+[eE](?:\+|-)?\d+[fh]?/, alias: 'number' },
{ pattern: /\b\d+[fh]\b/, alias: 'number' },
],
'int-literal': {
pattern: /\b\d+[iu]?\b/,
alias: 'number',
},
'operator': [
{ pattern: /(?:\^|~|\|(?!\|)|\|\||&&|<<|>>|!)(?!=)/ },
{ pattern: /&(?![&=])/ },
{ pattern: /(?:\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/ },
{ pattern: /(^|[^<>=!])=(?![=>])/, lookbehind: true },
{ pattern: /(?:==|!=|<=|\+\+|--|(^|[^=])>=)/, lookbehind: true },
{ pattern: /(?:(?:[+%]|(?:\*(?!\w)))(?!=))|(?:-(?!>))|(?:\/(?!\/))/ },
{ pattern: /->/ },
],
'punctuation': /[@(){}[\],;<>:.]/,
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"getTextFieldsToBeSearched.js","names":["fieldAffectsData","flattenTopLevelFields","getTextFieldsToBeSearched","listSearchableFields","fields","i18n","flattenedFields","moveSubFieldsToTop","searchableFieldNames","Set","matchingFields","field","has","name","push","delete"],"sources":["../../../src/elements/ListControls/getTextFieldsToBeSearched.ts"],"sourcesContent":["'use client'\nimport type { I18nClient } from '@payloadcms/translations'\nimport type { ClientField } from 'payload'\n\nimport { fieldAffectsData, flattenTopLevelFields } from 'payload/shared'\n\nexport const getTextFieldsToBeSearched = (\n listSearchableFields: string[],\n fields: ClientField[],\n i18n: I18nClient,\n): ClientField[] => {\n if (listSearchableFields) {\n const flattenedFields = flattenTopLevelFields(fields, {\n i18n,\n moveSubFieldsToTop: true,\n }) as ClientField[]\n\n const searchableFieldNames = new Set(listSearchableFields)\n const matchingFields: typeof flattenedFields = []\n\n for (const field of flattenedFields) {\n if (fieldAffectsData(field) && searchableFieldNames.has(field.name)) {\n matchingFields.push(field)\n searchableFieldNames.delete(field.name)\n }\n }\n\n return matchingFields\n }\n\n return null\n}\n"],"mappings":"AAAA;;AAIA,SAASA,gBAAgB,EAAEC,qBAAqB,QAAQ;AAExD,OAAO,MAAMC,yBAAA,GAA4BA,CACvCC,oBAAA,EACAC,MAAA,EACAC,IAAA;EAEA,IAAIF,oBAAA,EAAsB;IACxB,MAAMG,eAAA,GAAkBL,qBAAA,CAAsBG,MAAA,EAAQ;MACpDC,IAAA;MACAE,kBAAA,EAAoB;IACtB;IAEA,MAAMC,oBAAA,GAAuB,IAAIC,GAAA,CAAIN,oBAAA;IACrC,MAAMO,cAAA,GAAyC,EAAE;IAEjD,KAAK,MAAMC,KAAA,IAASL,eAAA,EAAiB;MACnC,IAAIN,gBAAA,CAAiBW,KAAA,KAAUH,oBAAA,CAAqBI,GAAG,CAACD,KAAA,CAAME,IAAI,GAAG;QACnEH,cAAA,CAAeI,IAAI,CAACH,KAAA;QACpBH,oBAAA,CAAqBO,MAAM,CAACJ,KAAA,CAAME,IAAI;MACxC;IACF;IAEA,OAAOH,cAAA;EACT;EAEA,OAAO;AACT","ignoreList":[]}

View File

@@ -0,0 +1,441 @@
'use strict';
const EventEmitter = require('events');
const shared = require('../shared');
const mimeTypes = require('../mime-funcs/mime-types');
const MailComposer = require('../mail-composer');
const DKIM = require('../dkim');
const httpProxyClient = require('../smtp-connection/http-proxy-client');
const util = require('util');
const urllib = require('url');
const packageData = require('../../package.json');
const MailMessage = require('./mail-message');
const net = require('net');
const dns = require('dns');
const crypto = require('crypto');
/**
* Creates an object for exposing the Mail API
*
* @constructor
* @param {Object} transporter Transport object instance to pass the mails to
*/
class Mail extends EventEmitter {
constructor(transporter, options, defaults) {
super();
this.options = options || {};
this._defaults = defaults || {};
this._defaultPlugins = {
compile: [(...args) => this._convertDataImages(...args)],
stream: []
};
this._userPlugins = {
compile: [],
stream: []
};
this.meta = new Map();
this.dkim = this.options.dkim ? new DKIM(this.options.dkim) : false;
this.transporter = transporter;
this.transporter.mailer = this;
this.logger = shared.getLogger(this.options, {
component: this.options.component || 'mail'
});
this.logger.debug(
{
tnx: 'create'
},
'Creating transport: %s',
this.getVersionString()
);
// setup emit handlers for the transporter
if (typeof this.transporter.on === 'function') {
// deprecated log interface
this.transporter.on('log', log => {
this.logger.debug(
{
tnx: 'transport'
},
'%s: %s',
log.type,
log.message
);
});
// transporter errors
this.transporter.on('error', err => {
this.logger.error(
{
err,
tnx: 'transport'
},
'Transport Error: %s',
err.message
);
this.emit('error', err);
});
// indicates if the sender has became idle
this.transporter.on('idle', (...args) => {
this.emit('idle', ...args);
});
// indicates if the sender has became idle and all connections are terminated
this.transporter.on('clear', (...args) => {
this.emit('clear', ...args);
});
}
/**
* Optional methods passed to the underlying transport object
*/
['close', 'isIdle', 'verify'].forEach(method => {
this[method] = (...args) => {
if (typeof this.transporter[method] === 'function') {
if (method === 'verify' && typeof this.getSocket === 'function') {
this.transporter.getSocket = this.getSocket;
this.getSocket = false;
}
return this.transporter[method](...args);
} else {
this.logger.warn(
{
tnx: 'transport',
methodName: method
},
'Non existing method %s called for transport',
method
);
return false;
}
};
});
// setup proxy handling
if (this.options.proxy && typeof this.options.proxy === 'string') {
this.setupProxy(this.options.proxy);
}
}
use(step, plugin) {
step = (step || '').toString();
if (!this._userPlugins.hasOwnProperty(step)) {
this._userPlugins[step] = [plugin];
} else {
this._userPlugins[step].push(plugin);
}
return this;
}
/**
* Sends an email using the preselected transport object
*
* @param {Object} data E-data description
* @param {Function?} callback Callback to run once the sending succeeded or failed
*/
sendMail(data, callback = null) {
let promise;
if (!callback) {
promise = new Promise((resolve, reject) => {
callback = shared.callbackPromise(resolve, reject);
});
}
if (typeof this.getSocket === 'function') {
this.transporter.getSocket = this.getSocket;
this.getSocket = false;
}
let mail = new MailMessage(this, data);
this.logger.debug(
{
tnx: 'transport',
name: this.transporter.name,
version: this.transporter.version,
action: 'send'
},
'Sending mail using %s/%s',
this.transporter.name,
this.transporter.version
);
this._processPlugins('compile', mail, err => {
if (err) {
this.logger.error(
{
err,
tnx: 'plugin',
action: 'compile'
},
'PluginCompile Error: %s',
err.message
);
return callback(err);
}
mail.message = new MailComposer(mail.data).compile();
mail.setMailerHeader();
mail.setPriorityHeaders();
mail.setListHeaders();
this._processPlugins('stream', mail, err => {
if (err) {
this.logger.error(
{
err,
tnx: 'plugin',
action: 'stream'
},
'PluginStream Error: %s',
err.message
);
return callback(err);
}
if (mail.data.dkim || this.dkim) {
mail.message.processFunc(input => {
let dkim = mail.data.dkim ? new DKIM(mail.data.dkim) : this.dkim;
this.logger.debug(
{
tnx: 'DKIM',
messageId: mail.message.messageId(),
dkimDomains: dkim.keys.map(key => key.keySelector + '.' + key.domainName).join(', ')
},
'Signing outgoing message with %s keys',
dkim.keys.length
);
return dkim.sign(input, mail.data._dkim);
});
}
this.transporter.send(mail, (...args) => {
if (args[0]) {
this.logger.error(
{
err: args[0],
tnx: 'transport',
action: 'send'
},
'Send Error: %s',
args[0].message
);
}
callback(...args);
});
});
});
return promise;
}
getVersionString() {
return util.format(
'%s (%s; +%s; %s/%s)',
packageData.name,
packageData.version,
packageData.homepage,
this.transporter.name,
this.transporter.version
);
}
_processPlugins(step, mail, callback) {
step = (step || '').toString();
if (!this._userPlugins.hasOwnProperty(step)) {
return callback();
}
let userPlugins = this._userPlugins[step] || [];
let defaultPlugins = this._defaultPlugins[step] || [];
if (userPlugins.length) {
this.logger.debug(
{
tnx: 'transaction',
pluginCount: userPlugins.length,
step
},
'Using %s plugins for %s',
userPlugins.length,
step
);
}
if (userPlugins.length + defaultPlugins.length === 0) {
return callback();
}
let pos = 0;
let block = 'default';
let processPlugins = () => {
let curplugins = block === 'default' ? defaultPlugins : userPlugins;
if (pos >= curplugins.length) {
if (block === 'default' && userPlugins.length) {
block = 'user';
pos = 0;
curplugins = userPlugins;
} else {
return callback();
}
}
let plugin = curplugins[pos++];
plugin(mail, err => {
if (err) {
return callback(err);
}
processPlugins();
});
};
processPlugins();
}
/**
* Sets up proxy handler for a Nodemailer object
*
* @param {String} proxyUrl Proxy configuration url
*/
setupProxy(proxyUrl) {
let proxy = urllib.parse(proxyUrl);
// setup socket handler for the mailer object
this.getSocket = (options, callback) => {
let protocol = proxy.protocol.replace(/:$/, '').toLowerCase();
if (this.meta.has('proxy_handler_' + protocol)) {
return this.meta.get('proxy_handler_' + protocol)(proxy, options, callback);
}
switch (protocol) {
// Connect using a HTTP CONNECT method
case 'http':
case 'https':
httpProxyClient(proxy.href, options.port, options.host, (err, socket) => {
if (err) {
return callback(err);
}
return callback(null, {
connection: socket
});
});
return;
case 'socks':
case 'socks5':
case 'socks4':
case 'socks4a': {
if (!this.meta.has('proxy_socks_module')) {
return callback(new Error('Socks module not loaded'));
}
let connect = ipaddress => {
let proxyV2 = !!this.meta.get('proxy_socks_module').SocksClient;
let socksClient = proxyV2 ? this.meta.get('proxy_socks_module').SocksClient : this.meta.get('proxy_socks_module');
let proxyType = Number(proxy.protocol.replace(/\D/g, '')) || 5;
let connectionOpts = {
proxy: {
ipaddress,
port: Number(proxy.port),
type: proxyType
},
[proxyV2 ? 'destination' : 'target']: {
host: options.host,
port: options.port
},
command: 'connect'
};
if (proxy.auth) {
let username = decodeURIComponent(proxy.auth.split(':').shift());
let password = decodeURIComponent(proxy.auth.split(':').pop());
if (proxyV2) {
connectionOpts.proxy.userId = username;
connectionOpts.proxy.password = password;
} else if (proxyType === 4) {
connectionOpts.userid = username;
} else {
connectionOpts.authentication = {
username,
password
};
}
}
socksClient.createConnection(connectionOpts, (err, info) => {
if (err) {
return callback(err);
}
return callback(null, {
connection: info.socket || info
});
});
};
if (net.isIP(proxy.hostname)) {
return connect(proxy.hostname);
}
return dns.resolve(proxy.hostname, (err, address) => {
if (err) {
return callback(err);
}
connect(Array.isArray(address) ? address[0] : address);
});
}
}
callback(new Error('Unknown proxy configuration'));
};
}
_convertDataImages(mail, callback) {
if ((!this.options.attachDataUrls && !mail.data.attachDataUrls) || !mail.data.html) {
return callback();
}
mail.resolveContent(mail.data, 'html', (err, html) => {
if (err) {
return callback(err);
}
let cidCounter = 0;
html = (html || '')
.toString()
.replace(/(<img\b[^<>]{0,1024} src\s{0,20}=[\s"']{0,20})(data:([^;]+);[^"'>\s]+)/gi, (match, prefix, dataUri, mimeType) => {
let cid = crypto.randomBytes(10).toString('hex') + '@localhost';
if (!mail.data.attachments) {
mail.data.attachments = [];
}
if (!Array.isArray(mail.data.attachments)) {
mail.data.attachments = [].concat(mail.data.attachments || []);
}
mail.data.attachments.push({
path: dataUri,
cid,
filename: 'image-' + ++cidCounter + '.' + mimeTypes.detectExtension(mimeType)
});
return prefix + 'cid:' + cid;
});
mail.data.html = html;
callback();
});
}
set(key, value) {
return this.meta.set(key, value);
}
get(key) {
return this.meta.get(key);
}
}
module.exports = Mail;

View File

@@ -0,0 +1 @@
export { GraphemeBreaker, splitGraphemes, fromCodePoint, toCodePoints } from './GraphemeBreak';

View File

@@ -0,0 +1,8 @@
import { RequestOptions } from "../../types/request.js";
import { RestCommand } from "../types.js";
//#region src/rest/helpers/custom-endpoint.d.ts
declare function customEndpoint<Output = unknown>(options: RequestOptions): RestCommand<Output, never>;
//#endregion
export { customEndpoint };
//# sourceMappingURL=custom-endpoint.d.ts.map

View File

@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var assert_1 = require("assert");
var color_1 = require("../color");
var parser_1 = require("../../syntax/parser");
var parse = function (value) { return color_1.color.parse({}, parser_1.Parser.parseValue(value)); };
describe('types', function () {
describe('<color>', function () {
describe('parsing', function () {
it('#000', function () { return assert_1.strictEqual(parse('#000'), color_1.pack(0, 0, 0, 1)); });
it('#0000', function () { return assert_1.strictEqual(parse('#0000'), color_1.pack(0, 0, 0, 0)); });
it('#000f', function () { return assert_1.strictEqual(parse('#000f'), color_1.pack(0, 0, 0, 1)); });
it('#fff', function () { return assert_1.strictEqual(parse('#fff'), color_1.pack(255, 255, 255, 1)); });
it('#000000', function () { return assert_1.strictEqual(parse('#000000'), color_1.pack(0, 0, 0, 1)); });
it('#00000000', function () { return assert_1.strictEqual(parse('#00000000'), color_1.pack(0, 0, 0, 0)); });
it('#ffffff', function () { return assert_1.strictEqual(parse('#ffffff'), color_1.pack(255, 255, 255, 1)); });
it('#ffffffff', function () { return assert_1.strictEqual(parse('#ffffffff'), color_1.pack(255, 255, 255, 1)); });
it('#7FFFD4', function () { return assert_1.strictEqual(parse('#7FFFD4'), color_1.pack(127, 255, 212, 1)); });
it('#f0ffff', function () { return assert_1.strictEqual(parse('#f0ffff'), color_1.pack(240, 255, 255, 1)); });
it('transparent', function () { return assert_1.strictEqual(parse('transparent'), color_1.pack(0, 0, 0, 0)); });
it('bisque', function () { return assert_1.strictEqual(parse('bisque'), color_1.pack(255, 228, 196, 1)); });
it('BLUE', function () { return assert_1.strictEqual(parse('BLUE'), color_1.pack(0, 0, 255, 1)); });
it('rgb(1, 3, 5)', function () { return assert_1.strictEqual(parse('rgb(1, 3, 5)'), color_1.pack(1, 3, 5, 1)); });
it('rgb(0% 0% 0%)', function () { return assert_1.strictEqual(parse('rgb(0% 0% 0%)'), color_1.pack(0, 0, 0, 1)); });
it('rgb(50% 50% 50%)', function () { return assert_1.strictEqual(parse('rgb(50% 50% 50%)'), color_1.pack(128, 128, 128, 1)); });
it('rgba(50% 50% 50% 50%)', function () { return assert_1.strictEqual(parse('rgba(50% 50% 50% 50%)'), color_1.pack(128, 128, 128, 0.5)); });
it('rgb(100% 100% 100%)', function () { return assert_1.strictEqual(parse('rgb(100% 100% 100%)'), color_1.pack(255, 255, 255, 1)); });
it('rgb(222 111 50)', function () { return assert_1.strictEqual(parse('rgb(222 111 50)'), color_1.pack(222, 111, 50, 1)); });
it('rgba(200, 3, 5, 1)', function () { return assert_1.strictEqual(parse('rgba(200, 3, 5, 1)'), color_1.pack(200, 3, 5, 1)); });
it('rgba(222, 111, 50, 0.22)', function () {
return assert_1.strictEqual(parse('rgba(222, 111, 50, 0.22)'), color_1.pack(222, 111, 50, 0.22));
});
it('rgba(222 111 50 0.123)', function () { return assert_1.strictEqual(parse('rgba(222 111 50 0.123)'), color_1.pack(222, 111, 50, 0.123)); });
it('hsl(270,60%,70%)', function () { return assert_1.strictEqual(parse('hsl(270,60%,70%)'), parse('rgb(178,132,224)')); });
it('hsl(270, 60%, 70%)', function () { return assert_1.strictEqual(parse('hsl(270, 60%, 70%)'), parse('rgb(178,132,224)')); });
it('hsl(270 60% 70%)', function () { return assert_1.strictEqual(parse('hsl(270 60% 70%)'), parse('rgb(178,132,224)')); });
it('hsl(270deg, 60%, 70%)', function () { return assert_1.strictEqual(parse('hsl(270deg, 60%, 70%)'), parse('rgb(178,132,224)')); });
it('hsl(4.71239rad, 60%, 70%)', function () {
return assert_1.strictEqual(parse('hsl(4.71239rad, 60%, 70%)'), parse('rgb(178,132,224)'));
});
it('hsl(.75turn, 60%, 70%)', function () { return assert_1.strictEqual(parse('hsl(.75turn, 60%, 70%)'), parse('rgb(178,132,224)')); });
it('hsla(.75turn, 60%, 70%, 50%)', function () {
return assert_1.strictEqual(parse('hsl(.75turn, 60%, 70%, 50%)'), parse('rgba(178,132,224, 0.5)'));
});
});
describe('util', function () {
describe('isTransparent', function () {
it('transparent', function () { return assert_1.strictEqual(color_1.isTransparent(parse('transparent')), true); });
it('#000', function () { return assert_1.strictEqual(color_1.isTransparent(parse('#000')), false); });
it('#000f', function () { return assert_1.strictEqual(color_1.isTransparent(parse('#000f')), false); });
it('#0001', function () { return assert_1.strictEqual(color_1.isTransparent(parse('#0001')), false); });
it('#0000', function () { return assert_1.strictEqual(color_1.isTransparent(parse('#0000')), true); });
});
describe('toString', function () {
it('transparent', function () { return assert_1.strictEqual(color_1.asString(parse('transparent')), 'rgba(0,0,0,0)'); });
it('#000', function () { return assert_1.strictEqual(color_1.asString(parse('#000')), 'rgb(0,0,0)'); });
it('#000f', function () { return assert_1.strictEqual(color_1.asString(parse('#000f')), 'rgb(0,0,0)'); });
it('#000f', function () { return assert_1.strictEqual(color_1.asString(parse('#000c')), 'rgba(0,0,0,0.8)'); });
it('#fff', function () { return assert_1.strictEqual(color_1.asString(parse('#fff')), 'rgb(255,255,255)'); });
it('#ffff', function () { return assert_1.strictEqual(color_1.asString(parse('#ffff')), 'rgb(255,255,255)'); });
it('#fffc', function () { return assert_1.strictEqual(color_1.asString(parse('#fffc')), 'rgba(255,255,255,0.8)'); });
});
});
});
});
//# sourceMappingURL=color-tests.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/node/globalThis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,gEAAgE;AAChE,iEAAiE;AACjE,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line n/no-unsupported-features/es-builtins\nexport const _globalThis = typeof globalThis === 'object' ? globalThis : global;\n"]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}

View File

@@ -0,0 +1,205 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
// https://www.unicode.org/cldr/charts/32/summary/sk.html#1772
const eraValues = {
narrow: ["pred Kr.", "po Kr."],
abbreviated: ["pred Kr.", "po Kr."],
wide: ["pred Kristom", "po Kristovi"],
};
// https://www.unicode.org/cldr/charts/32/summary/sk.html#1780
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. štvrťrok", "2. štvrťrok", "3. štvrťrok", "4. štvrťrok"],
};
// https://www.unicode.org/cldr/charts/32/summary/sk.html#1804
const monthValues = {
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
abbreviated: [
"jan",
"feb",
"mar",
"apr",
"máj",
"jún",
"júl",
"aug",
"sep",
"okt",
"nov",
"dec",
],
wide: [
"január",
"február",
"marec",
"apríl",
"máj",
"jún",
"júl",
"august",
"september",
"október",
"november",
"december",
],
};
const formattingMonthValues = {
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
abbreviated: [
"jan",
"feb",
"mar",
"apr",
"máj",
"jún",
"júl",
"aug",
"sep",
"okt",
"nov",
"dec",
],
wide: [
"januára",
"februára",
"marca",
"apríla",
"mája",
"júna",
"júla",
"augusta",
"septembra",
"októbra",
"novembra",
"decembra",
],
};
// https://www.unicode.org/cldr/charts/32/summary/sk.html#1876
const dayValues = {
narrow: ["n", "p", "u", "s", "š", "p", "s"],
short: ["ne", "po", "ut", "st", "št", "pi", "so"],
abbreviated: ["ne", "po", "ut", "st", "št", "pi", "so"],
wide: [
"nedeľa",
"pondelok",
"utorok",
"streda",
"štvrtok",
"piatok",
"sobota",
],
};
// https://www.unicode.org/cldr/charts/32/summary/sk.html#1932
const dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "poln.",
noon: "pol.",
morning: "ráno",
afternoon: "pop.",
evening: "več.",
night: "noc",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "poln.",
noon: "pol.",
morning: "ráno",
afternoon: "popol.",
evening: "večer",
night: "noc",
},
wide: {
am: "AM",
pm: "PM",
midnight: "polnoc",
noon: "poludnie",
morning: "ráno",
afternoon: "popoludnie",
evening: "večer",
night: "noc",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "o poln.",
noon: "nap.",
morning: "ráno",
afternoon: "pop.",
evening: "več.",
night: "v n.",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "o poln.",
noon: "napol.",
morning: "ráno",
afternoon: "popol.",
evening: "večer",
night: "v noci",
},
wide: {
am: "AM",
pm: "PM",
midnight: "o polnoci",
noon: "napoludnie",
morning: "ráno",
afternoon: "popoludní",
evening: "večer",
night: "v noci",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,226 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.$ZodRealError = exports.$ZodError = void 0;
exports.flattenError = flattenError;
exports.formatError = formatError;
exports.treeifyError = treeifyError;
exports.toDotPath = toDotPath;
exports.prettifyError = prettifyError;
const core_js_1 = require("./core.cjs");
const util = __importStar(require("./util.cjs"));
const initializer = (inst, def) => {
inst.name = "$ZodError";
Object.defineProperty(inst, "_zod", {
value: inst._zod,
enumerable: false,
});
Object.defineProperty(inst, "issues", {
value: def,
enumerable: false,
});
Object.defineProperty(inst, "message", {
get() {
return JSON.stringify(def, util.jsonStringifyReplacer, 2);
},
enumerable: true,
// configurable: false,
});
Object.defineProperty(inst, "toString", {
value: () => inst.message,
enumerable: false,
});
};
exports.$ZodError = (0, core_js_1.$constructor)("$ZodError", initializer);
exports.$ZodRealError = (0, core_js_1.$constructor)("$ZodError", initializer, { Parent: Error });
function flattenError(error, mapper = (issue) => issue.message) {
const fieldErrors = {};
const formErrors = [];
for (const sub of error.issues) {
if (sub.path.length > 0) {
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
fieldErrors[sub.path[0]].push(mapper(sub));
}
else {
formErrors.push(mapper(sub));
}
}
return { formErrors, fieldErrors };
}
function formatError(error, _mapper) {
const mapper = _mapper ||
function (issue) {
return issue.message;
};
const fieldErrors = { _errors: [] };
const processError = (error) => {
for (const issue of error.issues) {
if (issue.code === "invalid_union" && issue.errors.length) {
issue.errors.map((issues) => processError({ issues }));
}
else if (issue.code === "invalid_key") {
processError({ issues: issue.issues });
}
else if (issue.code === "invalid_element") {
processError({ issues: issue.issues });
}
else if (issue.path.length === 0) {
fieldErrors._errors.push(mapper(issue));
}
else {
let curr = fieldErrors;
let i = 0;
while (i < issue.path.length) {
const el = issue.path[i];
const terminal = i === issue.path.length - 1;
if (!terminal) {
curr[el] = curr[el] || { _errors: [] };
}
else {
curr[el] = curr[el] || { _errors: [] };
curr[el]._errors.push(mapper(issue));
}
curr = curr[el];
i++;
}
}
}
};
processError(error);
return fieldErrors;
}
function treeifyError(error, _mapper) {
const mapper = _mapper ||
function (issue) {
return issue.message;
};
const result = { errors: [] };
const processError = (error, path = []) => {
var _a, _b;
for (const issue of error.issues) {
if (issue.code === "invalid_union" && issue.errors.length) {
// regular union error
issue.errors.map((issues) => processError({ issues }, issue.path));
}
else if (issue.code === "invalid_key") {
processError({ issues: issue.issues }, issue.path);
}
else if (issue.code === "invalid_element") {
processError({ issues: issue.issues }, issue.path);
}
else {
const fullpath = [...path, ...issue.path];
if (fullpath.length === 0) {
result.errors.push(mapper(issue));
continue;
}
let curr = result;
let i = 0;
while (i < fullpath.length) {
const el = fullpath[i];
const terminal = i === fullpath.length - 1;
if (typeof el === "string") {
curr.properties ?? (curr.properties = {});
(_a = curr.properties)[el] ?? (_a[el] = { errors: [] });
curr = curr.properties[el];
}
else {
curr.items ?? (curr.items = []);
(_b = curr.items)[el] ?? (_b[el] = { errors: [] });
curr = curr.items[el];
}
if (terminal) {
curr.errors.push(mapper(issue));
}
i++;
}
}
}
};
processError(error);
return result;
}
/** Format a ZodError as a human-readable string in the following form.
*
* From
*
* ```ts
* ZodError {
* issues: [
* {
* expected: 'string',
* code: 'invalid_type',
* path: [ 'username' ],
* message: 'Invalid input: expected string'
* },
* {
* expected: 'number',
* code: 'invalid_type',
* path: [ 'favoriteNumbers', 1 ],
* message: 'Invalid input: expected number'
* }
* ];
* }
* ```
*
* to
*
* ```
* username
* ✖ Expected number, received string at "username
* favoriteNumbers[0]
* ✖ Invalid input: expected number
* ```
*/
function toDotPath(path) {
const segs = [];
for (const seg of path) {
if (typeof seg === "number")
segs.push(`[${seg}]`);
else if (typeof seg === "symbol")
segs.push(`[${JSON.stringify(String(seg))}]`);
else if (/[^\w$]/.test(seg))
segs.push(`[${JSON.stringify(seg)}]`);
else {
if (segs.length)
segs.push(".");
segs.push(seg);
}
}
return segs.join("");
}
function prettifyError(error) {
const lines = [];
// sort by path length
const issues = [...error.issues].sort((a, b) => a.path.length - b.path.length);
// Process each issue
for (const issue of issues) {
lines.push(`✖ ${issue.message}`);
if (issue.path?.length)
lines.push(` → at ${toDotPath(issue.path)}`);
}
// Convert Map to formatted string
return lines.join("\n");
}

View File

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.kLayerPatched = void 0;
/**
* This symbol is used to mark a Koa layer as being already instrumented
* since its possible to use a given layer multiple times (ex: middlewares)
*/
exports.kLayerPatched = Symbol('koa-layer-patched');
//# sourceMappingURL=internal-types.js.map

View File

@@ -0,0 +1,75 @@
import type { Client, ContinuousProfiler, Span } from '@sentry/core';
/**
* UIProfiler (Profiling V2):
* Supports two lifecycle modes:
* - 'manual': controlled explicitly via start()/stop()
* - 'trace': automatically runs while there are active sampled root spans
*
* Profiles are emitted as standalone `profile_chunk` envelopes either when:
* - there are no more sampled root spans, or
* - the 60s chunk timer elapses while profiling is running.
*/
export declare class UIProfiler implements ContinuousProfiler<Client> {
private _client;
private _profiler;
private _chunkTimer;
private _profilerId;
private _isRunning;
private _sessionSampled;
private _lifecycleMode;
private _activeRootSpanIds;
private _rootSpanTimeouts;
constructor();
/**
* Initialize the profiler with client, session sampling and lifecycle mode.
*/
initialize(client: Client): void;
/** Starts UI profiling (only effective in 'manual' mode and when sampled). */
start(): void;
/** Stops UI profiling (only effective in 'manual' mode). */
stop(): void;
/** Handle an already-active root span at integration setup time (used only in trace mode). */
notifyRootSpanActive(rootSpan: Span): void;
/**
* Begin profiling if not already running.
*/
private _beginProfiling;
/** End profiling session; final chunk will be collected and sent. */
private _endProfiling;
/** Trace-mode: attach spanStart/spanEnd listeners. */
private _setupTraceLifecycleListeners;
/**
* Resets profiling information from scope and resets running state (used on failure)
*/
private _resetProfilerInfo;
/**
* Clear and reset all per-root-span timeouts.
*/
private _clearAllRootSpanTimeouts;
/** Keep track of root spans and schedule safeguard timeout (trace mode). */
private _registerTraceRootSpan;
/**
* Start a profiler instance if needed.
*/
private _startProfilerInstance;
/**
* Schedule the next 60s chunk while running.
* Each tick collects a chunk and restarts the profiler.
* A chunk should be closed when there are no active root spans anymore OR when the maximum chunk interval is reached.
*/
private _startPeriodicChunking;
/**
* Handle timeout for a specific root span ID to avoid indefinitely running profiler if `spanEnd` never fires.
* If this was the last active root span, collect the current chunk and stop profiling.
*/
private _onRootSpanTimeout;
/**
* Stop current profiler instance, convert profile to chunk & send.
*/
private _collectCurrentChunk;
/**
* Send a profile chunk as a standalone envelope.
*/
private _sendProfileChunk;
}
//# sourceMappingURL=UIProfiler.d.ts.map

View File

@@ -0,0 +1,120 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.isConstValueNode = isConstValueNode;
exports.isDefinitionNode = isDefinitionNode;
exports.isExecutableDefinitionNode = isExecutableDefinitionNode;
exports.isSchemaCoordinateNode = isSchemaCoordinateNode;
exports.isSelectionNode = isSelectionNode;
exports.isTypeDefinitionNode = isTypeDefinitionNode;
exports.isTypeExtensionNode = isTypeExtensionNode;
exports.isTypeNode = isTypeNode;
exports.isTypeSystemDefinitionNode = isTypeSystemDefinitionNode;
exports.isTypeSystemExtensionNode = isTypeSystemExtensionNode;
exports.isValueNode = isValueNode;
var _kinds = require('./kinds.js');
function isDefinitionNode(node) {
return (
isExecutableDefinitionNode(node) ||
isTypeSystemDefinitionNode(node) ||
isTypeSystemExtensionNode(node)
);
}
function isExecutableDefinitionNode(node) {
return (
node.kind === _kinds.Kind.OPERATION_DEFINITION ||
node.kind === _kinds.Kind.FRAGMENT_DEFINITION
);
}
function isSelectionNode(node) {
return (
node.kind === _kinds.Kind.FIELD ||
node.kind === _kinds.Kind.FRAGMENT_SPREAD ||
node.kind === _kinds.Kind.INLINE_FRAGMENT
);
}
function isValueNode(node) {
return (
node.kind === _kinds.Kind.VARIABLE ||
node.kind === _kinds.Kind.INT ||
node.kind === _kinds.Kind.FLOAT ||
node.kind === _kinds.Kind.STRING ||
node.kind === _kinds.Kind.BOOLEAN ||
node.kind === _kinds.Kind.NULL ||
node.kind === _kinds.Kind.ENUM ||
node.kind === _kinds.Kind.LIST ||
node.kind === _kinds.Kind.OBJECT
);
}
function isConstValueNode(node) {
return (
isValueNode(node) &&
(node.kind === _kinds.Kind.LIST
? node.values.some(isConstValueNode)
: node.kind === _kinds.Kind.OBJECT
? node.fields.some((field) => isConstValueNode(field.value))
: node.kind !== _kinds.Kind.VARIABLE)
);
}
function isTypeNode(node) {
return (
node.kind === _kinds.Kind.NAMED_TYPE ||
node.kind === _kinds.Kind.LIST_TYPE ||
node.kind === _kinds.Kind.NON_NULL_TYPE
);
}
function isTypeSystemDefinitionNode(node) {
return (
node.kind === _kinds.Kind.SCHEMA_DEFINITION ||
isTypeDefinitionNode(node) ||
node.kind === _kinds.Kind.DIRECTIVE_DEFINITION
);
}
function isTypeDefinitionNode(node) {
return (
node.kind === _kinds.Kind.SCALAR_TYPE_DEFINITION ||
node.kind === _kinds.Kind.OBJECT_TYPE_DEFINITION ||
node.kind === _kinds.Kind.INTERFACE_TYPE_DEFINITION ||
node.kind === _kinds.Kind.UNION_TYPE_DEFINITION ||
node.kind === _kinds.Kind.ENUM_TYPE_DEFINITION ||
node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION
);
}
function isTypeSystemExtensionNode(node) {
return (
node.kind === _kinds.Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node)
);
}
function isTypeExtensionNode(node) {
return (
node.kind === _kinds.Kind.SCALAR_TYPE_EXTENSION ||
node.kind === _kinds.Kind.OBJECT_TYPE_EXTENSION ||
node.kind === _kinds.Kind.INTERFACE_TYPE_EXTENSION ||
node.kind === _kinds.Kind.UNION_TYPE_EXTENSION ||
node.kind === _kinds.Kind.ENUM_TYPE_EXTENSION ||
node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION
);
}
function isSchemaCoordinateNode(node) {
return (
node.kind === _kinds.Kind.TYPE_COORDINATE ||
node.kind === _kinds.Kind.MEMBER_COORDINATE ||
node.kind === _kinds.Kind.ARGUMENT_COORDINATE ||
node.kind === _kinds.Kind.DIRECTIVE_COORDINATE ||
node.kind === _kinds.Kind.DIRECTIVE_ARGUMENT_COORDINATE
);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"LayoutShiftManager.js","sources":["../../../../../src/metrics/web-vitals/lib/LayoutShiftManager.ts"],"sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\n/*\n * Copyright 2024 Google LLC\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\nexport class LayoutShiftManager {\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n _onAfterProcessingUnexpectedShift?: (entry: LayoutShift) => void;\n\n // eslint-disable-next-line @sentry-internal/sdk/no-class-field-initializers, @typescript-eslint/explicit-member-accessibility\n _sessionValue = 0;\n // eslint-disable-next-line @sentry-internal/sdk/no-class-field-initializers, @typescript-eslint/explicit-member-accessibility\n _sessionEntries: LayoutShift[] = [];\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n _processEntry(entry: LayoutShift) {\n // Only count layout shifts without recent user input.\n if (entry.hadRecentInput) return;\n\n const firstSessionEntry = this._sessionEntries[0];\n // This previously used `this._sessionEntries.at(-1)` but that is ES2022. We support ES2021 and earlier.\n const lastSessionEntry = this._sessionEntries[this._sessionEntries.length - 1];\n\n // If the entry occurred less than 1 second after the previous entry\n // and less than 5 seconds after the first entry in the session,\n // include the entry in the current session. Otherwise, start a new\n // session.\n if (\n this._sessionValue &&\n firstSessionEntry &&\n lastSessionEntry &&\n entry.startTime - lastSessionEntry.startTime < 1000 &&\n entry.startTime - firstSessionEntry.startTime < 5000\n ) {\n this._sessionValue += entry.value;\n this._sessionEntries.push(entry);\n } else {\n this._sessionValue = entry.value;\n this._sessionEntries = [entry];\n }\n\n this._onAfterProcessingUnexpectedShift?.(entry);\n }\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAM,kBAAA,CAAmB,CAAA,WAAA,GAAA,EAAA,kBAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,kBAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AAChC;;AAGA;AACA,EAAA,MAAA,GAAA,CAAA,IAAA,CAAE,aAAA,GAAgB,EAAA;AAClB;AACA,EAAA,OAAA,GAAA,CAAA,IAAA,CAAE,eAAe,GAAkB,GAAC;;AAEpC;AACA,EAAE,aAAa,CAAC,KAAK,EAAe;AACpC;AACA,IAAI,IAAI,KAAK,CAAC,cAAc,EAAE;;AAE9B,IAAI,MAAM,oBAAoB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;AACrD;AACA,IAAI,MAAM,gBAAA,GAAmB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,MAAA,GAAS,CAAC,CAAC;;AAElF;AACA;AACA;AACA;AACA,IAAI;AACJ,MAAM,IAAI,CAAC,aAAA;AACX,MAAM,iBAAA;AACN,MAAM,gBAAA;AACN,MAAM,KAAK,CAAC,SAAA,GAAY,gBAAgB,CAAC,SAAA,GAAY,IAAA;AACrD,MAAM,KAAK,CAAC,SAAA,GAAY,iBAAiB,CAAC,YAAY;AACtD,MAAM;AACN,MAAM,IAAI,CAAC,aAAA,IAAiB,KAAK,CAAC,KAAK;AACvC,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;AACtC,IAAI,OAAO;AACX,MAAM,IAAI,CAAC,aAAA,GAAgB,KAAK,CAAC,KAAK;AACtC,MAAM,IAAI,CAAC,eAAA,GAAkB,CAAC,KAAK,CAAC;AACpC,IAAI;;AAEJ,IAAI,IAAI,CAAC,iCAAiC,GAAG,KAAK,CAAC;AACnD,EAAE;AACF;;;;"}

View File

@@ -0,0 +1,14 @@
var baseSetToString = require('./_baseSetToString'),
shortOut = require('./_shortOut');
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
module.exports = setToString;

View File

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

View File

@@ -0,0 +1,4 @@
import { KeyofBase } from "../key-of-base";
export type SafeDictionary<Type, Keys extends KeyofBase = string> = {
[key in Keys]?: Type;
};

View File

@@ -0,0 +1,15 @@
import type { SanitizedCollectionConfig } from '../collections/config/types.js';
import type { SanitizedConfig } from '../config/types.js';
import type { PayloadRequest } from '../types/index.js';
import type { FileToSave } from './types.js';
type Args = {
collectionConfig: SanitizedCollectionConfig;
config: SanitizedConfig;
doc: Record<string, unknown>;
files?: FileToSave[];
overrideDelete: boolean;
req: PayloadRequest;
};
export declare const deleteAssociatedFiles: (args: Args) => Promise<void>;
export {};
//# sourceMappingURL=deleteAssociatedFiles.d.ts.map

View File

@@ -0,0 +1,145 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstrumentationAbstract = void 0;
const api_1 = require("@opentelemetry/api");
const api_logs_1 = require("@opentelemetry/api-logs");
const shimmer = require("./shimmer");
/**
* Base abstract internal class for instrumenting node and web plugins
*/
class InstrumentationAbstract {
instrumentationName;
instrumentationVersion;
_config = {};
_tracer;
_meter;
_logger;
_diag;
constructor(instrumentationName, instrumentationVersion, config) {
this.instrumentationName = instrumentationName;
this.instrumentationVersion = instrumentationVersion;
this.setConfig(config);
this._diag = api_1.diag.createComponentLogger({
namespace: instrumentationName,
});
this._tracer = api_1.trace.getTracer(instrumentationName, instrumentationVersion);
this._meter = api_1.metrics.getMeter(instrumentationName, instrumentationVersion);
this._logger = api_logs_1.logs.getLogger(instrumentationName, instrumentationVersion);
this._updateMetricInstruments();
}
/* Api to wrap instrumented method */
_wrap = shimmer.wrap;
/* Api to unwrap instrumented methods */
_unwrap = shimmer.unwrap;
/* Api to mass wrap instrumented method */
_massWrap = shimmer.massWrap;
/* Api to mass unwrap instrumented methods */
_massUnwrap = shimmer.massUnwrap;
/* Returns meter */
get meter() {
return this._meter;
}
/**
* Sets MeterProvider to this plugin
* @param meterProvider
*/
setMeterProvider(meterProvider) {
this._meter = meterProvider.getMeter(this.instrumentationName, this.instrumentationVersion);
this._updateMetricInstruments();
}
/* Returns logger */
get logger() {
return this._logger;
}
/**
* Sets LoggerProvider to this plugin
* @param loggerProvider
*/
setLoggerProvider(loggerProvider) {
this._logger = loggerProvider.getLogger(this.instrumentationName, this.instrumentationVersion);
}
/**
* @experimental
*
* Get module definitions defined by {@link init}.
* This can be used for experimental compile-time instrumentation.
*
* @returns an array of {@link InstrumentationModuleDefinition}
*/
getModuleDefinitions() {
const initResult = this.init() ?? [];
if (!Array.isArray(initResult)) {
return [initResult];
}
return initResult;
}
/**
* Sets the new metric instruments with the current Meter.
*/
_updateMetricInstruments() {
return;
}
/* Returns InstrumentationConfig */
getConfig() {
return this._config;
}
/**
* Sets InstrumentationConfig to this plugin
* @param config
*/
setConfig(config) {
// copy config first level properties to ensure they are immutable.
// nested properties are not copied, thus are mutable from the outside.
this._config = {
enabled: true,
...config,
};
}
/**
* Sets TraceProvider to this plugin
* @param tracerProvider
*/
setTracerProvider(tracerProvider) {
this._tracer = tracerProvider.getTracer(this.instrumentationName, this.instrumentationVersion);
}
/* Returns tracer */
get tracer() {
return this._tracer;
}
/**
* Execute span customization hook, if configured, and log any errors.
* Any semantics of the trigger and info are defined by the specific instrumentation.
* @param hookHandler The optional hook handler which the user has configured via instrumentation config
* @param triggerName The name of the trigger for executing the hook for logging purposes
* @param span The span to which the hook should be applied
* @param info The info object to be passed to the hook, with useful data the hook may use
*/
_runSpanCustomizationHook(hookHandler, triggerName, span, info) {
if (!hookHandler) {
return;
}
try {
hookHandler(span, info);
}
catch (e) {
this._diag.error(`Error running span customization hook due to exception in handler`, { triggerName }, e);
}
}
}
exports.InstrumentationAbstract = InstrumentationAbstract;
//# sourceMappingURL=instrumentation.js.map

View File

@@ -0,0 +1,9 @@
import type { ObjMap } from 'graphql/jsutils/ObjMap.js';
import type { GraphQLFieldConfig } from 'graphql/type/definition.js';
import type { PayloadRequest } from 'payload';
type PayloadContext = {
req: PayloadRequest;
};
export declare function wrapCustomFields<TSource>(fields: ObjMap<GraphQLFieldConfig<TSource, PayloadContext>>): ObjMap<GraphQLFieldConfig<TSource, PayloadContext>>;
export {};
//# sourceMappingURL=wrapCustomResolver.d.ts.map

View File

@@ -0,0 +1,8 @@
node_modules
coverage
*.min.js
dist
build
.nyc_output
package-lock.json
CHANGELOG.md

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-present Vercel, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,98 @@
import { commitTransaction, createLocalReq, initTransaction, killTransaction, readMigrationFiles } from 'payload';
import prompts from 'prompts';
import { getTransaction } from './utilities/getTransaction.js';
import { migrationTableExists } from './utilities/migrationTableExists.js';
import { parseError } from './utilities/parseError.js';
export const migrate = async function migrate(args) {
const { payload } = this;
const migrationFiles = args?.migrations || await readMigrationFiles({
payload
});
if (!migrationFiles.length) {
payload.logger.info({
msg: 'No migrations to run.'
});
return;
}
if ('createExtensions' in this && typeof this.createExtensions === 'function') {
await this.createExtensions();
}
let latestBatch = 0;
let migrationsInDB = [];
const hasMigrationTable = await migrationTableExists(this);
if (hasMigrationTable) {
;
({ docs: migrationsInDB } = await payload.find({
collection: 'payload-migrations',
limit: 0,
sort: '-name'
}));
if (migrationsInDB.find((m)=>m.batch === -1)) {
const { confirm: runMigrations } = await prompts({
name: 'confirm',
type: 'confirm',
initial: false,
message: "It looks like you've run Payload in dev mode, meaning you've dynamically pushed changes to your database.\n\n" + "If you'd like to run migrations, data loss will occur. Would you like to proceed?"
}, {
onCancel: ()=>{
process.exit(0);
}
});
if (!runMigrations) {
process.exit(0);
}
// ignore the dev migration so that the latest batch number increments correctly
migrationsInDB = migrationsInDB.filter((m)=>m.batch !== -1);
}
if (Number(migrationsInDB?.[0]?.batch) > 0) {
latestBatch = Number(migrationsInDB[0]?.batch);
}
}
const newBatch = latestBatch + 1;
// Execute 'up' function for each migration sequentially
for (const migration of migrationFiles){
const alreadyRan = migrationsInDB.find((existing)=>existing.name === migration.name);
// If already ran, skip
if (alreadyRan) {
continue;
}
await runMigrationFile(payload, migration, newBatch);
}
};
async function runMigrationFile(payload, migration, batch) {
const start = Date.now();
const req = await createLocalReq({}, payload);
payload.logger.info({
msg: `Migrating: ${migration.name}`
});
try {
await initTransaction(req);
const db = await getTransaction(payload.db, req);
await migration.up({
db,
payload,
req
});
payload.logger.info({
msg: `Migrated: ${migration.name} (${Date.now() - start}ms)`
});
await payload.create({
collection: 'payload-migrations',
data: {
name: migration.name,
batch
},
req
});
await commitTransaction(req);
} catch (err) {
await killTransaction(req);
payload.logger.error({
err,
msg: parseError(err, `Error running migration ${migration.name}`)
});
process.exit(1);
}
}
//# sourceMappingURL=migrate.js.map

View File

@@ -0,0 +1,26 @@
import { Logger } from './types/Logger';
import { LoggerOptions } from './types/LoggerOptions';
import { LogRecord } from './types/LogRecord';
export declare class ProxyLogger implements Logger {
private _provider;
readonly name: string;
readonly version?: string | undefined;
readonly options?: LoggerOptions | undefined;
private _delegate?;
constructor(_provider: LoggerDelegator, name: string, version?: string | undefined, options?: LoggerOptions | undefined);
/**
* Emit a log record. This method should only be used by log appenders.
*
* @param logRecord
*/
emit(logRecord: LogRecord): void;
/**
* Try to get a logger from the proxy logger provider.
* If the proxy logger provider has no delegate, return a noop logger.
*/
private _getLogger;
}
export interface LoggerDelegator {
_getDelegateLogger(name: string, version?: string, options?: LoggerOptions): Logger | undefined;
}
//# sourceMappingURL=ProxyLogger.d.ts.map

View File

@@ -0,0 +1,166 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["f.Kr.", "e.Kr."],
abbreviated: ["f.Kr.", "e.Kr."],
wide: ["fyrir Krist", "eftir Krist"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1F", "2F", "3F", "4F"],
wide: ["1. fjórðungur", "2. fjórðungur", "3. fjórðungur", "4. fjórðungur"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "Á", "S", "Ó", "N", "D"],
abbreviated: [
"jan.",
"feb.",
"mars",
"apríl",
"maí",
"júní",
"júlí",
"ágúst",
"sept.",
"okt.",
"nóv.",
"des.",
],
wide: [
"janúar",
"febrúar",
"mars",
"apríl",
"maí",
"júní",
"júlí",
"ágúst",
"september",
"október",
"nóvember",
"desember",
],
};
const dayValues = {
narrow: ["S", "M", "Þ", "M", "F", "F", "L"],
short: ["Su", "Má", "Þr", "Mi", "Fi", "Fö", "La"],
abbreviated: ["sun.", "mán.", "þri.", "mið.", "fim.", "fös.", "lau."],
wide: [
"sunnudagur",
"mánudagur",
"þriðjudagur",
"miðvikudagur",
"fimmtudagur",
"föstudagur",
"laugardagur",
],
};
const dayPeriodValues = {
narrow: {
am: "f",
pm: "e",
midnight: "miðnætti",
noon: "hádegi",
morning: "morgunn",
afternoon: "síðdegi",
evening: "kvöld",
night: "nótt",
},
abbreviated: {
am: "f.h.",
pm: "e.h.",
midnight: "miðnætti",
noon: "hádegi",
morning: "morgunn",
afternoon: "síðdegi",
evening: "kvöld",
night: "nótt",
},
wide: {
am: "fyrir hádegi",
pm: "eftir hádegi",
midnight: "miðnætti",
noon: "hádegi",
morning: "morgunn",
afternoon: "síðdegi",
evening: "kvöld",
night: "nótt",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "f",
pm: "e",
midnight: "á miðnætti",
noon: "á hádegi",
morning: "að morgni",
afternoon: "síðdegis",
evening: "um kvöld",
night: "um nótt",
},
abbreviated: {
am: "f.h.",
pm: "e.h.",
midnight: "á miðnætti",
noon: "á hádegi",
morning: "að morgni",
afternoon: "síðdegis",
evening: "um kvöld",
night: "um nótt",
},
wide: {
am: "fyrir hádegi",
pm: "eftir hádegi",
midnight: "á miðnætti",
noon: "á hádegi",
morning: "að morgni",
afternoon: "síðdegis",
evening: "um kvöld",
night: "um nótt",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
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 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 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 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB","194":"rB sB tB"},E:{"1":"A B C L M G cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E F 6C bC 7C 8C 9C AD"},F:{"1":"0 1 2 3 4 5 6 7 8 hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB JD KD LD MD PC xC ND QC","194":"eB fB gB"},G:{"1":"VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD TD UD"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:6,C:"Rest parameters",D:true};

View File

@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CalendarSearch = createLucideIcon("CalendarSearch", [
["path", { d: "M16 2v4", key: "4m81vk" }],
["path", { d: "M21 11.75V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.25", key: "1jrsq6" }],
["path", { d: "m22 22-1.875-1.875", key: "13zax7" }],
["path", { d: "M3 10h18", key: "8toen8" }],
["path", { d: "M8 2v4", key: "1cmpym" }],
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }]
]);
export { CalendarSearch as default };
//# sourceMappingURL=calendar-search.js.map

View File

@@ -0,0 +1,103 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const EnvironmentNotSupportAsyncWarning = require("../EnvironmentNotSupportAsyncWarning");
const { JAVASCRIPT_MODULE_TYPE_ESM } = require("../ModuleTypeConstants");
const DynamicExports = require("./DynamicExports");
const HarmonyCompatibilityDependency = require("./HarmonyCompatibilityDependency");
const HarmonyExports = require("./HarmonyExports");
/** @typedef {import("../Module").BuildMeta} BuildMeta */
/** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */
const PLUGIN_NAME = "HarmonyDetectionParserPlugin";
module.exports = class HarmonyDetectionParserPlugin {
/**
* @param {JavascriptParser} parser the parser
* @returns {void}
*/
apply(parser) {
parser.hooks.program.tap(PLUGIN_NAME, (ast) => {
const isStrictHarmony =
parser.state.module.type === JAVASCRIPT_MODULE_TYPE_ESM;
const isHarmony =
isStrictHarmony ||
ast.body.some(
(statement) =>
statement.type === "ImportDeclaration" ||
statement.type === "ExportDefaultDeclaration" ||
statement.type === "ExportNamedDeclaration" ||
statement.type === "ExportAllDeclaration"
);
if (isHarmony) {
const module = parser.state.module;
const compatDep = new HarmonyCompatibilityDependency();
compatDep.loc = {
start: {
line: -1,
column: 0
},
end: {
line: -1,
column: 0
},
index: -3
};
module.addPresentationalDependency(compatDep);
DynamicExports.bailout(parser.state);
HarmonyExports.enable(parser.state, isStrictHarmony);
parser.scope.isStrict = true;
}
});
parser.hooks.topLevelAwait.tap(PLUGIN_NAME, () => {
const module = parser.state.module;
if (!HarmonyExports.isEnabled(parser.state)) {
throw new Error(
"Top-level-await is only supported in EcmaScript Modules"
);
}
/** @type {BuildMeta} */
(module.buildMeta).async = true;
EnvironmentNotSupportAsyncWarning.check(
module,
parser.state.compilation.runtimeTemplate,
"topLevelAwait"
);
});
/**
* @returns {boolean | undefined} true if in harmony
*/
const skipInHarmony = () => {
if (HarmonyExports.isEnabled(parser.state)) {
return true;
}
};
/**
* @returns {null | undefined} null if in harmony
*/
const nullInHarmony = () => {
if (HarmonyExports.isEnabled(parser.state)) {
return null;
}
};
const nonHarmonyIdentifiers = ["define", "exports"];
for (const identifier of nonHarmonyIdentifiers) {
parser.hooks.evaluateTypeof
.for(identifier)
.tap(PLUGIN_NAME, nullInHarmony);
parser.hooks.typeof.for(identifier).tap(PLUGIN_NAME, skipInHarmony);
parser.hooks.evaluate.for(identifier).tap(PLUGIN_NAME, nullInHarmony);
parser.hooks.expression.for(identifier).tap(PLUGIN_NAME, skipInHarmony);
parser.hooks.call.for(identifier).tap(PLUGIN_NAME, skipInHarmony);
}
}
};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/singlestore-core/index.ts"],"sourcesContent":["export * from './alias.ts';\nexport * from './columns/index.ts';\nexport * from './db.ts';\nexport * from './dialect.ts';\nexport * from './indexes.ts';\nexport * from './primary-keys.ts';\nexport * from './query-builders/index.ts';\nexport * from './schema.ts';\nexport * from './session.ts';\nexport * from './subquery.ts';\nexport * from './table.ts';\nexport * from './unique-constraint.ts';\nexport * from './utils.ts';\n/* export * from './view-common.ts';\nexport * from './view.ts'; */\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,qCAAc,uBAAd;AACA,qCAAc,+BADd;AAEA,qCAAc,oBAFd;AAGA,qCAAc,yBAHd;AAIA,qCAAc,yBAJd;AAKA,qCAAc,8BALd;AAMA,qCAAc,sCANd;AAOA,qCAAc,wBAPd;AAQA,qCAAc,yBARd;AASA,qCAAc,0BATd;AAUA,qCAAc,uBAVd;AAWA,qCAAc,mCAXd;AAYA,qCAAc,uBAZd;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"notebook-pen.js","sources":["../../../src/icons/notebook-pen.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name NotebookPen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMuNCAySDZhMiAyIDAgMCAwLTIgMnYxNmEyIDIgMCAwIDAgMiAyaDEyYTIgMiAwIDAgMCAyLTJ2LTcuNCIgLz4KICA8cGF0aCBkPSJNMiA2aDQiIC8+CiAgPHBhdGggZD0iTTIgMTBoNCIgLz4KICA8cGF0aCBkPSJNMiAxNGg0IiAvPgogIDxwYXRoIGQ9Ik0yIDE4aDQiIC8+CiAgPHBhdGggZD0iTTIxLjM3OCA1LjYyNmExIDEgMCAxIDAtMy4wMDQtMy4wMDRsLTUuMDEgNS4wMTJhMiAyIDAgMCAwLS41MDYuODU0bC0uODM3IDIuODdhLjUuNSAwIDAgMCAuNjIuNjJsMi44Ny0uODM3YTIgMiAwIDAgMCAuODU0LS41MDZ6IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/notebook-pen\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 NotebookPen = createLucideIcon('NotebookPen', [\n ['path', { d: 'M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4', key: 're6nr2' }],\n ['path', { d: 'M2 6h4', key: 'aawbzj' }],\n ['path', { d: 'M2 10h4', key: 'l0bgd4' }],\n ['path', { d: 'M2 14h4', key: '1gsvsf' }],\n ['path', { d: 'M2 18h4', key: '1bu2t1' }],\n [\n 'path',\n {\n d: 'M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z',\n key: 'pqwjuv',\n },\n ],\n]);\n\nexport default NotebookPen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
export default function isDocument(element: Element | Document | Window): element is Document;

View File

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

View File

@@ -0,0 +1,179 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["AC", "DC"],
abbreviated: ["AC", "DC"],
wide: ["antes de cristo", "depois de cristo"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["T1", "T2", "T3", "T4"],
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"],
};
const monthValues = {
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
abbreviated: [
"jan",
"fev",
"mar",
"abr",
"mai",
"jun",
"jul",
"ago",
"set",
"out",
"nov",
"dez",
],
wide: [
"janeiro",
"fevereiro",
"março",
"abril",
"maio",
"junho",
"julho",
"agosto",
"setembro",
"outubro",
"novembro",
"dezembro",
],
};
const dayValues = {
narrow: ["D", "S", "T", "Q", "Q", "S", "S"],
short: ["dom", "seg", "ter", "qua", "qui", "sex", "sab"],
abbreviated: [
"domingo",
"segunda",
"terça",
"quarta",
"quinta",
"sexta",
"sábado",
],
wide: [
"domingo",
"segunda-feira",
"terça-feira",
"quarta-feira",
"quinta-feira",
"sexta-feira",
"sábado",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mn",
noon: "md",
morning: "manhã",
afternoon: "tarde",
evening: "tarde",
night: "noite",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "meia-noite",
noon: "meio-dia",
morning: "manhã",
afternoon: "tarde",
evening: "tarde",
night: "noite",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "meia-noite",
noon: "meio-dia",
morning: "manhã",
afternoon: "tarde",
evening: "tarde",
night: "noite",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mn",
noon: "md",
morning: "da manhã",
afternoon: "da tarde",
evening: "da tarde",
night: "da noite",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "meia-noite",
noon: "meio-dia",
morning: "da manhã",
afternoon: "da tarde",
evening: "da tarde",
night: "da noite",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "meia-noite",
noon: "meio-dia",
morning: "da manhã",
afternoon: "da tarde",
evening: "da tarde",
night: "da noite",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
if (options?.unit === "week") {
return number + "ª";
}
return number + "º";
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,81 @@
import type { EventEmitter } from 'node:events';
import type { IncomingMessage, RequestOptions } from 'node:http';
import type { Client, Integration, Scope } from '@sentry/core';
interface WeakRefImpl<T> {
deref(): T | undefined;
}
type StartSpanCallback = (next: () => boolean) => boolean;
type RequestWithOptionalStartSpanCallback = IncomingMessage & {
_startSpanCallback?: WeakRefImpl<StartSpanCallback>;
};
export interface HttpServerIntegrationOptions {
/**
* Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.
* Read more about Release Health: https://docs.sentry.io/product/releases/health/
*
* Defaults to `true`.
*/
sessions?: boolean;
/**
* Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.
*
* Defaults to `60000` (60s).
*/
sessionFlushingDelayMS?: number;
/**
* Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
* This can be useful for long running requests where the body is not needed and we want to avoid capturing it.
*
* @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.
* @param request Contains the {@type RequestOptions} object used to make the incoming request.
*/
ignoreRequestBody?: (url: string, request: RequestOptions) => boolean;
/**
* Controls the maximum size of incoming HTTP request bodies attached to events.
*
* Available options:
* - 'none': No request bodies will be attached
* - 'small': Request bodies up to 1,000 bytes will be attached
* - 'medium': Request bodies up to 10,000 bytes will be attached (default)
* - 'always': Request bodies will always be attached
*
* Note that even with 'always' setting, bodies exceeding 1MB will never be attached
* for performance and security reasons.
*
* @default 'medium'
*/
maxRequestBodySize?: 'none' | 'small' | 'medium' | 'always';
}
/**
* Add a callback to the request object that will be called when the request is started.
* The callback will receive the next function to continue processing the request.
*/
export declare function addStartSpanCallback(request: RequestWithOptionalStartSpanCallback, callback: StartSpanCallback): void;
/**
* This integration handles request isolation, trace continuation and other core Sentry functionality around incoming http requests
* handled via the node `http` module.
*
* This version uses OpenTelemetry for context propagation and span management.
*
* @see {@link ../../light/integrations/httpServerIntegration.ts} for the lightweight version without OpenTelemetry
*/
export declare const httpServerIntegration: (options?: HttpServerIntegrationOptions) => Integration & {
name: "HttpServer";
setupOnce: () => void;
};
/**
* Starts a session and tracks it in the context of a given isolation scope.
* When the passed response is finished, the session is put into a task and is
* aggregated with other sessions that may happen in a certain time window
* (sessionFlushingDelayMs).
*
* The sessions are always aggregated by the client that is on the current scope
* at the time of ending the response (if there is one).
*/
export declare function recordRequestSession(client: Client, { requestIsolationScope, response, sessionFlushingDelayMS, }: {
requestIsolationScope: Scope;
response: EventEmitter;
sessionFlushingDelayMS?: number;
}): void;
export {};
//# sourceMappingURL=httpServerIntegration.d.ts.map

View File

@@ -0,0 +1,14 @@
export declare function getScrollPosition(scrollingContainer: Element): {
isTop: boolean;
isLeft: boolean;
isBottom: boolean;
isRight: boolean;
maxScroll: {
x: number;
y: number;
};
minScroll: {
x: number;
y: number;
};
};

View File

@@ -0,0 +1,11 @@
var getNative = require('./_getNative');
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;

View File

@@ -0,0 +1,41 @@
{
"name": "@lexical/overflow",
"description": "This package contains selection overflow helpers and nodes for Lexical.",
"keywords": [
"lexical",
"editor",
"rich-text",
"overflow"
],
"license": "MIT",
"version": "0.35.0",
"main": "LexicalOverflow.js",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/facebook/lexical",
"directory": "packages/lexical-overflow"
},
"module": "LexicalOverflow.mjs",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./index.d.ts",
"development": "./LexicalOverflow.dev.mjs",
"production": "./LexicalOverflow.prod.mjs",
"node": "./LexicalOverflow.node.mjs",
"default": "./LexicalOverflow.mjs"
},
"require": {
"types": "./index.d.ts",
"development": "./LexicalOverflow.dev.js",
"production": "./LexicalOverflow.prod.js",
"default": "./LexicalOverflow.js"
}
}
},
"dependencies": {
"lexical": "0.35.0"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"calendar-plus-2.js","sources":["../../../src/icons/calendar-plus-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CalendarPlus2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAydjQiIC8+CiAgPHBhdGggZD0iTTE2IDJ2NCIgLz4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjQiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0zIDEwaDE4IiAvPgogIDxwYXRoIGQ9Ik0xMCAxNmg0IiAvPgogIDxwYXRoIGQ9Ik0xMiAxNHY0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/calendar-plus-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CalendarPlus2 = createLucideIcon('CalendarPlus2', [\n ['path', { d: 'M8 2v4', key: '1cmpym' }],\n ['path', { d: 'M16 2v4', key: '4m81vk' }],\n ['rect', { width: '18', height: '18', x: '3', y: '4', rx: '2', key: '1hopcy' }],\n ['path', { d: 'M3 10h18', key: '8toen8' }],\n ['path', { d: 'M10 16h4', key: '17e571' }],\n ['path', { d: 'M12 14v4', key: '1thi36' }],\n]);\n\nexport default CalendarPlus2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,8 @@
import type { JsonObject, JsonValue, PayloadRequest } from '../../../types/index.js';
import type { FieldAffectingData } from '../../config/types.js';
export declare function getFallbackValue({ field, req, siblingDoc, }: {
field: FieldAffectingData;
req: PayloadRequest;
siblingDoc: JsonObject;
}): Promise<JsonValue>;
//# sourceMappingURL=getFallbackValue.d.ts.map

View File

@@ -0,0 +1,30 @@
name: 'Lock Threads'
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
issues: write
pull-requests: write
concurrency:
group: lock
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: jsumners/lock-threads@b27edac0ac998d42b2815e122b6c24b32b568321
with:
log-output: true
issue-inactive-days: '30'
issue-comment: >
This issue has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.
pr-comment: >
This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

View File

@@ -0,0 +1 @@
{"version":3,"file":"getTableColumnFromPath.d.ts","sourceRoot":"","sources":["../../src/queries/getTableColumnFromPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAS,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AACrE,OAAO,KAAK,EAEV,cAAc,EAIf,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAM7D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAS5D,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAA;IAC5D,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;QAClC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;KACxB,EAAE,CAAA;IACH,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,KAAK,EAAE,cAAc,CAAA;IACrB,uBAAuB,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAA;CAC7D,CAAA;AAED,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,UAAU,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAA;IAClE,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,KAAK,EAAE,qBAAqB,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAA;IACxE,iBAAiB,EAAE,OAAO,CAAA;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AACD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,iUAmBhC,IAAI,KAAG,WAo5BT,CAAA"}

View File

@@ -0,0 +1,78 @@
import { fieldShouldBeLocalized } from 'payload/shared';
import toSnakeCase from 'to-snake-case';
import { resolveBlockTableName } from '../../utilities/validateExistingBlockIsIdentical.js';
import { traverseFields } from './traverseFields.js';
export const transformBlocks = ({ adapter, baseTableName, blocks, blocksToDelete, data, field, locale, numbers, numbersToDelete, parentIsLocalized, path, relationships, relationshipsToDelete, selects, texts, textsToDelete, withinArrayOrBlockLocale })=>{
data.forEach((blockRow, i)=>{
if (typeof blockRow.blockType !== 'string') {
return;
}
const matchedBlock = adapter.payload.blocks[blockRow.blockType] ?? (field.blockReferences ?? field.blocks).find((block)=>typeof block !== 'string' && block.slug === blockRow.blockType);
if (!matchedBlock) {
return;
}
const blockType = toSnakeCase(blockRow.blockType);
const newRow = {
arrays: {},
arraysToPush: {},
locales: {},
row: {
_order: i + 1,
_path: `${path}${field.name}`
}
};
if (fieldShouldBeLocalized({
field,
parentIsLocalized
}) && locale) {
newRow.row._locale = locale;
}
if (withinArrayOrBlockLocale) {
newRow.row._locale = withinArrayOrBlockLocale;
}
const blockTableName = resolveBlockTableName(matchedBlock, adapter.tableNameMap.get(`${baseTableName}_blocks_${blockType}`));
if (!blocks[blockTableName]) {
blocks[blockTableName] = [];
}
const hasUUID = adapter.tables[blockTableName]._uuid;
// If we have declared a _uuid field on arrays,
// that means the ID has to be unique,
// and our ids within arrays are not unique.
// So move the ID to a uuid field for storage
// and allow the database to generate a serial id automatically
if (hasUUID) {
newRow.row._uuid = blockRow.id;
delete blockRow.id;
}
traverseFields({
adapter,
arrays: newRow.arrays,
arraysToPush: newRow.arraysToPush,
baseTableName,
blocks,
blocksToDelete,
columnPrefix: '',
data: blockRow,
fieldPrefix: '',
fields: matchedBlock.flattenedFields,
insideArrayOrBlock: true,
locales: newRow.locales,
numbers,
numbersToDelete,
parentIsLocalized: parentIsLocalized || field.localized,
parentTableName: blockTableName,
path: `${path || ''}${field.name}.${i}.`,
relationships,
relationshipsToAppend: [],
relationshipsToDelete,
row: newRow.row,
selects,
texts,
textsToDelete,
withinArrayOrBlockLocale
});
blocks[blockTableName].push(newRow);
});
};
//# sourceMappingURL=blocks.js.map

View File

@@ -0,0 +1,76 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import { type Equal } from "../../utils.js";
import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from "./common.js";
export type MySqlDecimalBuilderInitial<TName extends string> = MySqlDecimalBuilder<{
name: TName;
dataType: 'string';
columnType: 'MySqlDecimal';
data: string;
driverParam: string;
enumValues: undefined;
}>;
export declare class MySqlDecimalBuilder<T extends ColumnBuilderBaseConfig<'string', 'MySqlDecimal'>> extends MySqlColumnBuilderWithAutoIncrement<T, MySqlDecimalConfig> {
static readonly [entityKind]: string;
constructor(name: T['name'], config: MySqlDecimalConfig | undefined);
}
export declare class MySqlDecimal<T extends ColumnBaseConfig<'string', 'MySqlDecimal'>> extends MySqlColumnWithAutoIncrement<T, MySqlDecimalConfig> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
readonly unsigned: boolean | undefined;
mapFromDriverValue(value: unknown): string;
getSQLType(): string;
}
export type MySqlDecimalNumberBuilderInitial<TName extends string> = MySqlDecimalNumberBuilder<{
name: TName;
dataType: 'number';
columnType: 'MySqlDecimalNumber';
data: number;
driverParam: string;
enumValues: undefined;
}>;
export declare class MySqlDecimalNumberBuilder<T extends ColumnBuilderBaseConfig<'number', 'MySqlDecimalNumber'>> extends MySqlColumnBuilderWithAutoIncrement<T, MySqlDecimalConfig> {
static readonly [entityKind]: string;
constructor(name: T['name'], config: MySqlDecimalConfig | undefined);
}
export declare class MySqlDecimalNumber<T extends ColumnBaseConfig<'number', 'MySqlDecimalNumber'>> extends MySqlColumnWithAutoIncrement<T, MySqlDecimalConfig> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
readonly unsigned: boolean | undefined;
mapFromDriverValue(value: unknown): number;
mapToDriverValue: StringConstructor;
getSQLType(): string;
}
export type MySqlDecimalBigIntBuilderInitial<TName extends string> = MySqlDecimalBigIntBuilder<{
name: TName;
dataType: 'bigint';
columnType: 'MySqlDecimalBigInt';
data: bigint;
driverParam: string;
enumValues: undefined;
}>;
export declare class MySqlDecimalBigIntBuilder<T extends ColumnBuilderBaseConfig<'bigint', 'MySqlDecimalBigInt'>> extends MySqlColumnBuilderWithAutoIncrement<T, MySqlDecimalConfig> {
static readonly [entityKind]: string;
constructor(name: T['name'], config: MySqlDecimalConfig | undefined);
}
export declare class MySqlDecimalBigInt<T extends ColumnBaseConfig<'bigint', 'MySqlDecimalBigInt'>> extends MySqlColumnWithAutoIncrement<T, MySqlDecimalConfig> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
readonly unsigned: boolean | undefined;
mapFromDriverValue: BigIntConstructor;
mapToDriverValue: StringConstructor;
getSQLType(): string;
}
export interface MySqlDecimalConfig<T extends 'string' | 'number' | 'bigint' = 'string' | 'number' | 'bigint'> {
precision?: number;
scale?: number;
unsigned?: boolean;
mode?: T;
}
export declare function decimal(): MySqlDecimalBuilderInitial<''>;
export declare function decimal<TMode extends 'string' | 'number' | 'bigint'>(config: MySqlDecimalConfig<TMode>): Equal<TMode, 'number'> extends true ? MySqlDecimalNumberBuilderInitial<''> : Equal<TMode, 'bigint'> extends true ? MySqlDecimalBigIntBuilderInitial<''> : MySqlDecimalBuilderInitial<''>;
export declare function decimal<TName extends string, TMode extends 'string' | 'number' | 'bigint'>(name: TName, config?: MySqlDecimalConfig<TMode>): Equal<TMode, 'number'> extends true ? MySqlDecimalNumberBuilderInitial<TName> : Equal<TMode, 'bigint'> extends true ? MySqlDecimalBigIntBuilderInitial<TName> : MySqlDecimalBuilderInitial<TName>;

View File

@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=(t,n,r)=>()=>(e.throwIfEmpty(t,`Keys cannot be empty`),{path:`/notifications`,params:r??{},body:JSON.stringify({keys:t,data:n}),method:`PATCH`}),n=(e,t)=>()=>({path:`/notifications`,params:t??{},body:JSON.stringify(e),method:`PATCH`}),r=(t,n,r)=>()=>(e.throwIfEmpty(t,`Key cannot be empty`),{path:`/notifications/${t}`,params:r??{},body:JSON.stringify(n),method:`PATCH`});exports.updateNotification=r,exports.updateNotifications=t,exports.updateNotificationsBatch=n;
//# sourceMappingURL=notifications.cjs.map

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 ArrowRightLeft = createLucideIcon("ArrowRightLeft", [
["path", { d: "m16 3 4 4-4 4", key: "1x1c3m" }],
["path", { d: "M20 7H4", key: "zbl0bi" }],
["path", { d: "m8 21-4-4 4-4", key: "h9nckh" }],
["path", { d: "M4 17h16", key: "g4d7ey" }]
]);
export { ArrowRightLeft as default };
//# sourceMappingURL=arrow-right-left.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"wand-sparkles.js","sources":["../../../src/icons/wand-sparkles.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name WandSparkles\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEuNjQgMy42NC0xLjI4LTEuMjhhMS4yMSAxLjIxIDAgMCAwLTEuNzIgMEwyLjM2IDE4LjY0YTEuMjEgMS4yMSAwIDAgMCAwIDEuNzJsMS4yOCAxLjI4YTEuMiAxLjIgMCAwIDAgMS43MiAwTDIxLjY0IDUuMzZhMS4yIDEuMiAwIDAgMCAwLTEuNzIiIC8+CiAgPHBhdGggZD0ibTE0IDcgMyAzIiAvPgogIDxwYXRoIGQ9Ik01IDZ2NCIgLz4KICA8cGF0aCBkPSJNMTkgMTR2NCIgLz4KICA8cGF0aCBkPSJNMTAgMnYyIiAvPgogIDxwYXRoIGQ9Ik03IDhIMyIgLz4KICA8cGF0aCBkPSJNMjEgMTZoLTQiIC8+CiAgPHBhdGggZD0iTTExIDNIOSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/wand-sparkles\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 WandSparkles = createLucideIcon('WandSparkles', [\n [\n 'path',\n {\n d: 'm21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72',\n key: 'ul74o6',\n },\n ],\n ['path', { d: 'm14 7 3 3', key: '1r5n42' }],\n ['path', { d: 'M5 6v4', key: 'ilb8ba' }],\n ['path', { d: 'M19 14v4', key: 'blhpug' }],\n ['path', { d: 'M10 2v2', key: '7u0qdc' }],\n ['path', { d: 'M7 8H3', key: 'zfb6yr' }],\n ['path', { d: 'M21 16h-4', key: '1cnmox' }],\n ['path', { d: 'M11 3H9', key: '1obp7u' }],\n]);\n\nexport default WandSparkles;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,34 @@
import { urlAlphabet } from './url-alphabet/index.js'
let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))
let customRandom = (alphabet, defaultSize, getRandom) => {
let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
let step = -~((1.6 * mask * defaultSize) / alphabet.length)
return (size = defaultSize) => {
let id = ''
while (true) {
let bytes = getRandom(step)
let j = step | 0
while (j--) {
id += alphabet[bytes[j] & mask] || ''
if (id.length === size) return id
}
}
}
}
let customAlphabet = (alphabet, size = 21) =>
customRandom(alphabet, size, random)
let nanoid = (size = 21) =>
crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
byte &= 63
if (byte < 36) {
id += byte.toString(36)
} else if (byte < 62) {
id += (byte - 26).toString(36).toUpperCase()
} else if (byte > 62) {
id += '-'
} else {
id += '_'
}
return id
}, '')
export { nanoid, customAlphabet, customRandom, urlAlphabet, random }

View File

@@ -0,0 +1,24 @@
/**
* This integration will create spans for `fs` API operations, like reading and writing files.
*
* **WARNING:** This integration may add significant overhead to your application. Especially in scenarios with a lot of
* file I/O, like for example when running a framework dev server, including this integration can massively slow down
* your application.
*
* @param options Configuration for this integration.
*/
export declare const fsIntegration: (options?: {
/**
* Setting this option to `true` will include any filepath arguments from your `fs` API calls as span attributes.
*
* Defaults to `false`.
*/
recordFilePaths?: boolean;
/**
* Setting this option to `true` will include the error messages of failed `fs` API calls as a span attribute.
*
* Defaults to `false`.
*/
recordErrorMessagesAsSpanAttributes?: boolean;
} | undefined) => import("@sentry/core").Integration;
//# sourceMappingURL=fs.d.ts.map

View File

@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Loader = createLucideIcon("Loader", [
["path", { d: "M12 2v4", key: "3427ic" }],
["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
["path", { d: "M18 12h4", key: "wj9ykh" }],
["path", { d: "m16.2 16.2 2.9 2.9", key: "1bxg5t" }],
["path", { d: "M12 18v4", key: "jadmvz" }],
["path", { d: "m4.9 19.1 2.9-2.9", key: "bwix9q" }],
["path", { d: "M2 12h4", key: "j09sii" }],
["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
]);
export { Loader as default };
//# sourceMappingURL=loader.js.map

View File

@@ -0,0 +1,63 @@
{
"name": "@floating-ui/core",
"version": "1.7.4",
"description": "Positioning library for floating elements: tooltips, popovers, dropdowns, and more",
"publishConfig": {
"access": "public"
},
"main": "./dist/floating-ui.core.umd.js",
"module": "./dist/floating-ui.core.esm.js",
"unpkg": "./dist/floating-ui.core.umd.min.js",
"types": "./dist/floating-ui.core.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/floating-ui.core.d.mts",
"default": "./dist/floating-ui.core.mjs"
},
"types": "./dist/floating-ui.core.d.ts",
"module": "./dist/floating-ui.core.esm.js",
"default": "./dist/floating-ui.core.umd.js"
}
},
"sideEffects": false,
"files": [
"dist"
],
"author": "atomiks",
"license": "MIT",
"bugs": "https://github.com/floating-ui/floating-ui",
"repository": {
"type": "git",
"url": "https://github.com/floating-ui/floating-ui.git",
"directory": "packages/core"
},
"homepage": "https://floating-ui.com",
"keywords": [
"tooltip",
"popover",
"dropdown",
"menu",
"popup",
"positioning"
],
"dependencies": {
"@floating-ui/utils": "^0.2.10"
},
"devDependencies": {
"config": "0.0.0"
},
"scripts": {
"test": "vitest run",
"test:watch": "vitest watch",
"lint": "eslint .",
"format": "prettier --write .",
"clean": "rimraf dist out-tsc",
"dev": "rollup -c -w",
"build": "rollup -c",
"build:api": "build-api --tsc tsconfig.lib.json",
"publint": "publint",
"typecheck": "tsc -b"
}
}

View File

@@ -0,0 +1,186 @@
// @ts-ignore TS6133
import { test } from "vitest";
import * as z from "zod/v3";
test("test", () => {
z;
});
// const fish = z.object({
// name: z.string(),
// props: z.object({
// color: z.string(),
// numScales: z.number(),
// }),
// });
// const nonStrict = z
// .object({
// name: z.string(),
// color: z.string(),
// })
// .nonstrict();
// test('object pick type', () => {
// const modNonStrictFish = nonStrict.omit({ name: true });
// modNonStrictFish.parse({ color: 'asdf' });
// const bad1 = () => fish.pick({ props: { unknown: true } } as any);
// const bad2 = () => fish.omit({ name: true, props: { unknown: true } } as any);
// expect(bad1).toThrow();
// expect(bad2).toThrow();
// });
// test('f1', () => {
// const f1 = fish.pick(true);
// f1.parse({ name: 'a', props: { color: 'b', numScales: 3 } });
// });
// test('f2', () => {
// const f2 = fish.pick({ props: true });
// f2.parse({ props: { color: 'asdf', numScales: 1 } });
// const badcheck2 = () => f2.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any);
// expect(badcheck2).toThrow();
// });
// test('f3', () => {
// const f3 = fish.pick({ props: { color: true } });
// f3.parse({ props: { color: 'b' } });
// const badcheck3 = () => f3.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any);
// expect(badcheck3).toThrow();
// });
// test('f4', () => {
// const badcheck4 = () => fish.pick({ props: { color: true, unknown: true } });
// expect(badcheck4).toThrow();
// });
// test('f6', () => {
// const f6 = fish.omit({ props: true });
// const badcheck6 = () => f6.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any);
// f6.parse({ name: 'adsf' });
// expect(badcheck6).toThrow();
// });
// test('f7', () => {
// const f7 = fish.omit({ props: { color: true } });
// f7.parse({ name: 'a', props: { numScales: 3 } });
// const badcheck7 = () => f7.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any);
// expect(badcheck7).toThrow();
// });
// test('f8', () => {
// const badcheck8 = () => fish.omit({ props: { color: true, unknown: true } });
// expect(badcheck8).toThrow();
// });
// test('f9', () => {
// const f9 = nonStrict.pick(true);
// f9.parse({ name: 'a', color: 'asdf' });
// });
// test('f10', () => {
// const f10 = nonStrict.pick({ name: true });
// f10.parse({ name: 'a' });
// const val = f10.parse({ name: 'a', color: 'b' });
// expect(val).toEqual({ name: 'a' });
// });
// test('f12', () => {
// const badfcheck12 = () => nonStrict.omit({ color: true, asdf: true });
// expect(badfcheck12).toThrow();
// });
// test('array masking', () => {
// const fishArray = z.array(fish);
// const modFishArray = fishArray.pick({
// name: true,
// props: {
// numScales: true,
// },
// });
// modFishArray.parse([{ name: 'fish', props: { numScales: 12 } }]);
// const bad1 = () => modFishArray.parse([{ name: 'fish', props: { numScales: 12, color: 'asdf' } }] as any);
// expect(bad1).toThrow();
// });
// test('array masking', () => {
// const fishArray = z.array(fish);
// const fail = () =>
// fishArray.pick({
// name: true,
// props: {
// whatever: true,
// },
// } as any);
// expect(fail).toThrow();
// });
// test('array masking', () => {
// const fishArray = z.array(fish);
// const fail = () =>
// fishArray.omit({
// whateve: true,
// } as any);
// expect(fail).toThrow();
// });
// test('array masking', () => {
// const fishArray = z.array(fish);
// const modFishList = fishArray.omit({
// name: true,
// props: {
// color: true,
// },
// });
// modFishList.parse([{ props: { numScales: 12 } }]);
// const fail = () => modFishList.parse([{ name: 'hello', props: { numScales: 12 } }] as any);
// expect(fail).toThrow();
// });
// test('primitive array masking', () => {
// const fishArray = z.array(z.number());
// const fail = () => fishArray.pick({} as any);
// expect(fail).toThrow();
// });
// test('other array masking', () => {
// const fishArray = z.array(z.array(z.number()));
// const fail = () => fishArray.pick({} as any);
// expect(fail).toThrow();
// });
// test('invalid mask #1', () => {
// const fail = () => fish.pick(1 as any);
// expect(fail).toThrow();
// });
// test('invalid mask #2', () => {
// const fail = () => fish.pick([] as any);
// expect(fail).toThrow();
// });
// test('invalid mask #3', () => {
// const fail = () => fish.pick(false as any);
// expect(fail).toThrow();
// });
// test('invalid mask #4', () => {
// const fail = () => fish.pick('asdf' as any);
// expect(fail).toThrow();
// });
// test('invalid mask #5', () => {
// const fail = () => fish.omit(1 as any);
// expect(fail).toThrow();
// });
// test('invalid mask #6', () => {
// const fail = () => fish.omit([] as any);
// expect(fail).toThrow();
// });
// test('invalid mask #7', () => {
// const fail = () => fish.omit(false as any);
// expect(fail).toThrow();
// });
// test('invalid mask #8', () => {
// const fail = () => fish.omit('asdf' as any);
// expect(fail).toThrow();
// });

View File

@@ -0,0 +1,222 @@
'use strict'
const EventEmitter = require('events').EventEmitter
const { parse, serialize } = require('pg-protocol')
const { getStream, getSecureStream } = require('./stream')
const flushBuffer = serialize.flush()
const syncBuffer = serialize.sync()
const endBuffer = serialize.end()
// TODO(bmc) support binary mode at some point
class Connection extends EventEmitter {
constructor(config) {
super()
config = config || {}
this.stream = config.stream || getStream(config.ssl)
if (typeof this.stream === 'function') {
this.stream = this.stream(config)
}
this._keepAlive = config.keepAlive
this._keepAliveInitialDelayMillis = config.keepAliveInitialDelayMillis
this.lastBuffer = false
this.parsedStatements = {}
this.ssl = config.ssl || false
this._ending = false
this._emitMessage = false
const self = this
this.on('newListener', function (eventName) {
if (eventName === 'message') {
self._emitMessage = true
}
})
}
connect(port, host) {
const self = this
this._connecting = true
this.stream.setNoDelay(true)
this.stream.connect(port, host)
this.stream.once('connect', function () {
if (self._keepAlive) {
self.stream.setKeepAlive(true, self._keepAliveInitialDelayMillis)
}
self.emit('connect')
})
const reportStreamError = function (error) {
// errors about disconnections should be ignored during disconnect
if (self._ending && (error.code === 'ECONNRESET' || error.code === 'EPIPE')) {
return
}
self.emit('error', error)
}
this.stream.on('error', reportStreamError)
this.stream.on('close', function () {
self.emit('end')
})
if (!this.ssl) {
return this.attachListeners(this.stream)
}
this.stream.once('data', function (buffer) {
const responseCode = buffer.toString('utf8')
switch (responseCode) {
case 'S': // Server supports SSL connections, continue with a secure connection
break
case 'N': // Server does not support SSL connections
self.stream.end()
return self.emit('error', new Error('The server does not support SSL connections'))
default:
// Any other response byte, including 'E' (ErrorResponse) indicating a server error
self.stream.end()
return self.emit('error', new Error('There was an error establishing an SSL connection'))
}
const options = {
socket: self.stream,
}
if (self.ssl !== true) {
Object.assign(options, self.ssl)
if ('key' in self.ssl) {
options.key = self.ssl.key
}
}
const net = require('net')
if (net.isIP && net.isIP(host) === 0) {
options.servername = host
}
try {
self.stream = getSecureStream(options)
} catch (err) {
return self.emit('error', err)
}
self.attachListeners(self.stream)
self.stream.on('error', reportStreamError)
self.emit('sslconnect')
})
}
attachListeners(stream) {
parse(stream, (msg) => {
const eventName = msg.name === 'error' ? 'errorMessage' : msg.name
if (this._emitMessage) {
this.emit('message', msg)
}
this.emit(eventName, msg)
})
}
requestSsl() {
this.stream.write(serialize.requestSsl())
}
startup(config) {
this.stream.write(serialize.startup(config))
}
cancel(processID, secretKey) {
this._send(serialize.cancel(processID, secretKey))
}
password(password) {
this._send(serialize.password(password))
}
sendSASLInitialResponseMessage(mechanism, initialResponse) {
this._send(serialize.sendSASLInitialResponseMessage(mechanism, initialResponse))
}
sendSCRAMClientFinalMessage(additionalData) {
this._send(serialize.sendSCRAMClientFinalMessage(additionalData))
}
_send(buffer) {
if (!this.stream.writable) {
return false
}
return this.stream.write(buffer)
}
query(text) {
this._send(serialize.query(text))
}
// send parse message
parse(query) {
this._send(serialize.parse(query))
}
// send bind message
bind(config) {
this._send(serialize.bind(config))
}
// send execute message
execute(config) {
this._send(serialize.execute(config))
}
flush() {
if (this.stream.writable) {
this.stream.write(flushBuffer)
}
}
sync() {
this._ending = true
this._send(syncBuffer)
}
ref() {
this.stream.ref()
}
unref() {
this.stream.unref()
}
end() {
// 0x58 = 'X'
this._ending = true
if (!this._connecting || !this.stream.writable) {
this.stream.end()
return
}
return this.stream.write(endBuffer, () => {
this.stream.end()
})
}
close(msg) {
this._send(serialize.close(msg))
}
describe(msg) {
this._send(serialize.describe(msg))
}
sendCopyFromChunk(chunk) {
this._send(serialize.copyData(chunk))
}
endCopyFrom() {
this._send(serialize.copyDone())
}
sendCopyFail(msg) {
this._send(serialize.copyFail(msg))
}
}
module.exports = Connection

View File

@@ -0,0 +1,109 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Source = require("./Source");
/** @typedef {import("./Source").HashLike} HashLike */
/** @typedef {import("./Source").MapOptions} MapOptions */
/** @typedef {import("./Source").RawSourceMap} RawSourceMap */
/** @typedef {import("./Source").SourceAndMap} SourceAndMap */
/** @typedef {import("./Source").SourceValue} SourceValue */
/**
* @typedef {object} SourceLike
* @property {() => SourceValue} source source
* @property {(() => Buffer)=} buffer buffer
* @property {(() => number)=} size size
* @property {((options?: MapOptions) => RawSourceMap | null)=} map map
* @property {((options?: MapOptions) => SourceAndMap)=} sourceAndMap source and map
* @property {((hash: HashLike) => void)=} updateHash hash updater
*/
class CompatSource extends Source {
/**
* @param {SourceLike} sourceLike source like
* @returns {Source} source
*/
static from(sourceLike) {
return sourceLike instanceof Source
? sourceLike
: new CompatSource(sourceLike);
}
/**
* @param {SourceLike} sourceLike source like
*/
constructor(sourceLike) {
super();
/**
* @private
* @type {SourceLike}
*/
this._sourceLike = sourceLike;
}
/**
* @returns {SourceValue} source
*/
source() {
return this._sourceLike.source();
}
buffer() {
if (typeof this._sourceLike.buffer === "function") {
return this._sourceLike.buffer();
}
return super.buffer();
}
size() {
if (typeof this._sourceLike.size === "function") {
return this._sourceLike.size();
}
return super.size();
}
/**
* @param {MapOptions=} options map options
* @returns {RawSourceMap | null} map
*/
map(options) {
if (typeof this._sourceLike.map === "function") {
return this._sourceLike.map(options);
}
return super.map(options);
}
/**
* @param {MapOptions=} options map options
* @returns {SourceAndMap} source and map
*/
sourceAndMap(options) {
if (typeof this._sourceLike.sourceAndMap === "function") {
return this._sourceLike.sourceAndMap(options);
}
return super.sourceAndMap(options);
}
/**
* @param {HashLike} hash hash
* @returns {void}
*/
updateHash(hash) {
if (typeof this._sourceLike.updateHash === "function") {
return this._sourceLike.updateHash(hash);
}
if (typeof this._sourceLike.map === "function") {
throw new Error(
"A Source-like object with a 'map' method must also provide an 'updateHash' method",
);
}
hash.update(this.buffer());
}
}
module.exports = CompatSource;

View File

@@ -0,0 +1,92 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
const literalTuna = z.literal("tuna");
const literalTunaCustomMessage = z.literal("tuna", {
message: "That's not a tuna",
});
const literalFortyTwo = z.literal(42);
const literalTrue = z.literal(true);
test("passing validations", () => {
literalTuna.parse("tuna");
literalFortyTwo.parse(42);
literalTrue.parse(true);
});
test("failing validations", () => {
expect(() => literalTuna.parse("shark")).toThrow();
expect(() => literalFortyTwo.parse(43)).toThrow();
expect(() => literalTrue.parse(false)).toThrow();
});
test("invalid_literal should have `input` field with data", () => {
const data = "shark";
const result = literalTuna.safeParse(data);
const issue = result.error!.issues[0];
expect(issue.code).toBe("invalid_value");
expect(issue).toMatchInlineSnapshot(`
{
"code": "invalid_value",
"message": "Invalid input: expected "tuna"",
"path": [],
"values": [
"tuna",
],
}
`);
});
test("invalid_literal should return default message", () => {
const data = "shark";
const result = literalTuna.safeParse(data);
const issue = result.error!.issues[0];
expect(issue.message).toEqual(`Invalid input: expected \"tuna\"`);
});
test("invalid_literal should return custom message", () => {
const data = "shark";
const result = literalTunaCustomMessage.safeParse(data);
const issue = result.error!.issues[0];
expect(issue.message).toEqual(`That's not a tuna`);
});
test("literal default error message", () => {
const result = z.literal("Tuna").safeParse("Trout");
expect(result.success).toEqual(false);
expect(result.error!.issues.length).toEqual(1);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "invalid_value",
"values": [
"Tuna"
],
"path": [],
"message": "Invalid input: expected \\"Tuna\\""
}
]]
`);
});
test("literal bigint default error message", () => {
const result = z.literal(BigInt(12)).safeParse(BigInt(13));
expect(result.success).toBe(false);
expect(result.error!.issues.length).toEqual(1);
expect(result.error!.issues[0].message).toEqual(`Invalid input: expected 12n`);
});
test(".value getter", () => {
expect(z.literal("tuna").value).toEqual("tuna");
expect(() => z.literal([1, 2, 3]).value).toThrow();
});
test("readonly", () => {
const a = ["asdf"] as const;
z.literal(a);
});

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/errors/TimestampsRequired.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\n\nimport { APIError } from './APIError.js'\n\nexport class TimestampsRequired extends APIError {\n constructor(collection: CollectionConfig) {\n super(\n `Timestamps are required in the collection ${collection.slug} because you have opted in to Versions.`,\n )\n }\n}\n"],"names":["APIError","TimestampsRequired","collection","slug"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,gBAAe;AAExC,OAAO,MAAMC,2BAA2BD;IACtC,YAAYE,UAA4B,CAAE;QACxC,KAAK,CACH,CAAC,0CAA0C,EAAEA,WAAWC,IAAI,CAAC,uCAAuC,CAAC;IAEzG;AACF"}

View File

@@ -0,0 +1,6 @@
import type { DefaultCellComponentProps, JoinFieldClient, RelationshipFieldClient, UploadFieldClient } from 'payload';
import React from 'react';
import './index.scss';
export type RelationshipCellProps = DefaultCellComponentProps<JoinFieldClient | RelationshipFieldClient | UploadFieldClient>;
export declare const RelationshipCell: React.FC<RelationshipCellProps>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,148 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as api from '@opentelemetry/api';
import { sanitizeAttributes, isTracingSuppressed, } from '@opentelemetry/core';
import { SpanImpl } from './Span';
import { mergeConfig } from './utility';
import { RandomIdGenerator } from './platform';
/**
* This class represents a basic tracer.
*/
export class Tracer {
_sampler;
_generalLimits;
_spanLimits;
_idGenerator;
instrumentationScope;
_resource;
_spanProcessor;
/**
* Constructs a new Tracer instance.
*/
constructor(instrumentationScope, config, resource, spanProcessor) {
const localConfig = mergeConfig(config);
this._sampler = localConfig.sampler;
this._generalLimits = localConfig.generalLimits;
this._spanLimits = localConfig.spanLimits;
this._idGenerator = config.idGenerator || new RandomIdGenerator();
this._resource = resource;
this._spanProcessor = spanProcessor;
this.instrumentationScope = instrumentationScope;
}
/**
* Starts a new Span or returns the default NoopSpan based on the sampling
* decision.
*/
startSpan(name, options = {}, context = api.context.active()) {
// remove span from context in case a root span is requested via options
if (options.root) {
context = api.trace.deleteSpan(context);
}
const parentSpan = api.trace.getSpan(context);
if (isTracingSuppressed(context)) {
api.diag.debug('Instrumentation suppressed, returning Noop Span');
const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);
return nonRecordingSpan;
}
const parentSpanContext = parentSpan?.spanContext();
const spanId = this._idGenerator.generateSpanId();
let validParentSpanContext;
let traceId;
let traceState;
if (!parentSpanContext ||
!api.trace.isSpanContextValid(parentSpanContext)) {
// New root span.
traceId = this._idGenerator.generateTraceId();
}
else {
// New child span.
traceId = parentSpanContext.traceId;
traceState = parentSpanContext.traceState;
validParentSpanContext = parentSpanContext;
}
const spanKind = options.kind ?? api.SpanKind.INTERNAL;
const links = (options.links ?? []).map(link => {
return {
context: link.context,
attributes: sanitizeAttributes(link.attributes),
};
});
const attributes = sanitizeAttributes(options.attributes);
// make sampling decision
const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links);
traceState = samplingResult.traceState ?? traceState;
const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED
? api.TraceFlags.SAMPLED
: api.TraceFlags.NONE;
const spanContext = { traceId, spanId, traceFlags, traceState };
if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) {
api.diag.debug('Recording is off, propagating context in a non-recording span');
const nonRecordingSpan = api.trace.wrapSpanContext(spanContext);
return nonRecordingSpan;
}
// Set initial span attributes. The attributes object may have been mutated
// by the sampler, so we sanitize the merged attributes before setting them.
const initAttributes = sanitizeAttributes(Object.assign(attributes, samplingResult.attributes));
const span = new SpanImpl({
resource: this._resource,
scope: this.instrumentationScope,
context,
spanContext,
name,
kind: spanKind,
links,
parentSpanContext: validParentSpanContext,
attributes: initAttributes,
startTime: options.startTime,
spanProcessor: this._spanProcessor,
spanLimits: this._spanLimits,
});
return span;
}
startActiveSpan(name, arg2, arg3, arg4) {
let opts;
let ctx;
let fn;
if (arguments.length < 2) {
return;
}
else if (arguments.length === 2) {
fn = arg2;
}
else if (arguments.length === 3) {
opts = arg2;
fn = arg3;
}
else {
opts = arg2;
ctx = arg3;
fn = arg4;
}
const parentContext = ctx ?? api.context.active();
const span = this.startSpan(name, opts, parentContext);
const contextWithSpanSet = api.trace.setSpan(parentContext, span);
return api.context.with(contextWithSpanSet, fn, undefined, span);
}
/** Returns the active {@link GeneralLimits}. */
getGeneralLimits() {
return this._generalLimits;
}
/** Returns the active {@link SpanLimits}. */
getSpanLimits() {
return this._spanLimits;
}
}
//# sourceMappingURL=Tracer.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as pgTypes from 'pg';\nimport type * as api from '@opentelemetry/api';\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\n\nexport interface PgResponseHookInformation {\n data: pgTypes.QueryResult | pgTypes.QueryArrayResult;\n}\n\nexport interface PgInstrumentationExecutionResponseHook {\n (span: api.Span, responseInfo: PgResponseHookInformation): void;\n}\n\nexport interface PgRequestHookInformation {\n query: {\n text: string;\n name?: string;\n values?: unknown[];\n };\n connection: {\n database?: string;\n host?: string;\n port?: number;\n user?: string;\n };\n}\n\nexport interface PgInstrumentationExecutionRequestHook {\n (span: api.Span, queryInfo: PgRequestHookInformation): void;\n}\n\nexport interface PgInstrumentationConfig extends InstrumentationConfig {\n /**\n * If true, an attribute containing the query's parameters will be attached\n * the spans generated to represent the query.\n */\n enhancedDatabaseReporting?: boolean;\n\n /**\n * Hook that allows adding custom span attributes or updating the\n * span's name based on the data about the query to execute.\n *\n * @default undefined\n */\n requestHook?: PgInstrumentationExecutionRequestHook;\n\n /**\n * Hook that allows adding custom span attributes based on the data\n * returned from \"query\" Pg actions.\n *\n * @default undefined\n */\n responseHook?: PgInstrumentationExecutionResponseHook;\n\n /**\n * If true, requires a parent span to create new spans.\n *\n * @default false\n */\n requireParentSpan?: boolean;\n\n /**\n * If true, queries are modified to also include a comment with\n * the tracing context, following the {@link https://github.com/open-telemetry/opentelemetry-sqlcommenter sqlcommenter} format\n */\n addSqlCommenterCommentToQueries?: boolean;\n\n /**\n * If true, `pg.connect` and `pg-pool.connect` spans will not be created.\n * Query spans and pool metrics are still recorded.\n *\n * @default false\n */\n ignoreConnectSpans?: boolean;\n}\n"]}

View File

@@ -0,0 +1 @@
module.exports={C:{"68":0.11169,"108":2.35065,"115":0.49247,"127":0.21831,"128":0.27416,"132":0.05585,"134":0.11169,"136":0.16246,"137":0.27416,"139":0.27416,"144":0.16246,"145":4.10222,"146":1.53325,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 129 130 131 133 135 138 140 141 142 143 147 148 149 3.5 3.6"},D:{"86":0.54832,"109":0.98494,"131":0.92909,"132":0.05585,"133":0.21831,"134":0.21831,"135":0.60416,"136":0.87324,"137":0.98494,"138":0.54832,"140":0.16246,"142":3.39144,"143":7.11288,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 139 141 144 145 146"},F:{"114":0.38078,"124":0.76663,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 120 121 122 123 125 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.27416,"93":0.05585,"126":0.16246,"131":0.16246,"134":1.31494,"136":0.98494,"140":0.38078,"142":7.98612,"143":3.66559,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 127 128 129 130 132 133 135 137 138 139 141"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 15.6 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.2 17.3 17.4 17.5 18.0 18.1 18.2 26.3","16.6":0.05585,"17.6":0.54832,"18.3":0.27416,"18.4":0.21831,"18.5-18.6":0.05585,"26.0":0.11169,"26.1":0.16246,"26.2":0.05585},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00423,"5.0-5.1":0,"6.0-6.1":0.00847,"7.0-7.1":0.00635,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01693,"10.0-10.2":0.00212,"10.3":0.02964,"11.0-11.2":0.36409,"11.3-11.4":0.01058,"12.0-12.1":0.00847,"12.2-12.5":0.09526,"13.0-13.1":0.00212,"13.2":0.01482,"13.3":0.00423,"13.4-13.7":0.01482,"14.0-14.4":0.02964,"14.5-14.8":0.03175,"15.0-15.1":0.03387,"15.2-15.3":0.0254,"15.4":0.02752,"15.5":0.02964,"15.6-15.8":0.45935,"16.0":0.05292,"16.1":0.10161,"16.2":0.05292,"16.3":0.09526,"16.4":0.02329,"16.5":0.04022,"16.6-16.7":0.59695,"17.0":0.03387,"17.1":0.05504,"17.2":0.04022,"17.3":0.06139,"17.4":0.10372,"17.5":0.20322,"17.6-17.7":0.46994,"18.0":0.10584,"18.1":0.22015,"18.2":0.11643,"18.3":0.37891,"18.4":0.19475,"18.5-18.7":13.98376,"26.0":0.27307,"26.1":2.27136,"26.2":0.43183,"26.3":0.01905},P:{"26":0.05261,"28":0.05261,"29":10.88022,_:"4 20 21 22 23 24 25 27 5.0-5.4 6.2-6.4 7.2-7.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0"},I:{"0":0.11307,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00009},A:{"8":0.62082,"9":0.16694,"10":0.16694,"11":1.12686,_:"6 7 5.5"},K:{"0":0.05909,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":17.0355},R:{_:"0"},M:{"0":0.11325}};

View File

@@ -0,0 +1,6 @@
export type ClassValue = ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined;
export type ClassDictionary = Record<string, any>;
export type ClassArray = ClassValue[];
export function clsx(...inputs: ClassValue[]): string;
export default clsx;

View File

@@ -0,0 +1,43 @@
export type CronJobParams = {
cronTime: string | Date;
onTick: (context: unknown, onComplete?: unknown) => void | Promise<void>;
onComplete?: () => void | Promise<void>;
start?: boolean | null;
context?: unknown;
runOnInit?: boolean | null;
unrefTimeout?: boolean | null;
} & ({
timeZone?: string | null;
utcOffset?: never;
} | {
timeZone?: never;
utcOffset?: number | null;
});
export type CronJob = {};
export type CronJobConstructor = {
from: (param: CronJobParams) => CronJob;
new (cronTime: CronJobParams['cronTime'], onTick: CronJobParams['onTick'], onComplete?: CronJobParams['onComplete'], start?: CronJobParams['start'], timeZone?: CronJobParams['timeZone'], context?: CronJobParams['context'], runOnInit?: CronJobParams['runOnInit'], utcOffset?: null, unrefTimeout?: CronJobParams['unrefTimeout']): CronJob;
new (cronTime: CronJobParams['cronTime'], onTick: CronJobParams['onTick'], onComplete?: CronJobParams['onComplete'], start?: CronJobParams['start'], timeZone?: null, context?: CronJobParams['context'], runOnInit?: CronJobParams['runOnInit'], utcOffset?: CronJobParams['utcOffset'], unrefTimeout?: CronJobParams['unrefTimeout']): CronJob;
};
/**
* Instruments the `cron` library to send a check-in event to Sentry for each job execution.
*
* ```ts
* import * as Sentry from '@sentry/node';
* import { CronJob } from 'cron';
*
* const CronJobWithCheckIn = Sentry.cron.instrumentCron(CronJob, 'my-cron-job');
*
* // use the constructor
* const job = new CronJobWithCheckIn('* * * * *', () => {
* console.log('You will see this message every minute');
* });
*
* // or from
* const job = CronJobWithCheckIn.from({ cronTime: '* * * * *', onTick: () => {
* console.log('You will see this message every minute');
* });
* ```
*/
export declare function instrumentCron<T>(lib: T & CronJobConstructor, monitorSlug: string): T;
//# sourceMappingURL=cron.d.ts.map

View File

@@ -0,0 +1,138 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = populatePlaceholders;
var _t = require("@babel/types");
const {
blockStatement,
cloneNode,
emptyStatement,
expressionStatement,
identifier,
isStatement,
isStringLiteral,
stringLiteral,
validate
} = _t;
function populatePlaceholders(metadata, replacements) {
const ast = cloneNode(metadata.ast);
if (replacements) {
metadata.placeholders.forEach(placeholder => {
if (!hasOwnProperty.call(replacements, placeholder.name)) {
const placeholderName = placeholder.name;
throw new Error(`Error: No substitution given for "${placeholderName}". If this is not meant to be a
placeholder you may want to consider passing one of the following options to @babel/template:
- { placeholderPattern: false, placeholderWhitelist: new Set(['${placeholderName}'])}
- { placeholderPattern: /^${placeholderName}$/ }`);
}
});
Object.keys(replacements).forEach(key => {
if (!metadata.placeholderNames.has(key)) {
throw new Error(`Unknown substitution "${key}" given`);
}
});
}
metadata.placeholders.slice().reverse().forEach(placeholder => {
try {
var _ref;
applyReplacement(placeholder, ast, (_ref = replacements && replacements[placeholder.name]) != null ? _ref : null);
} catch (e) {
e.message = `@babel/template placeholder "${placeholder.name}": ${e.message}`;
throw e;
}
});
return ast;
}
function applyReplacement(placeholder, ast, replacement) {
if (placeholder.isDuplicate) {
if (Array.isArray(replacement)) {
replacement = replacement.map(node => cloneNode(node));
} else if (typeof replacement === "object") {
replacement = cloneNode(replacement);
}
}
const {
parent,
key,
index
} = placeholder.resolve(ast);
if (placeholder.type === "string") {
if (typeof replacement === "string") {
replacement = stringLiteral(replacement);
}
if (!replacement || !isStringLiteral(replacement)) {
throw new Error("Expected string substitution");
}
} else if (placeholder.type === "statement") {
if (index === undefined) {
if (!replacement) {
replacement = emptyStatement();
} else if (Array.isArray(replacement)) {
replacement = blockStatement(replacement);
} else if (typeof replacement === "string") {
replacement = expressionStatement(identifier(replacement));
} else if (!isStatement(replacement)) {
replacement = expressionStatement(replacement);
}
} else {
if (replacement && !Array.isArray(replacement)) {
if (typeof replacement === "string") {
replacement = identifier(replacement);
}
if (!isStatement(replacement)) {
replacement = expressionStatement(replacement);
}
}
}
} else if (placeholder.type === "param") {
if (typeof replacement === "string") {
replacement = identifier(replacement);
}
if (index === undefined) throw new Error("Assertion failure.");
} else {
if (typeof replacement === "string") {
replacement = identifier(replacement);
}
if (Array.isArray(replacement)) {
throw new Error("Cannot replace single expression with an array.");
}
}
function set(parent, key, value) {
const node = parent[key];
parent[key] = value;
if (node.type === "Identifier" || node.type === "Placeholder") {
if (node.typeAnnotation) {
value.typeAnnotation = node.typeAnnotation;
}
if (node.optional) {
value.optional = node.optional;
}
if (node.decorators) {
value.decorators = node.decorators;
}
}
}
if (index === undefined) {
validate(parent, key, replacement);
set(parent, key, replacement);
} else {
const items = parent[key].slice();
if (placeholder.type === "statement" || placeholder.type === "param") {
if (replacement == null) {
items.splice(index, 1);
} else if (Array.isArray(replacement)) {
items.splice(index, 1, ...replacement);
} else {
set(items, index, replacement);
}
} else {
set(items, index, replacement);
}
validate(parent, key, items);
parent[key] = items;
}
}
//# sourceMappingURL=populate.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definitions/index.ts"],"names":[],"mappings":";;;;;AAEA,sDAAgC;AAChC,8DAAwC;AACxC,oDAA2B;AAC3B,sEAA6C;AAC7C,sDAA6B;AAC7B,4DAAmC;AACnC,kFAAyD;AACzD,gEAAuC;AACvC,gEAAuC;AACvC,gEAAuC;AACvC,wEAAuE;AACvE,8DAAqC;AACrC,sEAA6C;AAC7C,kEAAyC;AACzC,wEAA+C;AAC/C,sDAA+C;AAE/C,MAAM,WAAW,GAAuC;IACtD,gBAAS;IACT,oBAAa;IACb,eAAK;IACL,wBAAc;IACd,gBAAM;IACN,mBAAS;IACT,8BAAoB;IACpB,qBAAW;IACX,qBAAW;IACX,qBAAW;IACX,yBAAe;IACf,oBAAU;IACV,wBAAc;IACd,sBAAY;IACZ,yBAAe;CAChB,CAAA;AAED,SAAwB,WAAW,CAAC,IAAwB;IAC1D,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAA,gBAAS,EAAC,IAAI,CAAC,CAAC,CAAA;AAChE,CAAC;AAFD,8BAEC;AAqBD,MAAM,CAAC,OAAO,GAAG,WAAW,CAAA"}

View File

@@ -0,0 +1,34 @@
Prism.languages.eiffel = {
'comment': /--.*/,
'string': [
// Aligned-verbatim-strings
{
pattern: /"([^[]*)\[[\s\S]*?\]\1"/,
greedy: true
},
// Non-aligned-verbatim-strings
{
pattern: /"([^{]*)\{[\s\S]*?\}\1"/,
greedy: true
},
// Single-line string
{
pattern: /"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/,
greedy: true
}
],
// normal char | special char | char code
'char': /'(?:%.|[^%'\r\n])+'/,
'keyword': /\b(?:across|agent|alias|all|and|as|assign|attached|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,
'boolean': /\b(?:False|True)\b/i,
// Convention: class-names are always all upper-case characters
'class-name': /\b[A-Z][\dA-Z_]*\b/,
'number': [
// hexa | octal | bin
/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,
// Decimal
/(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i
],
'punctuation': /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,
'operator': /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,oCAAoC,EACpC,UAAU,EACX,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAG1E,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,MAAM,iBAAiB,GACzB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;CAAE,GAC3D,CAAC,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,CAAA;AAElC,eAAO,MAAM,YAAY,EAAE,oCA8C1B,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5C,KAAK,EAAE,iBAAiB,CAAA;IACxB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,WAAW,EAAE,OAAO,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;IACnB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,OAAO,EAAE,iBAAiB,CAAA;CAC3B,CAkGA,CAAA"}

View File

@@ -0,0 +1,3 @@
import type { HTTPResolverOptions, JSONSchema } from "../types/index.js";
declare const _default: HTTPResolverOptions<JSONSchema>;
export default _default;

View File

@@ -0,0 +1,34 @@
#ifndef WASM_H
#define WASM_H
#include <unordered_map>
#include "../shared/BruteForceBackend.hh"
#include "../DirTree.hh"
extern "C" {
int wasm_backend_add_watch(const char *filename, void *backend);
void wasm_backend_remove_watch(int wd);
void wasm_backend_event_handler(void *backend, int wd, int type, char *filename);
};
struct WasmSubscription {
std::shared_ptr<DirTree> tree;
std::string path;
WatcherRef watcher;
};
class WasmBackend : public BruteForceBackend {
public:
void start() override;
void subscribe(WatcherRef watcher) override;
void unsubscribe(WatcherRef watcher) override;
void handleEvent(int wd, int type, char *filename);
private:
int mWasm;
std::unordered_multimap<int, std::shared_ptr<WasmSubscription>> mSubscriptions;
void watchDir(WatcherRef watcher, std::string path, std::shared_ptr<DirTree> tree);
bool handleSubscription(int type, char *filename, std::shared_ptr<WasmSubscription> sub);
};
#endif

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 MonitorStop = createLucideIcon("MonitorStop", [
["path", { d: "M12 17v4", key: "1riwvh" }],
["path", { d: "M8 21h8", key: "1ev6f3" }],
["rect", { x: "2", y: "3", width: "20", height: "14", rx: "2", key: "x3v2xh" }],
["rect", { x: "9", y: "7", width: "6", height: "6", rx: "1", key: "5m2oou" }]
]);
export { MonitorStop as default };
//# sourceMappingURL=monitor-stop.js.map

View File

@@ -0,0 +1,386 @@
const fs = require('fs')
const path = require('path')
const os = require('os')
const crypto = require('crypto')
const packageJson = require('../package.json')
const version = packageJson.version
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg
// Parse src into an Object
function parse (src) {
const obj = {}
// Convert buffer to string
let lines = src.toString()
// Convert line breaks to same format
lines = lines.replace(/\r\n?/mg, '\n')
let match
while ((match = LINE.exec(lines)) != null) {
const key = match[1]
// Default undefined or null to empty string
let value = (match[2] || '')
// Remove whitespace
value = value.trim()
// Check if double quoted
const maybeQuote = value[0]
// Remove surrounding quotes
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2')
// Expand newlines if double quoted
if (maybeQuote === '"') {
value = value.replace(/\\n/g, '\n')
value = value.replace(/\\r/g, '\r')
}
// Add to object
obj[key] = value
}
return obj
}
function _parseVault (options) {
options = options || {}
const vaultPath = _vaultPath(options)
options.path = vaultPath // parse .env.vault
const result = DotenvModule.configDotenv(options)
if (!result.parsed) {
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)
err.code = 'MISSING_DATA'
throw err
}
// handle scenario for comma separated keys - for use with key rotation
// example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod"
const keys = _dotenvKey(options).split(',')
const length = keys.length
let decrypted
for (let i = 0; i < length; i++) {
try {
// Get full key
const key = keys[i].trim()
// Get instructions for decrypt
const attrs = _instructions(result, key)
// Decrypt
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)
break
} catch (error) {
// last key
if (i + 1 >= length) {
throw error
}
// try next key
}
}
// Parse decrypted .env string
return DotenvModule.parse(decrypted)
}
function _warn (message) {
console.log(`[dotenv@${version}][WARN] ${message}`)
}
function _debug (message) {
console.log(`[dotenv@${version}][DEBUG] ${message}`)
}
function _log (message) {
console.log(`[dotenv@${version}] ${message}`)
}
function _dotenvKey (options) {
// prioritize developer directly setting options.DOTENV_KEY
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
return options.DOTENV_KEY
}
// secondary infra already contains a DOTENV_KEY environment variable
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
return process.env.DOTENV_KEY
}
// fallback to empty string
return ''
}
function _instructions (result, dotenvKey) {
// Parse DOTENV_KEY. Format is a URI
let uri
try {
uri = new URL(dotenvKey)
} catch (error) {
if (error.code === 'ERR_INVALID_URL') {
const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')
err.code = 'INVALID_DOTENV_KEY'
throw err
}
throw error
}
// Get decrypt key
const key = uri.password
if (!key) {
const err = new Error('INVALID_DOTENV_KEY: Missing key part')
err.code = 'INVALID_DOTENV_KEY'
throw err
}
// Get environment
const environment = uri.searchParams.get('environment')
if (!environment) {
const err = new Error('INVALID_DOTENV_KEY: Missing environment part')
err.code = 'INVALID_DOTENV_KEY'
throw err
}
// Get ciphertext payload
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`
const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION
if (!ciphertext) {
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)
err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'
throw err
}
return { ciphertext, key }
}
function _vaultPath (options) {
let possibleVaultPath = null
if (options && options.path && options.path.length > 0) {
if (Array.isArray(options.path)) {
for (const filepath of options.path) {
if (fs.existsSync(filepath)) {
possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`
}
}
} else {
possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`
}
} else {
possibleVaultPath = path.resolve(process.cwd(), '.env.vault')
}
if (fs.existsSync(possibleVaultPath)) {
return possibleVaultPath
}
return null
}
function _resolveHome (envPath) {
return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath
}
function _configVault (options) {
const debug = Boolean(options && options.debug)
const quiet = options && 'quiet' in options ? options.quiet : true
if (debug || !quiet) {
_log('Loading env from encrypted .env.vault')
}
const parsed = DotenvModule._parseVault(options)
let processEnv = process.env
if (options && options.processEnv != null) {
processEnv = options.processEnv
}
DotenvModule.populate(processEnv, parsed, options)
return { parsed }
}
function configDotenv (options) {
const dotenvPath = path.resolve(process.cwd(), '.env')
let encoding = 'utf8'
const debug = Boolean(options && options.debug)
const quiet = options && 'quiet' in options ? options.quiet : true
if (options && options.encoding) {
encoding = options.encoding
} else {
if (debug) {
_debug('No encoding is specified. UTF-8 is used by default')
}
}
let optionPaths = [dotenvPath] // default, look for .env
if (options && options.path) {
if (!Array.isArray(options.path)) {
optionPaths = [_resolveHome(options.path)]
} else {
optionPaths = [] // reset default
for (const filepath of options.path) {
optionPaths.push(_resolveHome(filepath))
}
}
}
// Build the parsed data in a temporary object (because we need to return it). Once we have the final
// parsed data, we will combine it with process.env (or options.processEnv if provided).
let lastError
const parsedAll = {}
for (const path of optionPaths) {
try {
// Specifying an encoding returns a string instead of a buffer
const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))
DotenvModule.populate(parsedAll, parsed, options)
} catch (e) {
if (debug) {
_debug(`Failed to load ${path} ${e.message}`)
}
lastError = e
}
}
let processEnv = process.env
if (options && options.processEnv != null) {
processEnv = options.processEnv
}
DotenvModule.populate(processEnv, parsedAll, options)
if (debug || !quiet) {
const keysCount = Object.keys(parsedAll).length
const shortPaths = []
for (const filePath of optionPaths) {
try {
const relative = path.relative(process.cwd(), filePath)
shortPaths.push(relative)
} catch (e) {
if (debug) {
_debug(`Failed to load ${filePath} ${e.message}`)
}
lastError = e
}
}
_log(`injecting env (${keysCount}) from ${shortPaths.join(',')}`)
}
if (lastError) {
return { parsed: parsedAll, error: lastError }
} else {
return { parsed: parsedAll }
}
}
// Populates process.env from .env file
function config (options) {
// fallback to original dotenv if DOTENV_KEY is not set
if (_dotenvKey(options).length === 0) {
return DotenvModule.configDotenv(options)
}
const vaultPath = _vaultPath(options)
// dotenvKey exists but .env.vault file does not exist
if (!vaultPath) {
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)
return DotenvModule.configDotenv(options)
}
return DotenvModule._configVault(options)
}
function decrypt (encrypted, keyStr) {
const key = Buffer.from(keyStr.slice(-64), 'hex')
let ciphertext = Buffer.from(encrypted, 'base64')
const nonce = ciphertext.subarray(0, 12)
const authTag = ciphertext.subarray(-16)
ciphertext = ciphertext.subarray(12, -16)
try {
const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)
aesgcm.setAuthTag(authTag)
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`
} catch (error) {
const isRange = error instanceof RangeError
const invalidKeyLength = error.message === 'Invalid key length'
const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'
if (isRange || invalidKeyLength) {
const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')
err.code = 'INVALID_DOTENV_KEY'
throw err
} else if (decryptionFailed) {
const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')
err.code = 'DECRYPTION_FAILED'
throw err
} else {
throw error
}
}
}
// Populate process.env with parsed values
function populate (processEnv, parsed, options = {}) {
const debug = Boolean(options && options.debug)
const override = Boolean(options && options.override)
if (typeof parsed !== 'object') {
const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')
err.code = 'OBJECT_REQUIRED'
throw err
}
// Set process.env
for (const key of Object.keys(parsed)) {
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
if (override === true) {
processEnv[key] = parsed[key]
}
if (debug) {
if (override === true) {
_debug(`"${key}" is already defined and WAS overwritten`)
} else {
_debug(`"${key}" is already defined and was NOT overwritten`)
}
}
} else {
processEnv[key] = parsed[key]
}
}
}
const DotenvModule = {
configDotenv,
_configVault,
_parseVault,
config,
decrypt,
parse,
populate
}
module.exports.configDotenv = DotenvModule.configDotenv
module.exports._configVault = DotenvModule._configVault
module.exports._parseVault = DotenvModule._parseVault
module.exports.config = DotenvModule.config
module.exports.decrypt = DotenvModule.decrypt
module.exports.parse = DotenvModule.parse
module.exports.populate = DotenvModule.populate
module.exports = DotenvModule

View File

@@ -0,0 +1,5 @@
/**
* http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
* @param locales
*/
export declare function CanonicalizeLocaleList(locales?: string | readonly string[]): string[];

View File

@@ -0,0 +1 @@
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/exports/postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAA;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AACrE,cAAc,sBAAsB,CAAA"}

View File

@@ -0,0 +1,56 @@
import { test } from "vitest";
import * as z from "zod/v3";
const crazySchema = z.object({
tuple: z.tuple([
z.string().nullable().optional(),
z.number().nullable().optional(),
z.boolean().nullable().optional(),
z.null().nullable().optional(),
z.undefined().nullable().optional(),
z.literal("1234").nullable().optional(),
]),
merged: z
.object({
k1: z.string().optional(),
})
.merge(z.object({ k1: z.string().nullable(), k2: z.number() })),
union: z.array(z.union([z.literal("asdf"), z.literal(12)])).nonempty(),
array: z.array(z.number()),
// sumTransformer: z.transformer(z.array(z.number()), z.number(), (arg) => {
// return arg.reduce((a, b) => a + b, 0);
// }),
sumMinLength: z.array(z.number()).refine((arg) => arg.length > 5),
intersection: z.intersection(z.object({ p1: z.string().optional() }), z.object({ p1: z.number().optional() })),
enum: z.intersection(z.enum(["zero", "one"]), z.enum(["one", "two"])),
nonstrict: z.object({ points: z.number() }).nonstrict(),
numProm: z.promise(z.number()),
lenfun: z.function(z.tuple([z.string()]), z.boolean()),
});
// const asyncCrazySchema = crazySchema.extend({
// // async_transform: z.transformer(
// // z.array(z.number()),
// // z.number(),
// // async (arg) => {
// // return arg.reduce((a, b) => a + b, 0);
// // }
// // ),
// async_refine: z.array(z.number()).refine(async (arg) => arg.length > 5),
// });
test("parse", () => {
crazySchema.parse({
tuple: ["asdf", 1234, true, null, undefined, "1234"],
merged: { k1: "asdf", k2: 12 },
union: ["asdf", 12, "asdf", 12, "asdf", 12],
array: [12, 15, 16],
// sumTransformer: [12, 15, 16],
sumMinLength: [12, 15, 16, 98, 24, 63],
intersection: {},
enum: "one",
nonstrict: { points: 1234 },
numProm: Promise.resolve(12),
lenfun: (x: string) => x.length,
});
});

View File

@@ -0,0 +1,99 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import type { AnyPgTable } from "../table.js";
import { type Equal } from "../../utils.js";
import { PgColumn, PgColumnBuilder } from "./common.js";
export type PgNumericBuilderInitial<TName extends string> = PgNumericBuilder<{
name: TName;
dataType: 'string';
columnType: 'PgNumeric';
data: string;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgNumericBuilder<T extends ColumnBuilderBaseConfig<'string', 'PgNumeric'>> extends PgColumnBuilder<T, {
precision: number | undefined;
scale: number | undefined;
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], precision?: number, scale?: number);
}
export declare class PgNumeric<T extends ColumnBaseConfig<'string', 'PgNumeric'>> extends PgColumn<T> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
constructor(table: AnyPgTable<{
name: T['tableName'];
}>, config: PgNumericBuilder<T>['config']);
mapFromDriverValue(value: unknown): string;
getSQLType(): string;
}
export type PgNumericNumberBuilderInitial<TName extends string> = PgNumericNumberBuilder<{
name: TName;
dataType: 'number';
columnType: 'PgNumericNumber';
data: number;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgNumericNumberBuilder<T extends ColumnBuilderBaseConfig<'number', 'PgNumericNumber'>> extends PgColumnBuilder<T, {
precision: number | undefined;
scale: number | undefined;
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], precision?: number, scale?: number);
}
export declare class PgNumericNumber<T extends ColumnBaseConfig<'number', 'PgNumericNumber'>> extends PgColumn<T> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
constructor(table: AnyPgTable<{
name: T['tableName'];
}>, config: PgNumericNumberBuilder<T>['config']);
mapFromDriverValue(value: unknown): number;
mapToDriverValue: StringConstructor;
getSQLType(): string;
}
export type PgNumericBigIntBuilderInitial<TName extends string> = PgNumericBigIntBuilder<{
name: TName;
dataType: 'bigint';
columnType: 'PgNumericBigInt';
data: bigint;
driverParam: string;
enumValues: undefined;
}>;
export declare class PgNumericBigIntBuilder<T extends ColumnBuilderBaseConfig<'bigint', 'PgNumericBigInt'>> extends PgColumnBuilder<T, {
precision: number | undefined;
scale: number | undefined;
}> {
static readonly [entityKind]: string;
constructor(name: T['name'], precision?: number, scale?: number);
}
export declare class PgNumericBigInt<T extends ColumnBaseConfig<'bigint', 'PgNumericBigInt'>> extends PgColumn<T> {
static readonly [entityKind]: string;
readonly precision: number | undefined;
readonly scale: number | undefined;
constructor(table: AnyPgTable<{
name: T['tableName'];
}>, config: PgNumericBigIntBuilder<T>['config']);
mapFromDriverValue: BigIntConstructor;
mapToDriverValue: StringConstructor;
getSQLType(): string;
}
export type PgNumericConfig<T extends 'string' | 'number' | 'bigint' = 'string' | 'number' | 'bigint'> = {
precision: number;
scale?: number;
mode?: T;
} | {
precision?: number;
scale: number;
mode?: T;
} | {
precision?: number;
scale?: number;
mode: T;
};
export declare function numeric<TMode extends 'string' | 'number' | 'bigint'>(config?: PgNumericConfig<TMode>): Equal<TMode, 'number'> extends true ? PgNumericNumberBuilderInitial<''> : Equal<TMode, 'bigint'> extends true ? PgNumericBigIntBuilderInitial<''> : PgNumericBuilderInitial<''>;
export declare function numeric<TName extends string, TMode extends 'string' | 'number' | 'bigint'>(name: TName, config?: PgNumericConfig<TMode>): Equal<TMode, 'number'> extends true ? PgNumericNumberBuilderInitial<TName> : Equal<TMode, 'bigint'> extends true ? PgNumericBigIntBuilderInitial<TName> : PgNumericBuilderInitial<TName>;
export declare const decimal: typeof numeric;

View File

@@ -0,0 +1,362 @@
import { fieldAffectsData, fieldShouldBeLocalized } from '../../config/types.js';
import { getFieldPaths } from '../../getFieldPaths.js';
import { traverseFields } from './traverseFields.js';
export const promise = async ({ id, blockData, collection, context, doc, field, fieldIndex, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingDoc, siblingFields })=>{
const { indexPath, path, schemaPath } = getFieldPaths({
field,
index: fieldIndex,
parentIndexPath,
parentPath,
parentSchemaPath
});
const { localization } = req.payload.config;
const pathSegments = path ? path.split('.') : [];
const schemaPathSegments = schemaPath ? schemaPath.split('.') : [];
const indexPathSegments = indexPath ? indexPath.split('-').filter(Boolean)?.map(Number) : [];
if (fieldAffectsData(field)) {
let fieldData = siblingDoc?.[field.name];
const fieldIsLocalized = localization && fieldShouldBeLocalized({
field,
parentIsLocalized
});
// Run field beforeDuplicate hooks.
// These hooks are responsible for resetting the `id` field values of array and block rows. See `baseIDField`.
if (Array.isArray('hooks' in field && field.hooks?.beforeDuplicate)) {
if (fieldIsLocalized) {
const localeData = {};
for (const locale of localization.localeCodes){
const beforeDuplicateArgs = {
blockData,
collection,
context,
data: doc,
field,
global: undefined,
indexPath: indexPathSegments,
path: pathSegments,
previousSiblingDoc: siblingDoc,
previousValue: siblingDoc[field.name]?.[locale],
req,
schemaPath: schemaPathSegments,
siblingData: siblingDoc,
siblingDocWithLocales: siblingDoc,
siblingFields: siblingFields,
value: siblingDoc[field.name]?.[locale]
};
let hookResult;
if ('hooks' in field && field.hooks?.beforeDuplicate) {
for (const hook of field.hooks.beforeDuplicate){
hookResult = await hook(beforeDuplicateArgs);
}
}
if (typeof hookResult !== 'undefined') {
localeData[locale] = hookResult;
}
}
siblingDoc[field.name] = localeData;
} else {
const beforeDuplicateArgs = {
blockData,
collection,
context,
data: doc,
field,
global: undefined,
indexPath: indexPathSegments,
path: pathSegments,
previousSiblingDoc: siblingDoc,
previousValue: siblingDoc[field.name],
req,
schemaPath: schemaPathSegments,
siblingData: siblingDoc,
siblingDocWithLocales: siblingDoc,
siblingFields: siblingFields,
value: siblingDoc[field.name]
};
let hookResult;
if ('hooks' in field && field.hooks?.beforeDuplicate) {
for (const hook of field.hooks.beforeDuplicate){
hookResult = await hook(beforeDuplicateArgs);
}
}
if (typeof hookResult !== 'undefined') {
siblingDoc[field.name] = hookResult;
}
}
}
// First, for any localized fields, we will loop over locales
// and if locale data is present, traverse the sub fields.
// There are only a few different fields where this is possible.
if (fieldIsLocalized) {
if (typeof fieldData !== 'object' || fieldData === null) {
siblingDoc[field.name] = {};
fieldData = siblingDoc[field.name];
}
const promises = [];
localization.localeCodes.forEach((locale)=>{
if (fieldData[locale]) {
switch(field.type){
case 'array':
{
const rows = fieldData[locale];
if (Array.isArray(rows)) {
const promises = [];
rows.forEach((row, rowIndex)=>{
promises.push(traverseFields({
id,
blockData,
collection,
context,
doc,
fields: field.fields,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path + '.' + rowIndex,
parentSchemaPath: schemaPath,
req,
siblingDoc: row
}));
});
}
break;
}
case 'blocks':
{
const rows = fieldData[locale];
if (Array.isArray(rows)) {
const promises = [];
rows.forEach((row, rowIndex)=>{
const blockTypeToMatch = row.blockType;
const block = req.payload.blocks[blockTypeToMatch] ?? (field.blockReferences ?? field.blocks).find((curBlock)=>typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch);
promises.push(traverseFields({
id,
blockData: row,
collection,
context,
doc,
fields: block.fields,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path + '.' + rowIndex,
parentSchemaPath: schemaPath + '.' + block.slug,
req,
siblingDoc: row
}));
});
}
break;
}
case 'group':
case 'tab':
{
promises.push(traverseFields({
id,
blockData,
collection,
context,
doc,
fields: field.fields,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path,
parentSchemaPath: schemaPath,
req,
siblingDoc: fieldData[locale]
}));
break;
}
}
}
});
await Promise.all(promises);
} else {
// If the field is not localized, but it affects data,
// we need to further traverse its children
// so the child fields can run beforeDuplicate hooks
switch(field.type){
case 'array':
{
const rows = siblingDoc[field.name];
if (Array.isArray(rows)) {
const promises = [];
rows.forEach((row, rowIndex)=>{
promises.push(traverseFields({
id,
blockData,
collection,
context,
doc,
fields: field.fields,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path + '.' + rowIndex,
parentSchemaPath: schemaPath,
req,
siblingDoc: row
}));
});
await Promise.all(promises);
}
break;
}
case 'blocks':
{
const rows = siblingDoc[field.name];
if (Array.isArray(rows)) {
const promises = [];
rows.forEach((row, rowIndex)=>{
const blockTypeToMatch = row.blockType;
const block = req.payload.blocks[blockTypeToMatch] ?? (field.blockReferences ?? field.blocks).find((curBlock)=>typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch);
if (block) {
;
row.blockType = blockTypeToMatch;
promises.push(traverseFields({
id,
blockData: row,
collection,
context,
doc,
fields: block.fields,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path + '.' + rowIndex,
parentSchemaPath: schemaPath + '.' + block.slug,
req,
siblingDoc: row
}));
}
});
await Promise.all(promises);
}
break;
}
case 'group':
{
if (typeof siblingDoc[field.name] !== 'object') {
siblingDoc[field.name] = {};
}
const groupDoc = siblingDoc[field.name];
await traverseFields({
id,
blockData,
collection,
context,
doc,
fields: field.fields,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path,
parentSchemaPath: schemaPath,
req,
siblingDoc: groupDoc
});
break;
}
case 'tab':
{
if (typeof siblingDoc[field.name] !== 'object') {
siblingDoc[field.name] = {};
}
const tabDoc = siblingDoc[field.name];
await traverseFields({
id,
blockData,
collection,
context,
doc,
fields: field.fields,
overrideAccess,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentPath: path,
parentSchemaPath: schemaPath,
req,
siblingDoc: tabDoc
});
break;
}
}
}
} else {
// Finally, we traverse fields which do not affect data here - collapsibles, rows, unnamed groups
switch(field.type){
case 'collapsible':
case 'group':
case 'row':
{
await traverseFields({
id,
blockData,
collection,
context,
doc,
fields: field.fields,
overrideAccess,
parentIndexPath: indexPath,
parentIsLocalized,
parentPath,
parentSchemaPath: schemaPath,
req,
siblingDoc
});
break;
}
// Unnamed Tab
// @ts-expect-error `fieldAffectsData` inferred return type doesn't account for TabAsField
case 'tab':
{
await traverseFields({
id,
blockData,
collection,
context,
doc,
// @ts-expect-error `fieldAffectsData` inferred return type doesn't account for TabAsField
fields: field.fields,
overrideAccess,
parentIndexPath: indexPath,
parentIsLocalized,
parentPath,
parentSchemaPath: schemaPath,
req,
siblingDoc
});
break;
}
case 'tabs':
{
await traverseFields({
id,
blockData,
collection,
context,
doc,
fields: field.tabs.map((tab)=>({
...tab,
type: 'tab'
})),
overrideAccess,
parentIndexPath: indexPath,
parentIsLocalized,
parentPath: path,
parentSchemaPath: schemaPath,
req,
siblingDoc
});
break;
}
default:
{
break;
}
}
}
};
//# sourceMappingURL=promise.js.map

View File

@@ -0,0 +1,81 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextAPI = void 0;
const NoopContextManager_1 = require("../context/NoopContextManager");
const global_utils_1 = require("../internal/global-utils");
const diag_1 = require("./diag");
const API_NAME = 'context';
const NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager();
/**
* Singleton object which represents the entry point to the OpenTelemetry Context API
*/
class ContextAPI {
/** Empty private constructor prevents end users from constructing a new instance of the API */
constructor() { }
/** Get the singleton instance of the Context API */
static getInstance() {
if (!this._instance) {
this._instance = new ContextAPI();
}
return this._instance;
}
/**
* Set the current context manager.
*
* @returns true if the context manager was successfully registered, else false
*/
setGlobalContextManager(contextManager) {
return (0, global_utils_1.registerGlobal)(API_NAME, contextManager, diag_1.DiagAPI.instance());
}
/**
* Get the currently active context
*/
active() {
return this._getContextManager().active();
}
/**
* Execute a function with an active context
*
* @param context context to be active during function execution
* @param fn function to execute in a context
* @param thisArg optional receiver to be used for calling fn
* @param args optional arguments forwarded to fn
*/
with(context, fn, thisArg, ...args) {
return this._getContextManager().with(context, fn, thisArg, ...args);
}
/**
* Bind a context to a target function or event emitter
*
* @param context context to bind to the event emitter or function. Defaults to the currently active context
* @param target function or event emitter to bind
*/
bind(context, target) {
return this._getContextManager().bind(context, target);
}
_getContextManager() {
return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_CONTEXT_MANAGER;
}
/** Disable and remove the global context manager */
disable() {
this._getContextManager().disable();
(0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());
}
}
exports.ContextAPI = ContextAPI;
//# sourceMappingURL=context.js.map

View File

@@ -0,0 +1,19 @@
import type { Data, FileSize, SanitizedCollectionConfig } from 'payload';
import React from 'react';
import './index.scss';
type FileInfo = {
url: string;
} & FileSize;
type FilesSizesWithUrl = {
[key: string]: FileInfo;
};
export type PreviewSizesProps = {
doc: {
sizes?: FilesSizesWithUrl;
} & Data;
imageCacheTag?: string;
uploadConfig: SanitizedCollectionConfig['upload'];
};
export declare const PreviewSizes: React.FC<PreviewSizesProps>;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,18 @@
import { cache } from 'react';
// See https://github.com/vercel/next.js/discussions/58862
function getCacheImpl() {
const value = {
locale: undefined
};
return value;
}
const getCache = cache(getCacheImpl);
function getCachedRequestLocale() {
return getCache().locale;
}
function setCachedRequestLocale(locale) {
getCache().locale = locale;
}
export { getCachedRequestLocale, setCachedRequestLocale };

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 ReplyAll = createLucideIcon("ReplyAll", [
["polyline", { points: "7 17 2 12 7 7", key: "t83bqg" }],
["polyline", { points: "12 17 7 12 12 7", key: "1g4ajm" }],
["path", { d: "M22 18v-2a4 4 0 0 0-4-4H7", key: "1fcyog" }]
]);
export { ReplyAll as default };
//# sourceMappingURL=reply-all.js.map

View File

@@ -0,0 +1,78 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var column_exports = {};
__export(column_exports, {
Column: () => Column
});
module.exports = __toCommonJS(column_exports);
var import_entity = require("./entity.cjs");
class Column {
constructor(table, config) {
this.table = table;
this.config = config;
this.name = config.name;
this.keyAsName = config.keyAsName;
this.notNull = config.notNull;
this.default = config.default;
this.defaultFn = config.defaultFn;
this.onUpdateFn = config.onUpdateFn;
this.hasDefault = config.hasDefault;
this.primary = config.primaryKey;
this.isUnique = config.isUnique;
this.uniqueName = config.uniqueName;
this.uniqueType = config.uniqueType;
this.dataType = config.dataType;
this.columnType = config.columnType;
this.generated = config.generated;
this.generatedIdentity = config.generatedIdentity;
}
static [import_entity.entityKind] = "Column";
name;
keyAsName;
primary;
notNull;
default;
defaultFn;
onUpdateFn;
hasDefault;
isUnique;
uniqueName;
uniqueType;
dataType;
columnType;
enumValues = void 0;
generated = void 0;
generatedIdentity = void 0;
config;
mapFromDriverValue(value) {
return value;
}
mapToDriverValue(value) {
return value;
}
// ** @internal */
shouldDisableInsert() {
return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Column
});
//# sourceMappingURL=column.cjs.map

View File

@@ -0,0 +1,162 @@
import { makeOfflineTransport, parseEnvelope, serializeEnvelope } from '@sentry/core';
import { WINDOW } from '../helpers.js';
import { makeFetchTransport } from './fetch.js';
// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being
// modified and simplified: https://github.com/jakearchibald/idb-keyval
//
// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca
// Original license:
// Copyright 2016, Jake Archibald
//
// 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
//
// http://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.
function promisifyRequest(request) {
return new Promise((resolve, reject) => {
// @ts-expect-error - file size hacks
request.oncomplete = request.onsuccess = () => resolve(request.result);
// @ts-expect-error - file size hacks
request.onabort = request.onerror = () => reject(request.error);
});
}
/** Create or open an IndexedDb store */
function createStore(dbName, storeName) {
const request = indexedDB.open(dbName);
request.onupgradeneeded = () => request.result.createObjectStore(storeName);
const dbp = promisifyRequest(request);
return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));
}
function keys(store) {
return promisifyRequest(store.getAllKeys() );
}
/** Insert into the end of the store */
function push(store, value, maxQueueSize) {
return store(store => {
return keys(store).then(keys => {
if (keys.length >= maxQueueSize) {
return;
}
// We insert with an incremented key so that the entries are popped in order
store.put(value, Math.max(...keys, 0) + 1);
return promisifyRequest(store.transaction);
});
});
}
/** Insert into the front of the store */
function unshift(store, value, maxQueueSize) {
return store(store => {
return keys(store).then(keys => {
if (keys.length >= maxQueueSize) {
return;
}
// We insert with an decremented key so that the entries are popped in order
store.put(value, Math.min(...keys, 0) - 1);
return promisifyRequest(store.transaction);
});
});
}
/** Pop the oldest value from the store */
function shift(store) {
return store(store => {
return keys(store).then(keys => {
const firstKey = keys[0];
if (firstKey == null) {
return undefined;
}
return promisifyRequest(store.get(firstKey)).then(value => {
store.delete(firstKey);
return promisifyRequest(store.transaction).then(() => value);
});
});
});
}
function createIndexedDbStore(options) {
let store;
// Lazily create the store only when it's needed
function getStore() {
if (store == undefined) {
store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');
}
return store;
}
return {
push: async (env) => {
try {
const serialized = await serializeEnvelope(env);
await push(getStore(), serialized, options.maxQueueSize || 30);
} catch {
//
}
},
unshift: async (env) => {
try {
const serialized = await serializeEnvelope(env);
await unshift(getStore(), serialized, options.maxQueueSize || 30);
} catch {
//
}
},
shift: async () => {
try {
const deserialized = await shift(getStore());
if (deserialized) {
return parseEnvelope(deserialized);
}
} catch {
//
}
return undefined;
},
};
}
function makeIndexedDbOfflineTransport(
createTransport,
) {
return options => {
const transport = createTransport({ ...options, createStore: createIndexedDbStore });
WINDOW.addEventListener('online', async _ => {
await transport.flush();
});
return transport;
};
}
/**
* Creates a transport that uses IndexedDb to store events when offline.
*/
function makeBrowserOfflineTransport(
createTransport = makeFetchTransport,
) {
return makeIndexedDbOfflineTransport(makeOfflineTransport(createTransport));
}
export { createStore, makeBrowserOfflineTransport, push, shift, unshift };
//# sourceMappingURL=offline.js.map

View File

@@ -0,0 +1,18 @@
import PropTypes from 'prop-types';
export var timeoutsShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
enter: PropTypes.number,
exit: PropTypes.number,
appear: PropTypes.number
}).isRequired]) : null;
export var classNamesShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
enter: PropTypes.string,
exit: PropTypes.string,
active: PropTypes.string
}), PropTypes.shape({
enter: PropTypes.string,
enterDone: PropTypes.string,
enterActive: PropTypes.string,
exit: PropTypes.string,
exitDone: PropTypes.string,
exitActive: PropTypes.string
})]) : null;

View File

@@ -0,0 +1,37 @@
import { type FolderOrDocument } from 'payload/shared';
import React from 'react';
import type { Props as ButtonProps } from '../../Button/types.js';
import './index.scss';
/**
* This is the button shown on the edit document view. It uses the more generic `MoveDocToFolderButton` component.
*/
export declare function MoveDocToFolder({ buttonProps, className, folderCollectionSlug, folderFieldName, }: {
readonly buttonProps?: Partial<ButtonProps>;
readonly className?: string;
readonly folderCollectionSlug: string;
readonly folderFieldName: string;
}): React.JSX.Element;
type MoveDocToFolderButtonProps = {
readonly buttonProps?: Partial<ButtonProps>;
readonly className?: string;
readonly collectionSlug: string;
readonly docData: FolderOrDocument['value'];
readonly docID: number | string;
readonly docTitle?: string;
readonly folderCollectionSlug: string;
readonly folderFieldName: string;
readonly fromFolderID?: number | string;
readonly fromFolderName: string;
readonly modalSlug: string;
readonly onConfirm?: (args: {
id: number | string;
name: string;
}) => Promise<void> | void;
readonly skipConfirmModal?: boolean;
};
/**
* This is a more generic button that can be used in other contexts, such as table cells and the edit view.
*/
export declare const MoveDocToFolderButton: ({ buttonProps, className, collectionSlug, docData, docID, docTitle, folderCollectionSlug, folderFieldName, fromFolderID, fromFolderName, modalSlug, onConfirm, skipConfirmModal, }: MoveDocToFolderButtonProps) => React.JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,33 @@
@import '../../scss/styles.scss';
@layer payload-default {
.error-pill {
align-self: center;
align-items: center;
border: 0;
padding: 0 base(0.25);
flex-shrink: 0;
border-radius: var(--style-radius-l);
line-height: 18px;
font-size: 11px;
text-align: center;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
background: var(--theme-error-300);
color: var(--theme-error-950);
&--fixed-width {
width: 18px;
height: 18px;
border-radius: 50%;
position: relative;
}
&__count {
letter-spacing: 0.5px;
margin-left: 0.5px;
}
}
}

View File

@@ -0,0 +1,191 @@
import { status as httpStatus } from 'http-status';
import { buildAfterOperation } from '../../collections/operations/utilities/buildAfterOperation.js';
import { buildBeforeOperation } from '../../collections/operations/utilities/buildBeforeOperation.js';
import { APIError, Forbidden } from '../../errors/index.js';
import { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js';
import { commitTransaction } from '../../utilities/commitTransaction.js';
import { initTransaction } from '../../utilities/initTransaction.js';
import { killTransaction } from '../../utilities/killTransaction.js';
import { getFieldsToSign } from '../getFieldsToSign.js';
import { jwtSign } from '../jwt.js';
import { addSessionToUser, revokeSession } from '../sessions.js';
import { authenticateLocalStrategy } from '../strategies/local/authenticate.js';
import { generatePasswordSaltHash } from '../strategies/local/generatePasswordSaltHash.js';
export const resetPasswordOperation = async (args)=>{
const { collection: { config: collectionConfig }, data, depth, overrideAccess, req: { payload: { secret }, payload }, req } = args;
if (!Object.prototype.hasOwnProperty.call(data, 'token') || !Object.prototype.hasOwnProperty.call(data, 'password')) {
throw new APIError('Missing required data.', httpStatus.BAD_REQUEST);
}
if (collectionConfig.auth.disableLocalStrategy) {
throw new Forbidden(req.t);
}
let sid;
let user = null;
try {
const shouldCommit = await initTransaction(req);
args = await buildBeforeOperation({
args,
collection: args.collection.config,
operation: 'resetPassword',
overrideAccess
});
// /////////////////////////////////////
// Reset Password
// /////////////////////////////////////
const where = appendNonTrashedFilter({
enableTrash: Boolean(collectionConfig.trash),
trash: false,
where: {
resetPasswordExpiration: {
greater_than: new Date().toISOString()
},
resetPasswordToken: {
equals: data.token
}
}
});
user = await payload.db.findOne({
collection: collectionConfig.slug,
req,
where
});
if (!user) {
throw new APIError('Token is either invalid or has expired.', httpStatus.FORBIDDEN);
}
// TODO: replace this method
const { hash, salt } = await generatePasswordSaltHash({
collection: collectionConfig,
password: data.password,
req
});
user.salt = salt;
user.hash = hash;
user.resetPasswordExpiration = new Date().toISOString();
if (collectionConfig.auth.verify) {
user._verified = Boolean(user._verified);
}
// /////////////////////////////////////
// beforeValidate - Collection
// /////////////////////////////////////
if (collectionConfig.hooks?.beforeValidate?.length) {
for (const hook of collectionConfig.hooks.beforeValidate){
await hook({
collection: args.collection?.config,
context: req.context,
data: user,
operation: 'update',
req
});
}
}
// /////////////////////////////////////
// Update new password
// /////////////////////////////////////
// Ensure updatedAt date is always updated
user.updatedAt = new Date().toISOString();
const doc = await payload.db.updateOne({
id: user.id,
collection: collectionConfig.slug,
data: user,
req
});
await authenticateLocalStrategy({
doc,
password: data.password
});
const fieldsToSignArgs = {
collectionConfig,
email: user.email,
user
};
const session = await addSessionToUser({
collectionConfig,
payload,
req,
user
});
sid = session.sid;
if (sid) {
fieldsToSignArgs.sid = sid;
}
const fieldsToSign = getFieldsToSign(fieldsToSignArgs);
// /////////////////////////////////////
// beforeLogin - Collection
// /////////////////////////////////////
let userBeforeLogin = user;
if (collectionConfig.hooks?.beforeLogin?.length) {
for (const hook of collectionConfig.hooks.beforeLogin){
userBeforeLogin = await hook({
collection: args.collection?.config,
context: args.req.context,
req: args.req,
user: userBeforeLogin
}) || userBeforeLogin;
}
}
const { token } = await jwtSign({
fieldsToSign,
secret,
tokenExpiration: collectionConfig.auth.tokenExpiration
});
req.user = userBeforeLogin;
// /////////////////////////////////////
// afterLogin - Collection
// /////////////////////////////////////
if (collectionConfig.hooks?.afterLogin?.length) {
for (const hook of collectionConfig.hooks.afterLogin){
userBeforeLogin = await hook({
collection: args.collection?.config,
context: args.req.context,
req: args.req,
token,
user: userBeforeLogin
}) || userBeforeLogin;
}
}
const fullUser = await payload.findByID({
id: user.id,
collection: collectionConfig.slug,
depth,
overrideAccess,
req,
trash: false
});
if (shouldCommit) {
await commitTransaction(req);
}
if (fullUser) {
fullUser.collection = collectionConfig.slug;
fullUser._strategy = 'local-jwt';
}
let result = {
token,
user: fullUser
};
// /////////////////////////////////////
// afterOperation - Collection
// /////////////////////////////////////
result = await buildAfterOperation({
args,
collection: args.collection?.config,
operation: 'resetPassword',
overrideAccess,
result
});
return result;
} catch (error) {
if (sid) {
await revokeSession({
collectionConfig,
payload,
req,
sid,
user
});
}
await killTransaction(req);
throw error;
}
};
//# sourceMappingURL=resetPassword.js.map

View File

@@ -0,0 +1,24 @@
import type { LivePreviewConfig } from 'payload';
import React from 'react';
import type { LivePreviewContextType } from './context.js';
export type LivePreviewProviderProps = {
appIsReady?: boolean;
breakpoints?: LivePreviewConfig['breakpoints'];
children: React.ReactNode;
deviceSize?: {
height: number;
width: number;
};
isLivePreviewEnabled?: boolean;
isLivePreviewing: boolean;
/**
* This specifically relates to `admin.preview` function in the config instead of live preview.
*/
isPreviewEnabled?: boolean;
/**
* This specifically relates to `admin.preview` function in the config instead of live preview.
*/
previewURL?: string;
} & Pick<LivePreviewContextType, 'typeofLivePreviewURL' | 'url'>;
export declare const LivePreviewProvider: React.FC<LivePreviewProviderProps>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,17 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { InstrumentationBase, normalize } from './node';
//# sourceMappingURL=index.js.map

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