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,84 @@
/// <reference types="node" />
import type { Middleware, ParameterizedContext, Response } from 'koa';
import type { IncomingMessage } from 'http';
import { HandlerOptions as RawHandlerOptions, OperationContext } from '../handler.mjs';
import { RequestParams } from '../common.mjs';
/**
* The context in the request for the handler.
*
* @category Server/koa
*/
export interface RequestContext {
res: Response;
}
/**
* The GraphQL over HTTP spec compliant request parser for an incoming GraphQL request.
*
* If the HTTP request _is not_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), the function will respond
* on Koa's `ParameterizedContext` response and return `null`.
*
* If the HTTP request _is_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), but is invalid or malformed,
* the function will throw an error and it is up to the user to handle and respond as they see fit.
*
* ```js
* import Koa from 'koa'; // yarn add koa
* import mount from 'koa-mount'; // yarn add koa-mount
* import { parseRequestParams } from 'graphql-http/lib/use/koa';
*
* const app = new Koa();
* app.use(
* mount('/', async (ctx) => {
* try {
* const maybeParams = await parseRequestParams(ctx);
* if (!maybeParams) {
* // not a well-formatted GraphQL over HTTP request,
* // parser responded and there's nothing else to do
* return;
* }
*
* // well-formatted GraphQL over HTTP request,
* // with valid parameters
* ctx.response.status = 200;
* ctx.body = JSON.stringify(maybeParams, null, ' ');
* } catch (err) {
* // well-formatted GraphQL over HTTP request,
* // but with invalid parameters
* ctx.response.status = 400;
* ctx.body = err.message;
* }
* }),
* );
*
* app.listen({ port: 4000 });
* console.log('Listening to port 4000');
* ```
*
* @category Server/koa
*/
export declare function parseRequestParams(ctx: ParameterizedContext): Promise<RequestParams | null>;
/**
* Handler options when using the koa adapter.
*
* @category Server/koa
*/
export type HandlerOptions<Context extends OperationContext = undefined> = RawHandlerOptions<IncomingMessage, RequestContext, Context>;
/**
* Create a GraphQL over HTTP spec compliant request handler for
* the Koa framework.
*
* ```js
* import Koa from 'koa'; // yarn add koa
* import mount from 'koa-mount'; // yarn add koa-mount
* import { createHandler } from 'graphql-http/lib/use/koa';
* import { schema } from './my-graphql-schema/index.mjs';
*
* const app = new Koa();
* app.use(mount('/', createHandler({ schema })));
*
* app.listen({ port: 4000 });
* console.log('Listening to port 4000');
* ```
*
* @category Server/koa
*/
export declare function createHandler<Context extends OperationContext = undefined>(options: HandlerOptions<Context>): Middleware;

View File

@@ -0,0 +1,213 @@
import { Kind } from '../language/kinds.mjs';
import { visit } from '../language/visitor.mjs';
import { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.mjs';
/**
* An instance of this class is passed as the "this" context to all validators,
* allowing access to commonly useful contextual information from within a
* validation rule.
*/
export class ASTValidationContext {
constructor(ast, onError) {
this._ast = ast;
this._fragments = undefined;
this._fragmentSpreads = new Map();
this._recursivelyReferencedFragments = new Map();
this._onError = onError;
}
get [Symbol.toStringTag]() {
return 'ASTValidationContext';
}
reportError(error) {
this._onError(error);
}
getDocument() {
return this._ast;
}
getFragment(name) {
let fragments;
if (this._fragments) {
fragments = this._fragments;
} else {
fragments = Object.create(null);
for (const defNode of this.getDocument().definitions) {
if (defNode.kind === Kind.FRAGMENT_DEFINITION) {
fragments[defNode.name.value] = defNode;
}
}
this._fragments = fragments;
}
return fragments[name];
}
getFragmentSpreads(node) {
let spreads = this._fragmentSpreads.get(node);
if (!spreads) {
spreads = [];
const setsToVisit = [node];
let set;
while ((set = setsToVisit.pop())) {
for (const selection of set.selections) {
if (selection.kind === Kind.FRAGMENT_SPREAD) {
spreads.push(selection);
} else if (selection.selectionSet) {
setsToVisit.push(selection.selectionSet);
}
}
}
this._fragmentSpreads.set(node, spreads);
}
return spreads;
}
getRecursivelyReferencedFragments(operation) {
let fragments = this._recursivelyReferencedFragments.get(operation);
if (!fragments) {
fragments = [];
const collectedNames = Object.create(null);
const nodesToVisit = [operation.selectionSet];
let node;
while ((node = nodesToVisit.pop())) {
for (const spread of this.getFragmentSpreads(node)) {
const fragName = spread.name.value;
if (collectedNames[fragName] !== true) {
collectedNames[fragName] = true;
const fragment = this.getFragment(fragName);
if (fragment) {
fragments.push(fragment);
nodesToVisit.push(fragment.selectionSet);
}
}
}
}
this._recursivelyReferencedFragments.set(operation, fragments);
}
return fragments;
}
}
export class SDLValidationContext extends ASTValidationContext {
constructor(ast, schema, onError) {
super(ast, onError);
this._schema = schema;
}
get [Symbol.toStringTag]() {
return 'SDLValidationContext';
}
getSchema() {
return this._schema;
}
}
export class ValidationContext extends ASTValidationContext {
constructor(schema, ast, typeInfo, onError) {
super(ast, onError);
this._schema = schema;
this._typeInfo = typeInfo;
this._variableUsages = new Map();
this._recursiveVariableUsages = new Map();
}
get [Symbol.toStringTag]() {
return 'ValidationContext';
}
getSchema() {
return this._schema;
}
getVariableUsages(node) {
let usages = this._variableUsages.get(node);
if (!usages) {
const newUsages = [];
const typeInfo = new TypeInfo(this._schema);
visit(
node,
visitWithTypeInfo(typeInfo, {
VariableDefinition: () => false,
Variable(variable) {
newUsages.push({
node: variable,
type: typeInfo.getInputType(),
defaultValue: typeInfo.getDefaultValue(),
parentType: typeInfo.getParentInputType(),
});
},
}),
);
usages = newUsages;
this._variableUsages.set(node, usages);
}
return usages;
}
getRecursiveVariableUsages(operation) {
let usages = this._recursiveVariableUsages.get(operation);
if (!usages) {
usages = this.getVariableUsages(operation);
for (const frag of this.getRecursivelyReferencedFragments(operation)) {
usages = usages.concat(this.getVariableUsages(frag));
}
this._recursiveVariableUsages.set(operation, usages);
}
return usages;
}
getType() {
return this._typeInfo.getType();
}
getParentType() {
return this._typeInfo.getParentType();
}
getInputType() {
return this._typeInfo.getInputType();
}
getParentInputType() {
return this._typeInfo.getParentInputType();
}
getFieldDef() {
return this._typeInfo.getFieldDef();
}
getDirective() {
return this._typeInfo.getDirective();
}
getArgument() {
return this._typeInfo.getArgument();
}
getEnumValue() {
return this._typeInfo.getEnumValue();
}
}

View File

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

View File

@@ -0,0 +1,21 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { TraceAPI } from './api/trace';
/** Entrypoint for trace API */
export const trace = TraceAPI.getInstance();
//# sourceMappingURL=trace-api.js.map

View File

@@ -0,0 +1,57 @@
{
"name": "@react-email/column",
"version": "0.0.13",
"description": "Display a column that separates content areas vertically in your email",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/resend/react-email.git",
"directory": "packages/column"
},
"keywords": [
"react",
"email"
],
"engines": {
"node": ">=18.0.0"
},
"peerDependencies": {
"react": "^18.0 || ^19.0 || ^19.0.0-rc"
},
"devDependencies": {
"typescript": "5.1.6",
"@react-email/render": "1.0.3",
"tsconfig": "0.0.0",
"eslint-config-custom": "0.0.0"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
"clean": "rm -rf dist",
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
"lint": "eslint .",
"test:watch": "vitest",
"test": "vitest run"
}
}

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 {};
//# sourceMappingURL=span_context.js.map

View File

@@ -0,0 +1,21 @@
import type { PayloadRequest } from '../../index.js';
import type { RunJobsSilent } from '../localAPI.js';
import type { UpdateJobFunction } from '../operations/runJobs/runJob/getUpdateJobFunction.js';
import type { TaskError } from './index.js';
export declare function handleTaskError({ error, req, silent, updateJob, }: {
error: TaskError;
req: PayloadRequest;
/**
* If set to true, the job system will not log any output to the console (for both info and error logs).
* Can be an option for more granular control over logging.
*
* This will not automatically affect user-configured logs (e.g. if you call `console.log` or `payload.logger.info` in your job code).
*
* @default false
*/
silent?: RunJobsSilent;
updateJob: UpdateJobFunction;
}): Promise<{
hasFinalError: boolean;
}>;
//# sourceMappingURL=handleTaskError.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","DrawerCloseButton","baseClass","DrawerHeader","onClose","title","_jsxs","className","_jsx","onClick"],"sources":["../../../../src/elements/BulkUpload/Header/index.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nimport { DrawerCloseButton } from '../DrawerCloseButton/index.js'\nimport './index.scss'\n\nconst baseClass = 'bulk-upload--drawer-header'\n\ntype Props = {\n readonly onClose: () => void\n readonly title: string\n}\nexport function DrawerHeader({ onClose, title }: Props) {\n return (\n <div className={baseClass}>\n <h2 title={title}>{title}</h2>\n <DrawerCloseButton onClick={onClose} />\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAEA,OAAOA,KAAA,MAAW;AAElB,SAASC,iBAAiB,QAAQ;AAClC,OAAO;AAEP,MAAMC,SAAA,GAAY;AAMlB,OAAO,SAASC,aAAa;EAAEC,OAAO;EAAEC;AAAK,CAAS;EACpD,oBACEC,KAAA,CAAC;IAAIC,SAAA,EAAWL,SAAA;4BACdM,IAAA,CAAC;MAAGH,KAAA,EAAOA,KAAA;gBAAQA;qBACnBG,IAAA,CAACP,iBAAA;MAAkBQ,OAAA,EAASL;;;AAGlC","ignoreList":[]}

View File

@@ -0,0 +1,757 @@
'use strict';
var PlainValue = require('./PlainValue-ec8e588e.js');
var resolveSeq = require('./resolveSeq-d03cb037.js');
var Schema = require('./Schema-88e323a7.js');
const defaultOptions = {
anchorPrefix: 'a',
customTags: null,
indent: 2,
indentSeq: true,
keepCstNodes: false,
keepNodeTypes: true,
keepBlobsInJSON: true,
mapAsMap: false,
maxAliasCount: 100,
prettyErrors: false,
// TODO Set true in v2
simpleKeys: false,
version: '1.2'
};
const scalarOptions = {
get binary() {
return resolveSeq.binaryOptions;
},
set binary(opt) {
Object.assign(resolveSeq.binaryOptions, opt);
},
get bool() {
return resolveSeq.boolOptions;
},
set bool(opt) {
Object.assign(resolveSeq.boolOptions, opt);
},
get int() {
return resolveSeq.intOptions;
},
set int(opt) {
Object.assign(resolveSeq.intOptions, opt);
},
get null() {
return resolveSeq.nullOptions;
},
set null(opt) {
Object.assign(resolveSeq.nullOptions, opt);
},
get str() {
return resolveSeq.strOptions;
},
set str(opt) {
Object.assign(resolveSeq.strOptions, opt);
}
};
const documentOptions = {
'1.0': {
schema: 'yaml-1.1',
merge: true,
tagPrefixes: [{
handle: '!',
prefix: PlainValue.defaultTagPrefix
}, {
handle: '!!',
prefix: 'tag:private.yaml.org,2002:'
}]
},
1.1: {
schema: 'yaml-1.1',
merge: true,
tagPrefixes: [{
handle: '!',
prefix: '!'
}, {
handle: '!!',
prefix: PlainValue.defaultTagPrefix
}]
},
1.2: {
schema: 'core',
merge: false,
tagPrefixes: [{
handle: '!',
prefix: '!'
}, {
handle: '!!',
prefix: PlainValue.defaultTagPrefix
}]
}
};
function stringifyTag(doc, tag) {
if ((doc.version || doc.options.version) === '1.0') {
const priv = tag.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);
if (priv) return '!' + priv[1];
const vocab = tag.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);
return vocab ? `!${vocab[1]}/${vocab[2]}` : `!${tag.replace(/^tag:/, '')}`;
}
let p = doc.tagPrefixes.find(p => tag.indexOf(p.prefix) === 0);
if (!p) {
const dtp = doc.getDefaults().tagPrefixes;
p = dtp && dtp.find(p => tag.indexOf(p.prefix) === 0);
}
if (!p) return tag[0] === '!' ? tag : `!<${tag}>`;
const suffix = tag.substr(p.prefix.length).replace(/[!,[\]{}]/g, ch => ({
'!': '%21',
',': '%2C',
'[': '%5B',
']': '%5D',
'{': '%7B',
'}': '%7D'
})[ch]);
return p.handle + suffix;
}
function getTagObject(tags, item) {
if (item instanceof resolveSeq.Alias) return resolveSeq.Alias;
if (item.tag) {
const match = tags.filter(t => t.tag === item.tag);
if (match.length > 0) return match.find(t => t.format === item.format) || match[0];
}
let tagObj, obj;
if (item instanceof resolveSeq.Scalar) {
obj = item.value; // TODO: deprecate/remove class check
const match = tags.filter(t => t.identify && t.identify(obj) || t.class && obj instanceof t.class);
tagObj = match.find(t => t.format === item.format) || match.find(t => !t.format);
} else {
obj = item;
tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
}
if (!tagObj) {
const name = obj && obj.constructor ? obj.constructor.name : typeof obj;
throw new Error(`Tag not resolved for ${name} value`);
}
return tagObj;
} // needs to be called before value stringifier to allow for circular anchor refs
function stringifyProps(node, tagObj, {
anchors,
doc
}) {
const props = [];
const anchor = doc.anchors.getName(node);
if (anchor) {
anchors[anchor] = node;
props.push(`&${anchor}`);
}
if (node.tag) {
props.push(stringifyTag(doc, node.tag));
} else if (!tagObj.default) {
props.push(stringifyTag(doc, tagObj.tag));
}
return props.join(' ');
}
function stringify(item, ctx, onComment, onChompKeep) {
const {
anchors,
schema
} = ctx.doc;
let tagObj;
if (!(item instanceof resolveSeq.Node)) {
const createCtx = {
aliasNodes: [],
onTagObj: o => tagObj = o,
prevObjects: new Map()
};
item = schema.createNode(item, true, null, createCtx);
for (const alias of createCtx.aliasNodes) {
alias.source = alias.source.node;
let name = anchors.getName(alias.source);
if (!name) {
name = anchors.newName();
anchors.map[name] = alias.source;
}
}
}
if (item instanceof resolveSeq.Pair) return item.toString(ctx, onComment, onChompKeep);
if (!tagObj) tagObj = getTagObject(schema.tags, item);
const props = stringifyProps(item, tagObj, ctx);
if (props.length > 0) ctx.indentAtStart = (ctx.indentAtStart || 0) + props.length + 1;
const str = typeof tagObj.stringify === 'function' ? tagObj.stringify(item, ctx, onComment, onChompKeep) : item instanceof resolveSeq.Scalar ? resolveSeq.stringifyString(item, ctx, onComment, onChompKeep) : item.toString(ctx, onComment, onChompKeep);
if (!props) return str;
return item instanceof resolveSeq.Scalar || str[0] === '{' || str[0] === '[' ? `${props} ${str}` : `${props}\n${ctx.indent}${str}`;
}
class Anchors {
static validAnchorNode(node) {
return node instanceof resolveSeq.Scalar || node instanceof resolveSeq.YAMLSeq || node instanceof resolveSeq.YAMLMap;
}
constructor(prefix) {
PlainValue._defineProperty(this, "map", Object.create(null));
this.prefix = prefix;
}
createAlias(node, name) {
this.setAnchor(node, name);
return new resolveSeq.Alias(node);
}
createMergePair(...sources) {
const merge = new resolveSeq.Merge();
merge.value.items = sources.map(s => {
if (s instanceof resolveSeq.Alias) {
if (s.source instanceof resolveSeq.YAMLMap) return s;
} else if (s instanceof resolveSeq.YAMLMap) {
return this.createAlias(s);
}
throw new Error('Merge sources must be Map nodes or their Aliases');
});
return merge;
}
getName(node) {
const {
map
} = this;
return Object.keys(map).find(a => map[a] === node);
}
getNames() {
return Object.keys(this.map);
}
getNode(name) {
return this.map[name];
}
newName(prefix) {
if (!prefix) prefix = this.prefix;
const names = Object.keys(this.map);
for (let i = 1; true; ++i) {
const name = `${prefix}${i}`;
if (!names.includes(name)) return name;
}
} // During parsing, map & aliases contain CST nodes
resolveNodes() {
const {
map,
_cstAliases
} = this;
Object.keys(map).forEach(a => {
map[a] = map[a].resolved;
});
_cstAliases.forEach(a => {
a.source = a.source.resolved;
});
delete this._cstAliases;
}
setAnchor(node, name) {
if (node != null && !Anchors.validAnchorNode(node)) {
throw new Error('Anchors may only be set for Scalar, Seq and Map nodes');
}
if (name && /[\x00-\x19\s,[\]{}]/.test(name)) {
throw new Error('Anchor names must not contain whitespace or control characters');
}
const {
map
} = this;
const prev = node && Object.keys(map).find(a => map[a] === node);
if (prev) {
if (!name) {
return prev;
} else if (prev !== name) {
delete map[prev];
map[name] = node;
}
} else {
if (!name) {
if (!node) return null;
name = this.newName();
}
map[name] = node;
}
return name;
}
}
const visit = (node, tags) => {
if (node && typeof node === 'object') {
const {
tag
} = node;
if (node instanceof resolveSeq.Collection) {
if (tag) tags[tag] = true;
node.items.forEach(n => visit(n, tags));
} else if (node instanceof resolveSeq.Pair) {
visit(node.key, tags);
visit(node.value, tags);
} else if (node instanceof resolveSeq.Scalar) {
if (tag) tags[tag] = true;
}
}
return tags;
};
const listTagNames = node => Object.keys(visit(node, {}));
function parseContents(doc, contents) {
const comments = {
before: [],
after: []
};
let body = undefined;
let spaceBefore = false;
for (const node of contents) {
if (node.valueRange) {
if (body !== undefined) {
const msg = 'Document contains trailing content not separated by a ... or --- line';
doc.errors.push(new PlainValue.YAMLSyntaxError(node, msg));
break;
}
const res = resolveSeq.resolveNode(doc, node);
if (spaceBefore) {
res.spaceBefore = true;
spaceBefore = false;
}
body = res;
} else if (node.comment !== null) {
const cc = body === undefined ? comments.before : comments.after;
cc.push(node.comment);
} else if (node.type === PlainValue.Type.BLANK_LINE) {
spaceBefore = true;
if (body === undefined && comments.before.length > 0 && !doc.commentBefore) {
// space-separated comments at start are parsed as document comments
doc.commentBefore = comments.before.join('\n');
comments.before = [];
}
}
}
doc.contents = body || null;
if (!body) {
doc.comment = comments.before.concat(comments.after).join('\n') || null;
} else {
const cb = comments.before.join('\n');
if (cb) {
const cbNode = body instanceof resolveSeq.Collection && body.items[0] ? body.items[0] : body;
cbNode.commentBefore = cbNode.commentBefore ? `${cb}\n${cbNode.commentBefore}` : cb;
}
doc.comment = comments.after.join('\n') || null;
}
}
function resolveTagDirective({
tagPrefixes
}, directive) {
const [handle, prefix] = directive.parameters;
if (!handle || !prefix) {
const msg = 'Insufficient parameters given for %TAG directive';
throw new PlainValue.YAMLSemanticError(directive, msg);
}
if (tagPrefixes.some(p => p.handle === handle)) {
const msg = 'The %TAG directive must only be given at most once per handle in the same document.';
throw new PlainValue.YAMLSemanticError(directive, msg);
}
return {
handle,
prefix
};
}
function resolveYamlDirective(doc, directive) {
let [version] = directive.parameters;
if (directive.name === 'YAML:1.0') version = '1.0';
if (!version) {
const msg = 'Insufficient parameters given for %YAML directive';
throw new PlainValue.YAMLSemanticError(directive, msg);
}
if (!documentOptions[version]) {
const v0 = doc.version || doc.options.version;
const msg = `Document will be parsed as YAML ${v0} rather than YAML ${version}`;
doc.warnings.push(new PlainValue.YAMLWarning(directive, msg));
}
return version;
}
function parseDirectives(doc, directives, prevDoc) {
const directiveComments = [];
let hasDirectives = false;
for (const directive of directives) {
const {
comment,
name
} = directive;
switch (name) {
case 'TAG':
try {
doc.tagPrefixes.push(resolveTagDirective(doc, directive));
} catch (error) {
doc.errors.push(error);
}
hasDirectives = true;
break;
case 'YAML':
case 'YAML:1.0':
if (doc.version) {
const msg = 'The %YAML directive must only be given at most once per document.';
doc.errors.push(new PlainValue.YAMLSemanticError(directive, msg));
}
try {
doc.version = resolveYamlDirective(doc, directive);
} catch (error) {
doc.errors.push(error);
}
hasDirectives = true;
break;
default:
if (name) {
const msg = `YAML only supports %TAG and %YAML directives, and not %${name}`;
doc.warnings.push(new PlainValue.YAMLWarning(directive, msg));
}
}
if (comment) directiveComments.push(comment);
}
if (prevDoc && !hasDirectives && '1.1' === (doc.version || prevDoc.version || doc.options.version)) {
const copyTagPrefix = ({
handle,
prefix
}) => ({
handle,
prefix
});
doc.tagPrefixes = prevDoc.tagPrefixes.map(copyTagPrefix);
doc.version = prevDoc.version;
}
doc.commentBefore = directiveComments.join('\n') || null;
}
function assertCollection(contents) {
if (contents instanceof resolveSeq.Collection) return true;
throw new Error('Expected a YAML collection as document contents');
}
class Document {
constructor(options) {
this.anchors = new Anchors(options.anchorPrefix);
this.commentBefore = null;
this.comment = null;
this.contents = null;
this.directivesEndMarker = null;
this.errors = [];
this.options = options;
this.schema = null;
this.tagPrefixes = [];
this.version = null;
this.warnings = [];
}
add(value) {
assertCollection(this.contents);
return this.contents.add(value);
}
addIn(path, value) {
assertCollection(this.contents);
this.contents.addIn(path, value);
}
delete(key) {
assertCollection(this.contents);
return this.contents.delete(key);
}
deleteIn(path) {
if (resolveSeq.isEmptyPath(path)) {
if (this.contents == null) return false;
this.contents = null;
return true;
}
assertCollection(this.contents);
return this.contents.deleteIn(path);
}
getDefaults() {
return Document.defaults[this.version] || Document.defaults[this.options.version] || {};
}
get(key, keepScalar) {
return this.contents instanceof resolveSeq.Collection ? this.contents.get(key, keepScalar) : undefined;
}
getIn(path, keepScalar) {
if (resolveSeq.isEmptyPath(path)) return !keepScalar && this.contents instanceof resolveSeq.Scalar ? this.contents.value : this.contents;
return this.contents instanceof resolveSeq.Collection ? this.contents.getIn(path, keepScalar) : undefined;
}
has(key) {
return this.contents instanceof resolveSeq.Collection ? this.contents.has(key) : false;
}
hasIn(path) {
if (resolveSeq.isEmptyPath(path)) return this.contents !== undefined;
return this.contents instanceof resolveSeq.Collection ? this.contents.hasIn(path) : false;
}
set(key, value) {
assertCollection(this.contents);
this.contents.set(key, value);
}
setIn(path, value) {
if (resolveSeq.isEmptyPath(path)) this.contents = value;else {
assertCollection(this.contents);
this.contents.setIn(path, value);
}
}
setSchema(id, customTags) {
if (!id && !customTags && this.schema) return;
if (typeof id === 'number') id = id.toFixed(1);
if (id === '1.0' || id === '1.1' || id === '1.2') {
if (this.version) this.version = id;else this.options.version = id;
delete this.options.schema;
} else if (id && typeof id === 'string') {
this.options.schema = id;
}
if (Array.isArray(customTags)) this.options.customTags = customTags;
const opt = Object.assign({}, this.getDefaults(), this.options);
this.schema = new Schema.Schema(opt);
}
parse(node, prevDoc) {
if (this.options.keepCstNodes) this.cstNode = node;
if (this.options.keepNodeTypes) this.type = 'DOCUMENT';
const {
directives = [],
contents = [],
directivesEndMarker,
error,
valueRange
} = node;
if (error) {
if (!error.source) error.source = this;
this.errors.push(error);
}
parseDirectives(this, directives, prevDoc);
if (directivesEndMarker) this.directivesEndMarker = true;
this.range = valueRange ? [valueRange.start, valueRange.end] : null;
this.setSchema();
this.anchors._cstAliases = [];
parseContents(this, contents);
this.anchors.resolveNodes();
if (this.options.prettyErrors) {
for (const error of this.errors) if (error instanceof PlainValue.YAMLError) error.makePretty();
for (const warn of this.warnings) if (warn instanceof PlainValue.YAMLError) warn.makePretty();
}
return this;
}
listNonDefaultTags() {
return listTagNames(this.contents).filter(t => t.indexOf(Schema.Schema.defaultPrefix) !== 0);
}
setTagPrefix(handle, prefix) {
if (handle[0] !== '!' || handle[handle.length - 1] !== '!') throw new Error('Handle must start and end with !');
if (prefix) {
const prev = this.tagPrefixes.find(p => p.handle === handle);
if (prev) prev.prefix = prefix;else this.tagPrefixes.push({
handle,
prefix
});
} else {
this.tagPrefixes = this.tagPrefixes.filter(p => p.handle !== handle);
}
}
toJSON(arg, onAnchor) {
const {
keepBlobsInJSON,
mapAsMap,
maxAliasCount
} = this.options;
const keep = keepBlobsInJSON && (typeof arg !== 'string' || !(this.contents instanceof resolveSeq.Scalar));
const ctx = {
doc: this,
indentStep: ' ',
keep,
mapAsMap: keep && !!mapAsMap,
maxAliasCount,
stringify // Requiring directly in Pair would create circular dependencies
};
const anchorNames = Object.keys(this.anchors.map);
if (anchorNames.length > 0) ctx.anchors = new Map(anchorNames.map(name => [this.anchors.map[name], {
alias: [],
aliasCount: 0,
count: 1
}]));
const res = resolveSeq.toJSON(this.contents, arg, ctx);
if (typeof onAnchor === 'function' && ctx.anchors) for (const {
count,
res
} of ctx.anchors.values()) onAnchor(res, count);
return res;
}
toString() {
if (this.errors.length > 0) throw new Error('Document with errors cannot be stringified');
const indentSize = this.options.indent;
if (!Number.isInteger(indentSize) || indentSize <= 0) {
const s = JSON.stringify(indentSize);
throw new Error(`"indent" option must be a positive integer, not ${s}`);
}
this.setSchema();
const lines = [];
let hasDirectives = false;
if (this.version) {
let vd = '%YAML 1.2';
if (this.schema.name === 'yaml-1.1') {
if (this.version === '1.0') vd = '%YAML:1.0';else if (this.version === '1.1') vd = '%YAML 1.1';
}
lines.push(vd);
hasDirectives = true;
}
const tagNames = this.listNonDefaultTags();
this.tagPrefixes.forEach(({
handle,
prefix
}) => {
if (tagNames.some(t => t.indexOf(prefix) === 0)) {
lines.push(`%TAG ${handle} ${prefix}`);
hasDirectives = true;
}
});
if (hasDirectives || this.directivesEndMarker) lines.push('---');
if (this.commentBefore) {
if (hasDirectives || !this.directivesEndMarker) lines.unshift('');
lines.unshift(this.commentBefore.replace(/^/gm, '#'));
}
const ctx = {
anchors: Object.create(null),
doc: this,
indent: '',
indentStep: ' '.repeat(indentSize),
stringify // Requiring directly in nodes would create circular dependencies
};
let chompKeep = false;
let contentComment = null;
if (this.contents) {
if (this.contents instanceof resolveSeq.Node) {
if (this.contents.spaceBefore && (hasDirectives || this.directivesEndMarker)) lines.push('');
if (this.contents.commentBefore) lines.push(this.contents.commentBefore.replace(/^/gm, '#')); // top-level block scalars need to be indented if followed by a comment
ctx.forceBlockIndent = !!this.comment;
contentComment = this.contents.comment;
}
const onChompKeep = contentComment ? null : () => chompKeep = true;
const body = stringify(this.contents, ctx, () => contentComment = null, onChompKeep);
lines.push(resolveSeq.addComment(body, '', contentComment));
} else if (this.contents !== undefined) {
lines.push(stringify(this.contents, ctx));
}
if (this.comment) {
if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '') lines.push('');
lines.push(this.comment.replace(/^/gm, '#'));
}
return lines.join('\n') + '\n';
}
}
PlainValue._defineProperty(Document, "defaults", documentOptions);
exports.Document = Document;
exports.defaultOptions = defaultOptions;
exports.scalarOptions = scalarOptions;

View File

@@ -0,0 +1,16 @@
import React from 'react';
type ContextType = {
isCollapsed: boolean;
isVisible: boolean;
isWithinCollapsible: boolean;
toggle: () => void;
};
export declare const CollapsibleProvider: React.FC<{
children?: React.ReactNode;
isCollapsed?: boolean;
isWithinCollapsible?: boolean;
toggle: () => void;
}>;
export declare const useCollapsible: () => ContextType;
export {};
//# sourceMappingURL=provider.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_t","require","createFlowUnionType","createTSUnionType","createUnionTypeAnnotation","isFlowType","isTSType","createUnionType","types","every","v"],"sources":["../../../src/path/inference/util.ts"],"sourcesContent":["import {\n createFlowUnionType,\n createTSUnionType,\n createUnionTypeAnnotation,\n isFlowType,\n isTSType,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nexport function createUnionType(\n types: (t.FlowType | t.TSType)[],\n): t.FlowType | t.TSType | undefined {\n if (process.env.BABEL_8_BREAKING) {\n if (types.every(v => isFlowType(v))) {\n return createFlowUnionType(types);\n }\n if (types.every(v => isTSType(v))) {\n return createTSUnionType(types);\n }\n } else {\n if (types.every(v => isFlowType(v))) {\n if (createFlowUnionType) {\n return createFlowUnionType(types);\n }\n\n return createUnionTypeAnnotation(types);\n } else if (types.every(v => isTSType(v))) {\n if (createTSUnionType) {\n return createTSUnionType(types);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAMsB;EALpBC,mBAAmB;EACnBC,iBAAiB;EACjBC,yBAAyB;EACzBC,UAAU;EACVC;AAAQ,IAAAN,EAAA;AAIH,SAASO,eAAeA,CAC7BC,KAAgC,EACG;EASjC,IAAIA,KAAK,CAACC,KAAK,CAACC,CAAC,IAAIL,UAAU,CAACK,CAAC,CAAC,CAAC,EAAE;IACnC,IAAIR,mBAAmB,EAAE;MACvB,OAAOA,mBAAmB,CAACM,KAAK,CAAC;IACnC;IAEA,OAAOJ,yBAAyB,CAACI,KAAK,CAAC;EACzC,CAAC,MAAM,IAAIA,KAAK,CAACC,KAAK,CAACC,CAAC,IAAIJ,QAAQ,CAACI,CAAC,CAAC,CAAC,EAAE;IACxC,IAAIP,iBAAiB,EAAE;MACrB,OAAOA,iBAAiB,CAACK,KAAK,CAAC;IACjC;EACF;AAEJ","ignoreList":[]}

View File

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

View File

@@ -0,0 +1,31 @@
import { NestedPartial, UnpackList } from "../../../types/utils.js";
import { CollectionType } from "../../../types/schema.js";
import { ApplyQueryFields } from "../../../types/output.js";
import { Query } from "../../../types/query.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/create/items.d.ts
type CreateItemOutput<Schema, Collection extends keyof Schema, TQuery extends Query<Schema, Schema[Collection]>> = ApplyQueryFields<Schema, CollectionType<Schema, Collection>, TQuery['fields']>;
/**
* Create new items in the given collection.
*
* @param collection The collection of the item
* @param items The items to create
* @param query Optional return data query
*
* @returns Returns the item objects of the item that were created.
*/
declare const createItems: <Schema, Collection extends keyof Schema, const TQuery extends Query<Schema, Schema[Collection]>>(collection: Collection, items: NestedPartial<UnpackList<Schema[Collection]>>[], query?: TQuery) => RestCommand<CreateItemOutput<Schema, Collection, TQuery>[], Schema>;
/**
* Create a new item in the given collection.
*
* @param collection The collection of the item
* @param item The item to create
* @param query Optional return data query
*
* @returns Returns the item objects of the item that were created.
*/
declare const createItem: <Schema, Collection extends keyof Schema, const TQuery extends Query<Schema, Schema[Collection]>>(collection: Collection, item: NestedPartial<UnpackList<Schema[Collection]>>, query?: TQuery) => RestCommand<CreateItemOutput<Schema, Collection, TQuery>, Schema>;
//#endregion
export { CreateItemOutput, createItem, createItems };
//# sourceMappingURL=items.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"leaf.js","sources":["../../../src/icons/leaf.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Leaf\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMjBBNyA3IDAgMCAxIDkuOCA2LjFDMTUuNSA1IDE3IDQuNDggMTkgMmMxIDIgMiA0LjE4IDIgOCAwIDUuNS00Ljc4IDEwLTEwIDEwWiIgLz4KICA8cGF0aCBkPSJNMiAyMWMwLTMgMS44NS01LjM2IDUuMDgtNkM5LjUgMTQuNTIgMTIgMTMgMTMgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/leaf\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 Leaf = createLucideIcon('Leaf', [\n [\n 'path',\n {\n d: 'M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z',\n key: 'nnexq3',\n },\n ],\n ['path', { d: 'M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12', key: 'mt58a7' }],\n]);\n\nexport default Leaf;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CACpC,CAAA,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;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,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACnF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,4 @@
/**
* Returns the first argument it receives.
*/
export declare function identityFunc<T>(x: T): T;

View File

@@ -0,0 +1,28 @@
/**
* Get a list of possible event messages from a Sentry event.
*/
function getPossibleEventMessages(event) {
const possibleMessages = [];
if (event.message) {
possibleMessages.push(event.message);
}
try {
// @ts-expect-error Try catching to save bundle size
const lastException = event.exception.values[event.exception.values.length - 1];
if (lastException?.value) {
possibleMessages.push(lastException.value);
if (lastException.type) {
possibleMessages.push(`${lastException.type}: ${lastException.value}`);
}
}
} catch {
// ignore errors here
}
return possibleMessages;
}
export { getPossibleEventMessages };
//# sourceMappingURL=eventUtils.js.map

View File

@@ -0,0 +1,19 @@
import { Kind } from '../language/kinds.mjs';
/**
* Provided a collection of ASTs, presumably each from different files,
* concatenate the ASTs together into batched AST, useful for validating many
* GraphQL source files which together represent one conceptual application.
*/
export function concatAST(documents) {
const definitions = [];
for (const doc of documents) {
definitions.push(...doc.definitions);
}
return {
kind: Kind.DOCUMENT,
definitions,
};
}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"nextRoutingInstrumentation.js","sources":["../../../../src/client/routing/nextRoutingInstrumentation.ts"],"sourcesContent":["import type { Client } from '@sentry/core';\nimport { WINDOW } from '@sentry/react';\nimport { appRouterInstrumentNavigation, appRouterInstrumentPageLoad } from './appRouterRoutingInstrumentation';\nimport { pagesRouterInstrumentNavigation, pagesRouterInstrumentPageLoad } from './pagesRouterRoutingInstrumentation';\n\n/**\n * Instruments the Next.js Client Router for page loads.\n */\nexport function nextRouterInstrumentPageLoad(client: Client): void {\n const isAppRouter = !WINDOW.document.getElementById('__NEXT_DATA__');\n if (isAppRouter) {\n appRouterInstrumentPageLoad(client);\n } else {\n pagesRouterInstrumentPageLoad(client);\n }\n}\n\n/**\n * Instruments the Next.js Client Router for navigation.\n */\nexport function nextRouterInstrumentNavigation(client: Client): void {\n const isAppRouter = !WINDOW.document.getElementById('__NEXT_DATA__');\n if (isAppRouter) {\n appRouterInstrumentNavigation(client);\n } else {\n pagesRouterInstrumentNavigation(client);\n }\n}\n"],"names":["WINDOW","appRouterInstrumentPageLoad","pagesRouterInstrumentPageLoad","appRouterInstrumentNavigation","pagesRouterInstrumentNavigation"],"mappings":";;;;;;AAKA;AACA;AACA;AACO,SAAS,4BAA4B,CAAC,MAAM,EAAgB;AACnE,EAAE,MAAM,WAAA,GAAc,CAACA,YAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC;AACtE,EAAE,IAAI,WAAW,EAAE;AACnB,IAAIC,2DAA2B,CAAC,MAAM,CAAC;AACvC,EAAE,OAAO;AACT,IAAIC,+DAA6B,CAAC,MAAM,CAAC;AACzC,EAAE;AACF;;AAEA;AACA;AACA;AACO,SAAS,8BAA8B,CAAC,MAAM,EAAgB;AACrE,EAAE,MAAM,WAAA,GAAc,CAACF,YAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC;AACtE,EAAE,IAAI,WAAW,EAAE;AACnB,IAAIG,6DAA6B,CAAC,MAAM,CAAC;AACzC,EAAE,OAAO;AACT,IAAIC,iEAA+B,CAAC,MAAM,CAAC;AAC3C,EAAE;AACF;;;;;"}

View File

@@ -0,0 +1,12 @@
import { entityKind } from "../entity.cjs";
import { PgDatabase } from "../pg-core/db.cjs";
import { PgDialect } from "../pg-core/dialect.cjs";
import type { DrizzleConfig } from "../utils.cjs";
import { type PgRemoteQueryResultHKT } from "./session.cjs";
export declare class PgRemoteDatabase<TSchema extends Record<string, unknown> = Record<string, never>> extends PgDatabase<PgRemoteQueryResultHKT, TSchema> {
static readonly [entityKind]: string;
}
export type RemoteCallback = (sql: string, params: any[], method: 'all' | 'execute', typings?: any[]) => Promise<{
rows: any[];
}>;
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>>(callback: RemoteCallback, config?: DrizzleConfig<TSchema>, _dialect?: () => PgDialect): PgRemoteDatabase<TSchema>;

View File

@@ -0,0 +1,41 @@
'use strict';
const { PassThrough } = require('stream');
module.exports = function (/*streams...*/) {
var sources = []
var output = new PassThrough({objectMode: true})
output.setMaxListeners(0)
output.add = add
output.isEmpty = isEmpty
output.on('unpipe', remove)
Array.prototype.slice.call(arguments).forEach(add)
return output
function add (source) {
if (Array.isArray(source)) {
source.forEach(add)
return this
}
sources.push(source);
source.once('end', remove.bind(null, source))
source.once('error', output.emit.bind(output, 'error'))
source.pipe(output, {end: false})
return this
}
function isEmpty () {
return sources.length == 0;
}
function remove (source) {
sources = sources.filter(function (it) { return it !== source })
if (!sources.length && output.readable) { output.end() }
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/UnpublishMany/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAG5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,sBAAsB,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAYtD,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CACrC;IACE,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,kBAAkB,CA8CvB,CAAA"}

View File

@@ -0,0 +1,578 @@
/**
* Clusters of Node.js processes can be used to run multiple instances of Node.js
* that can distribute workloads among their application threads. When process isolation
* is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html)
* module instead, which allows running multiple application threads within a single Node.js instance.
*
* The cluster module allows easy creation of child processes that all share
* server ports.
*
* ```js
* import cluster from 'node:cluster';
* import http from 'node:http';
* import { availableParallelism } from 'node:os';
* import process from 'node:process';
*
* const numCPUs = availableParallelism();
*
* if (cluster.isPrimary) {
* console.log(`Primary ${process.pid} is running`);
*
* // Fork workers.
* for (let i = 0; i < numCPUs; i++) {
* cluster.fork();
* }
*
* cluster.on('exit', (worker, code, signal) => {
* console.log(`worker ${worker.process.pid} died`);
* });
* } else {
* // Workers can share any TCP connection
* // In this case it is an HTTP server
* http.createServer((req, res) => {
* res.writeHead(200);
* res.end('hello world\n');
* }).listen(8000);
*
* console.log(`Worker ${process.pid} started`);
* }
* ```
*
* Running Node.js will now share port 8000 between the workers:
*
* ```console
* $ node server.js
* Primary 3596 is running
* Worker 4324 started
* Worker 4520 started
* Worker 6056 started
* Worker 5644 started
* ```
*
* On Windows, it is not yet possible to set up a named pipe server in a worker.
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/cluster.js)
*/
declare module "cluster" {
import * as child from "node:child_process";
import EventEmitter = require("node:events");
import * as net from "node:net";
type SerializationType = "json" | "advanced";
export interface ClusterSettings {
/**
* List of string arguments passed to the Node.js executable.
* @default process.execArgv
*/
execArgv?: string[] | undefined;
/**
* File path to worker file.
* @default process.argv[1]
*/
exec?: string | undefined;
/**
* String arguments passed to worker.
* @default process.argv.slice(2)
*/
args?: readonly string[] | undefined;
/**
* Whether or not to send output to parent's stdio.
* @default false
*/
silent?: boolean | undefined;
/**
* Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must
* contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#child_processspawncommand-args-options)'s
* [`stdio`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#optionsstdio).
*/
stdio?: any[] | undefined;
/**
* Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).)
*/
uid?: number | undefined;
/**
* Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).)
*/
gid?: number | undefined;
/**
* Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number.
* By default each worker gets its own port, incremented from the primary's `process.debugPort`.
*/
inspectPort?: number | (() => number) | undefined;
/**
* Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`.
* See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#advanced-serialization) for more details.
* @default false
*/
serialization?: SerializationType | undefined;
/**
* Current working directory of the worker process.
* @default undefined (inherits from parent process)
*/
cwd?: string | undefined;
/**
* Hide the forked processes console window that would normally be created on Windows systems.
* @default false
*/
windowsHide?: boolean | undefined;
}
export interface Address {
address: string;
port: number;
/**
* The `addressType` is one of:
*
* * `4` (TCPv4)
* * `6` (TCPv6)
* * `-1` (Unix domain socket)
* * `'udp4'` or `'udp6'` (UDPv4 or UDPv6)
*/
addressType: 4 | 6 | -1 | "udp4" | "udp6";
}
/**
* A `Worker` object contains all public information and method about a worker.
* In the primary it can be obtained using `cluster.workers`. In a worker
* it can be obtained using `cluster.worker`.
* @since v0.7.0
*/
export class Worker extends EventEmitter {
/**
* Each new worker is given its own unique id, this id is stored in the `id`.
*
* While a worker is alive, this is the key that indexes it in `cluster.workers`.
* @since v0.8.0
*/
id: number;
/**
* All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object
* from this function is stored as `.process`. In a worker, the global `process` is stored.
*
* See: [Child Process module](https://nodejs.org/docs/latest-v22.x/api/child_process.html#child_processforkmodulepath-args-options).
*
* Workers will call `process.exit(0)` if the `'disconnect'` event occurs
* on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
* accidental disconnection.
* @since v0.7.0
*/
process: child.ChildProcess;
/**
* Send a message to a worker or primary, optionally with a handle.
*
* In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v22.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback).
*
* In a worker, this sends a message to the primary. It is identical to `process.send()`.
*
* This example will echo back all messages from the primary:
*
* ```js
* if (cluster.isPrimary) {
* const worker = cluster.fork();
* worker.send('hi there');
*
* } else if (cluster.isWorker) {
* process.on('message', (msg) => {
* process.send(msg);
* });
* }
* ```
* @since v0.7.0
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles.
*/
send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
send(
message: child.Serializable,
sendHandle: child.SendHandle,
callback?: (error: Error | null) => void,
): boolean;
send(
message: child.Serializable,
sendHandle: child.SendHandle,
options?: child.MessageOptions,
callback?: (error: Error | null) => void,
): boolean;
/**
* This function will kill the worker. In the primary worker, it does this by
* disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`.
*
* The `kill()` function kills the worker process without waiting for a graceful
* disconnect, it has the same behavior as `worker.process.kill()`.
*
* This method is aliased as `worker.destroy()` for backwards compatibility.
*
* In a worker, `process.kill()` exists, but it is not this function;
* it is [`kill()`](https://nodejs.org/docs/latest-v22.x/api/process.html#processkillpid-signal).
* @since v0.9.12
* @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
*/
kill(signal?: string): void;
destroy(signal?: string): void;
/**
* In a worker, this function will close all servers, wait for the `'close'` event
* on those servers, and then disconnect the IPC channel.
*
* In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself.
*
* Causes `.exitedAfterDisconnect` to be set.
*
* After a server is closed, it will no longer accept new connections,
* but connections may be accepted by any other listening worker. Existing
* connections will be allowed to close as usual. When no more connections exist,
* see `server.close()`, the IPC channel to the worker will close allowing it
* to die gracefully.
*
* The above applies _only_ to server connections, client connections are not
* automatically closed by workers, and disconnect does not wait for them to close
* before exiting.
*
* In a worker, `process.disconnect` exists, but it is not this function;
* it is `disconnect()`.
*
* Because long living server connections may block workers from disconnecting, it
* may be useful to send a message, so application specific actions may be taken to
* close them. It also may be useful to implement a timeout, killing a worker if
* the `'disconnect'` event has not been emitted after some time.
*
* ```js
* import net from 'node:net';
*
* if (cluster.isPrimary) {
* const worker = cluster.fork();
* let timeout;
*
* worker.on('listening', (address) => {
* worker.send('shutdown');
* worker.disconnect();
* timeout = setTimeout(() => {
* worker.kill();
* }, 2000);
* });
*
* worker.on('disconnect', () => {
* clearTimeout(timeout);
* });
*
* } else if (cluster.isWorker) {
* const server = net.createServer((socket) => {
* // Connections never end
* });
*
* server.listen(8000);
*
* process.on('message', (msg) => {
* if (msg === 'shutdown') {
* // Initiate graceful close of any connections to server
* }
* });
* }
* ```
* @since v0.7.7
* @return A reference to `worker`.
*/
disconnect(): this;
/**
* This function returns `true` if the worker is connected to its primary via its
* IPC channel, `false` otherwise. A worker is connected to its primary after it
* has been created. It is disconnected after the `'disconnect'` event is emitted.
* @since v0.11.14
*/
isConnected(): boolean;
/**
* This function returns `true` if the worker's process has terminated (either
* because of exiting or being signaled). Otherwise, it returns `false`.
*
* ```js
* import cluster from 'node:cluster';
* import http from 'node:http';
* import { availableParallelism } from 'node:os';
* import process from 'node:process';
*
* const numCPUs = availableParallelism();
*
* if (cluster.isPrimary) {
* console.log(`Primary ${process.pid} is running`);
*
* // Fork workers.
* for (let i = 0; i < numCPUs; i++) {
* cluster.fork();
* }
*
* cluster.on('fork', (worker) => {
* console.log('worker is dead:', worker.isDead());
* });
*
* cluster.on('exit', (worker, code, signal) => {
* console.log('worker is dead:', worker.isDead());
* });
* } else {
* // Workers can share any TCP connection. In this case, it is an HTTP server.
* http.createServer((req, res) => {
* res.writeHead(200);
* res.end(`Current process\n ${process.pid}`);
* process.kill(process.pid);
* }).listen(8000);
* }
* ```
* @since v0.11.14
*/
isDead(): boolean;
/**
* This property is `true` if the worker exited due to `.disconnect()`.
* If the worker exited any other way, it is `false`. If the
* worker has not exited, it is `undefined`.
*
* The boolean `worker.exitedAfterDisconnect` allows distinguishing between
* voluntary and accidental exit, the primary may choose not to respawn a worker
* based on this value.
*
* ```js
* cluster.on('exit', (worker, code, signal) => {
* if (worker.exitedAfterDisconnect === true) {
* console.log('Oh, it was just voluntary no need to worry');
* }
* });
*
* // kill worker
* worker.kill();
* ```
* @since v6.0.0
*/
exitedAfterDisconnect: boolean;
/**
* events.EventEmitter
* 1. disconnect
* 2. error
* 3. exit
* 4. listening
* 5. message
* 6. online
*/
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "disconnect", listener: () => void): this;
addListener(event: "error", listener: (error: Error) => void): this;
addListener(event: "exit", listener: (code: number, signal: string) => void): this;
addListener(event: "listening", listener: (address: Address) => void): this;
addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: "online", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: "disconnect"): boolean;
emit(event: "error", error: Error): boolean;
emit(event: "exit", code: number, signal: string): boolean;
emit(event: "listening", address: Address): boolean;
emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
emit(event: "online"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: "disconnect", listener: () => void): this;
on(event: "error", listener: (error: Error) => void): this;
on(event: "exit", listener: (code: number, signal: string) => void): this;
on(event: "listening", listener: (address: Address) => void): this;
on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: "online", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: "disconnect", listener: () => void): this;
once(event: "error", listener: (error: Error) => void): this;
once(event: "exit", listener: (code: number, signal: string) => void): this;
once(event: "listening", listener: (address: Address) => void): this;
once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: "online", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: "disconnect", listener: () => void): this;
prependListener(event: "error", listener: (error: Error) => void): this;
prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
prependListener(event: "listening", listener: (address: Address) => void): this;
prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependListener(event: "online", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "disconnect", listener: () => void): this;
prependOnceListener(event: "error", listener: (error: Error) => void): this;
prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
prependOnceListener(event: "listening", listener: (address: Address) => void): this;
prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
prependOnceListener(event: "online", listener: () => void): this;
}
export interface Cluster extends EventEmitter {
disconnect(callback?: () => void): void;
/**
* Spawn a new worker process.
*
* This can only be called from the primary process.
* @param env Key/value pairs to add to worker process environment.
* @since v0.6.0
*/
fork(env?: any): Worker;
/** @deprecated since v16.0.0 - use isPrimary. */
readonly isMaster: boolean;
/**
* True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID`
* is undefined, then `isPrimary` is `true`.
* @since v16.0.0
*/
readonly isPrimary: boolean;
/**
* True if the process is not a primary (it is the negation of `cluster.isPrimary`).
* @since v0.6.0
*/
readonly isWorker: boolean;
/**
* The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a
* global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clustersetupprimarysettings)
* is called, whichever comes first.
*
* `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute
* IOCP handles without incurring a large performance hit.
*
* `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`.
* @since v0.11.2
*/
schedulingPolicy: number;
/**
* After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clustersetupprimarysettings)
* (or [`.fork()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clusterforkenv)) this settings object will contain
* the settings, including the default values.
*
* This object is not intended to be changed or set manually.
* @since v0.7.1
*/
readonly settings: ClusterSettings;
/** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clustersetupprimarysettings) instead. */
setupMaster(settings?: ClusterSettings): void;
/**
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`.
*
* Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clusterforkenv)
* and have no effect on workers that are already running.
*
* The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to
* [`.fork()`](https://nodejs.org/docs/latest-v22.x/api/cluster.html#clusterforkenv).
*
* The defaults above apply to the first call only; the defaults for later calls are the current values at the time of
* `cluster.setupPrimary()` is called.
*
* ```js
* import cluster from 'node:cluster';
*
* cluster.setupPrimary({
* exec: 'worker.js',
* args: ['--use', 'https'],
* silent: true,
* });
* cluster.fork(); // https worker
* cluster.setupPrimary({
* exec: 'worker.js',
* args: ['--use', 'http'],
* });
* cluster.fork(); // http worker
* ```
*
* This can only be called from the primary process.
* @since v16.0.0
*/
setupPrimary(settings?: ClusterSettings): void;
/**
* A reference to the current worker object. Not available in the primary process.
*
* ```js
* import cluster from 'node:cluster';
*
* if (cluster.isPrimary) {
* console.log('I am primary');
* cluster.fork();
* cluster.fork();
* } else if (cluster.isWorker) {
* console.log(`I am worker #${cluster.worker.id}`);
* }
* ```
* @since v0.7.0
*/
readonly worker?: Worker;
/**
* A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
*
* A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it
* is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted.
*
* ```js
* import cluster from 'node:cluster';
*
* for (const worker of Object.values(cluster.workers)) {
* worker.send('big announcement to all workers');
* }
* ```
* @since v0.7.0
*/
readonly workers?: NodeJS.Dict<Worker>;
readonly SCHED_NONE: number;
readonly SCHED_RR: number;
/**
* events.EventEmitter
* 1. disconnect
* 2. exit
* 3. fork
* 4. listening
* 5. message
* 6. online
* 7. setup
*/
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "disconnect", listener: (worker: Worker) => void): this;
addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
addListener(event: "fork", listener: (worker: Worker) => void): this;
addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
addListener(
event: "message",
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
): this; // the handle is a net.Socket or net.Server object, or undefined.
addListener(event: "online", listener: (worker: Worker) => void): this;
addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: "disconnect", worker: Worker): boolean;
emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
emit(event: "fork", worker: Worker): boolean;
emit(event: "listening", worker: Worker, address: Address): boolean;
emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
emit(event: "online", worker: Worker): boolean;
emit(event: "setup", settings: ClusterSettings): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: "disconnect", listener: (worker: Worker) => void): this;
on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
on(event: "fork", listener: (worker: Worker) => void): this;
on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
on(event: "online", listener: (worker: Worker) => void): this;
on(event: "setup", listener: (settings: ClusterSettings) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: "disconnect", listener: (worker: Worker) => void): this;
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
once(event: "fork", listener: (worker: Worker) => void): this;
once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
once(event: "online", listener: (worker: Worker) => void): this;
once(event: "setup", listener: (settings: ClusterSettings) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
prependListener(event: "fork", listener: (worker: Worker) => void): this;
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
prependListener(
event: "message",
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
): this;
prependListener(event: "online", listener: (worker: Worker) => void): this;
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
// the handle is a net.Socket or net.Server object, or undefined.
prependOnceListener(
event: "message",
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
): this;
prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
}
const cluster: Cluster;
export default cluster;
}
declare module "node:cluster" {
export * from "cluster";
export { default as default } from "cluster";
}

View File

@@ -0,0 +1,318 @@
import type { INSTRUMENTED_METHODS } from './constants';
/**
* Attribute values may be any non-nullish primitive value except an object.
*
* null or undefined attribute values are invalid and will result in undefined behavior.
*/
export type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
export interface OpenAiOptions {
/**
* Enable or disable input recording.
*/
recordInputs?: boolean;
/**
* Enable or disable output recording.
*/
recordOutputs?: boolean;
}
export interface OpenAiClient {
responses?: {
create: (...args: unknown[]) => Promise<unknown>;
};
chat?: {
completions?: {
create: (...args: unknown[]) => Promise<unknown>;
};
};
}
/**
* @see https://platform.openai.com/docs/api-reference/chat/object
*/
export interface OpenAiChatCompletionObject {
id: string;
object: 'chat.completion';
created: number;
model: string;
choices: Array<{
index: number;
message: {
role: 'assistant' | 'user' | 'system' | string;
content: string | null;
refusal?: string | null;
annotations?: Array<unknown>;
tool_calls?: Array<unknown>;
};
logprobs?: unknown | null;
finish_reason: string | null;
}>;
usage: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
prompt_tokens_details?: {
cached_tokens?: number;
audio_tokens?: number;
};
completion_tokens_details?: {
reasoning_tokens?: number;
audio_tokens?: number;
accepted_prediction_tokens?: number;
rejected_prediction_tokens?: number;
};
};
service_tier?: string;
system_fingerprint?: string;
}
/**
* @see https://platform.openai.com/docs/api-reference/responses/object
*/
export interface OpenAIResponseObject {
id: string;
object: 'response';
created_at: number;
status: 'in_progress' | 'completed' | 'failed' | 'cancelled';
error: string | null;
incomplete_details: unknown | null;
instructions: unknown | null;
max_output_tokens: number | null;
model: string;
output: Array<{
type: 'message';
id: string;
status: 'completed' | string;
role: 'assistant' | string;
content: Array<{
type: 'output_text';
text: string;
annotations: Array<unknown>;
}>;
}>;
output_text: string;
parallel_tool_calls: boolean;
previous_response_id: string | null;
reasoning: {
effort: string | null;
summary: string | null;
};
store: boolean;
temperature: number;
text: {
format: {
type: 'text' | string;
};
};
tool_choice: 'auto' | string;
tools: Array<unknown>;
top_p: number;
truncation: 'disabled' | string;
usage: {
input_tokens: number;
input_tokens_details?: {
cached_tokens?: number;
};
output_tokens: number;
output_tokens_details?: {
reasoning_tokens?: number;
};
total_tokens: number;
};
user: string | null;
metadata: Record<string, unknown>;
}
/**
* @see https://platform.openai.com/docs/api-reference/embeddings/object
*/
export interface OpenAIEmbeddingsObject {
object: 'embedding';
embedding: number[];
index: number;
}
/**
* @see https://platform.openai.com/docs/api-reference/embeddings/create
*/
export interface OpenAICreateEmbeddingsObject {
object: 'list';
data: OpenAIEmbeddingsObject[];
model: string;
usage: {
prompt_tokens: number;
total_tokens: number;
};
}
/**
* OpenAI Conversations API Conversation object
* @see https://platform.openai.com/docs/api-reference/conversations
*/
export interface OpenAIConversationObject {
id: string;
object: 'conversation';
created_at: number;
metadata?: Record<string, unknown>;
}
export type OpenAiResponse = OpenAiChatCompletionObject | OpenAIResponseObject | OpenAICreateEmbeddingsObject | OpenAIConversationObject;
/**
* Streaming event types for the Responses API
* @see https://platform.openai.com/docs/api-reference/responses-streaming
* @see https://platform.openai.com/docs/guides/streaming-responses#read-the-responses for common events
*/
export type ResponseStreamingEvent = ResponseCreatedEvent | ResponseInProgressEvent | ResponseFailedEvent | ResponseCompletedEvent | ResponseIncompleteEvent | ResponseQueuedEvent | ResponseOutputTextDeltaEvent | ResponseOutputItemAddedEvent | ResponseFunctionCallArgumentsDeltaEvent | ResponseFunctionCallArgumentsDoneEvent | ResponseOutputItemDoneEvent;
interface ResponseCreatedEvent {
type: 'response.created';
response: OpenAIResponseObject;
sequence_number: number;
}
interface ResponseInProgressEvent {
type: 'response.in_progress';
response: OpenAIResponseObject;
sequence_number: number;
}
interface ResponseOutputTextDeltaEvent {
content_index: number;
delta: string;
item_id: string;
logprobs: object;
output_index: number;
sequence_number: number;
type: 'response.output_text.delta';
}
interface ResponseFailedEvent {
type: 'response.failed';
response: OpenAIResponseObject;
sequence_number: number;
}
interface ResponseIncompleteEvent {
type: 'response.incomplete';
response: OpenAIResponseObject;
sequence_number: number;
}
interface ResponseCompletedEvent {
type: 'response.completed';
response: OpenAIResponseObject;
sequence_number: number;
}
interface ResponseQueuedEvent {
type: 'response.queued';
response: OpenAIResponseObject;
sequence_number: number;
}
/**
* @see https://platform.openai.com/docs/api-reference/realtime-server-events/response/output_item/added
*/
interface ResponseOutputItemAddedEvent {
type: 'response.output_item.added';
output_index: number;
item: unknown;
event_id: string;
response_id: string;
}
/**
* @see https://platform.openai.com/docs/api-reference/realtime-server-events/response/function_call_arguments/delta
*/
interface ResponseFunctionCallArgumentsDeltaEvent {
type: 'response.function_call_arguments.delta';
item_id: string;
output_index: number;
delta: string;
call_id: string;
event_id: string;
response_id: string;
}
/**
* @see https://platform.openai.com/docs/api-reference/realtime-server-events/response/function_call_arguments/done
*/
interface ResponseFunctionCallArgumentsDoneEvent {
type: 'response.function_call_arguments.done';
response_id: string;
item_id: string;
output_index: number;
arguments: string;
call_id: string;
event_id: string;
}
/**
* @see https://platform.openai.com/docs/api-reference/realtime-server-events/response/output_item/done
*/
interface ResponseOutputItemDoneEvent {
type: 'response.output_item.done';
response_id: string;
output_index: number;
item: unknown;
event_id: string;
}
/**
* Tool call object for Chat Completion streaming
*/
export interface ChatCompletionToolCall {
index?: number;
id: string;
type?: string;
function?: {
name: string;
arguments?: string;
};
}
/**
* Function call object for Responses API
*/
export interface ResponseFunctionCall {
type: string;
id: string;
call_id: string;
name: string;
arguments: string;
}
/**
* Chat Completion streaming chunk type
* @see https://platform.openai.com/docs/api-reference/chat-streaming/streaming
*/
export interface ChatCompletionChunk {
id: string;
object: 'chat.completion.chunk';
created: number;
model: string;
system_fingerprint: string;
service_tier?: string;
choices: Array<{
index: number;
delta: {
content: string | null;
role: string;
function_call?: object;
refusal?: string | null;
tool_calls?: Array<ChatCompletionToolCall>;
};
logprobs?: unknown | null;
finish_reason?: string | null;
}>;
usage?: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
completion_tokens_details: {
accepted_prediction_tokens: number;
audio_tokens: number;
reasoning_tokens: number;
rejected_prediction_tokens: number;
};
prompt_tokens_details: {
audio_tokens: number;
cached_tokens: number;
};
};
}
/**
* Represents a stream of events from OpenAI APIs
*/
export interface OpenAIStream<T> extends AsyncIterable<T> {
[Symbol.asyncIterator](): AsyncIterator<T>;
}
/**
* OpenAI Integration interface for type safety
*/
export interface OpenAiIntegration {
name: string;
options: OpenAiOptions;
}
export type InstrumentedMethod = (typeof INSTRUMENTED_METHODS)[number];
export {};
//# sourceMappingURL=types.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/singlestore/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gCAAc,wBAAd;AACA,gCAAc,yBADd;","names":[]}

View File

@@ -0,0 +1,45 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debugLogger = require('../utils/debug-logger.js');
const object = require('../utils/object.js');
const worldwide = require('../utils/worldwide.js');
const handlers = require('./handlers.js');
/**
* Add an instrumentation handler for when a console.xxx method is called.
*
* Use at your own risk, this might break without changelog notice, only used internally.
* @hidden
*/
function addConsoleInstrumentationHandler(handler) {
const type = 'console';
handlers.addHandler(type, handler);
handlers.maybeInstrument(type, instrumentConsole);
}
function instrumentConsole() {
if (!('console' in worldwide.GLOBAL_OBJ)) {
return;
}
debugLogger.CONSOLE_LEVELS.forEach(function (level) {
if (!(level in worldwide.GLOBAL_OBJ.console)) {
return;
}
object.fill(worldwide.GLOBAL_OBJ.console, level, function (originalConsoleMethod) {
debugLogger.originalConsoleMethods[level] = originalConsoleMethod;
return function (...args) {
const handlerData = { args, level };
handlers.triggerHandlers('console', handlerData);
const log = debugLogger.originalConsoleMethods[level];
log?.apply(worldwide.GLOBAL_OBJ.console, args);
};
});
});
}
exports.addConsoleInstrumentationHandler = addConsoleInstrumentationHandler;
//# sourceMappingURL=console.js.map

View File

@@ -0,0 +1,57 @@
"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 entity_exports = {};
__export(entity_exports, {
entityKind: () => entityKind,
hasOwnEntityKind: () => hasOwnEntityKind,
is: () => is
});
module.exports = __toCommonJS(entity_exports);
const entityKind = Symbol.for("drizzle:entityKind");
const hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
function is(value, type) {
if (!value || typeof value !== "object") {
return false;
}
if (value instanceof type) {
return true;
}
if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
throw new Error(
`Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`
);
}
let cls = Object.getPrototypeOf(value).constructor;
if (cls) {
while (cls) {
if (entityKind in cls && cls[entityKind] === type[entityKind]) {
return true;
}
cls = Object.getPrototypeOf(cls);
}
}
return false;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
entityKind,
hasOwnEntityKind,
is
});
//# sourceMappingURL=entity.cjs.map

View File

@@ -0,0 +1,8 @@
import type { ReactNode } from 'react';
export type Props = {
readonly children: ReactNode;
readonly className?: string;
readonly rowId?: number | string;
};
export declare const OrderableRowDragPreview: ({ children, className, rowId }: Props) => import("react").JSX.Element;
//# sourceMappingURL=OrderableRowDragPreview.d.ts.map

View File

@@ -0,0 +1,6 @@
export declare enum ExpressLayerType {
ROUTER = "router",
MIDDLEWARE = "middleware",
REQUEST_HANDLER = "request_handler"
}
//# sourceMappingURL=ExpressLayerType.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"parseSampleRate.js","sources":["../../../src/utils/parseSampleRate.ts"],"sourcesContent":["/**\n * Parse a sample rate from a given value.\n * This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1).\n * If a string is passed, we try to convert it to a number.\n *\n * Any invalid sample rate will return `undefined`.\n */\nexport function parseSampleRate(sampleRate: unknown): number | undefined {\n if (typeof sampleRate === 'boolean') {\n return Number(sampleRate);\n }\n\n const rate = typeof sampleRate === 'string' ? parseFloat(sampleRate) : sampleRate;\n if (typeof rate !== 'number' || isNaN(rate) || rate < 0 || rate > 1) {\n return undefined;\n }\n\n return rate;\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,UAAU,EAA+B;AACzE,EAAE,IAAI,OAAO,UAAA,KAAe,SAAS,EAAE;AACvC,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC;AAC7B,EAAE;;AAEF,EAAE,MAAM,IAAA,GAAO,OAAO,UAAA,KAAe,QAAA,GAAW,UAAU,CAAC,UAAU,CAAA,GAAI,UAAU;AACnF,EAAE,IAAI,OAAO,SAAS,QAAA,IAAY,KAAK,CAAC,IAAI,CAAA,IAAK,OAAO,CAAA,IAAK,IAAA,GAAO,CAAC,EAAE;AACvE,IAAI,OAAO,SAAS;AACpB,EAAE;;AAEF,EAAE,OAAO,IAAI;AACb;;;;"}

View File

@@ -0,0 +1,2 @@
export { instrumentAnthropicAiClient } from '@sentry/core';
//# sourceMappingURL=index.instrumentanthropicaiclient.d.ts.map

View File

@@ -0,0 +1,21 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = hyphenateStyleName;
var _hyphenate = _interopRequireDefault(require("./hyphenate"));
/**
* Copyright 2013-2014, Facebook, Inc.
* All rights reserved.
* https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js
*/
var msPattern = /^ms-/;
function hyphenateStyleName(string) {
return (0, _hyphenate.default)(string).replace(msPattern, '-ms-');
}
module.exports = exports["default"];

View File

@@ -0,0 +1,5 @@
export declare function getStringFromEnv(_: string): string | undefined;
export declare function getBooleanFromEnv(_: string): boolean | undefined;
export declare function getNumberFromEnv(_: string): number | undefined;
export declare function getStringListFromEnv(_: string): string[] | undefined;
//# sourceMappingURL=environment.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"users.cjs","names":[],"sources":["../../../../src/rest/commands/update/users.ts"],"sourcesContent":["import type { DirectusUser } from '../../../schema/user.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type UpdateUserOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusUser<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Update multiple existing users.\n *\n * @param keys The primary key of the users\n * @param item The user data to update\n * @param query Optional return data query\n *\n * @returns Returns the user objects for the updated users.\n * @throws Will throw if keys is empty\n */\nexport const updateUsers =\n\t<Schema, const TQuery extends Query<Schema, DirectusUser<Schema>>>(\n\t\tkeys: DirectusUser<Schema>['id'][],\n\t\titem: NestedPartial<DirectusUser<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateUserOutput<Schema, TQuery>[], Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/users`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify({ keys, data: item }),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n\n/**\n * Update multiple users as batch.\n *\n * @param items The user data to update\n * @param query Optional return data query\n *\n * @returns Returns the user objects for the updated users.\n */\nexport const updateUsersBatch =\n\t<Schema, const TQuery extends Query<Schema, DirectusUser<Schema>>>(\n\t\titems: NestedPartial<DirectusUser<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateUserOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/users`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'PATCH',\n\t});\n\n/**\n * Update an existing user.\n *\n * @param key The primary key of the user\n * @param item The user data to update\n * @param query Optional return data query\n *\n * @returns Returns the user object for the updated user.\n * @throws Will throw if key is empty\n */\nexport const updateUser =\n\t<Schema, const TQuery extends Query<Schema, DirectusUser<Schema>>>(\n\t\tkey: DirectusUser<Schema>['id'],\n\t\titem: NestedPartial<DirectusUser<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateUserOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(key, 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/users/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tbody: JSON.stringify(item),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n\n/**\n * Update the authenticated user.\n *\n * @param item The user data to update\n * @param query Optional return data query\n *\n * @returns Returns the updated user object for the authenticated user.\n */\nexport const updateMe =\n\t<Schema, const TQuery extends Query<Schema, DirectusUser<Schema>>>(\n\t\titem: NestedPartial<DirectusUser<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<UpdateUserOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/users/me`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'PATCH',\n\t});\n"],"mappings":"kDAqBa,GAEX,EACA,EACA,SAGA,EAAA,aAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,SACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,CAAE,OAAM,KAAM,EAAM,CAAC,CAC1C,OAAQ,QACR,EAWU,GAEX,EACA,SAEM,CACN,KAAM,SACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,QACR,EAYW,GAEX,EACA,EACA,SAGA,EAAA,aAAa,EAAK,sBAAsB,CAEjC,CACN,KAAM,UAAU,IAChB,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR,EAWU,GAEX,EACA,SAEM,CACN,KAAM,YACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/initTransaction.ts"],"sourcesContent":["import type { MarkRequired } from 'ts-essentials'\n\nimport type { PayloadRequest } from '../types/index.js'\n\n/**\n * Starts a new transaction using the db adapter with a random id and then assigns it to the req.transaction\n * @returns true if beginning a transaction and false when req already has a transaction to use\n */\nexport async function initTransaction(\n req: MarkRequired<Partial<PayloadRequest>, 'payload'>,\n): Promise<boolean> {\n const { payload, transactionID } = req\n if (transactionID instanceof Promise) {\n // wait for whoever else is already creating the transaction\n await transactionID\n return false\n }\n\n if (transactionID) {\n // we already have a transaction, we're not in charge of committing it\n return false\n }\n if (typeof payload.db.beginTransaction === 'function') {\n // create a new transaction\n req.transactionID = payload.db.beginTransaction().then((transactionID) => {\n if (transactionID) {\n req.transactionID = transactionID\n }\n\n return transactionID!\n })\n return !!(await req.transactionID)\n }\n return false\n}\n"],"names":["initTransaction","req","payload","transactionID","Promise","db","beginTransaction","then"],"mappings":"AAIA;;;CAGC,GACD,OAAO,eAAeA,gBACpBC,GAAqD;IAErD,MAAM,EAAEC,OAAO,EAAEC,aAAa,EAAE,GAAGF;IACnC,IAAIE,yBAAyBC,SAAS;QACpC,4DAA4D;QAC5D,MAAMD;QACN,OAAO;IACT;IAEA,IAAIA,eAAe;QACjB,sEAAsE;QACtE,OAAO;IACT;IACA,IAAI,OAAOD,QAAQG,EAAE,CAACC,gBAAgB,KAAK,YAAY;QACrD,2BAA2B;QAC3BL,IAAIE,aAAa,GAAGD,QAAQG,EAAE,CAACC,gBAAgB,GAAGC,IAAI,CAAC,CAACJ;YACtD,IAAIA,eAAe;gBACjBF,IAAIE,aAAa,GAAGA;YACtB;YAEA,OAAOA;QACT;QACA,OAAO,CAAC,CAAE,MAAMF,IAAIE,aAAa;IACnC;IACA,OAAO;AACT"}

View File

@@ -0,0 +1,7 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/optimize/MinChunkSizePlugin").MinChunkSizePluginOptions) => boolean;
export = check;

View File

@@ -0,0 +1,56 @@
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('moduleDirectory strings', function (t) {
t.plan(4);
var dir = path.join(__dirname, 'module_dir');
var xopts = {
basedir: dir,
moduleDirectory: 'xmodules'
};
resolve('aaa', xopts, function (err, res, pkg) {
t.ifError(err);
t.equal(res, path.join(dir, '/xmodules/aaa/index.js'));
});
var yopts = {
basedir: dir,
moduleDirectory: 'ymodules'
};
resolve('aaa', yopts, function (err, res, pkg) {
t.ifError(err);
t.equal(res, path.join(dir, '/ymodules/aaa/index.js'));
});
});
test('moduleDirectory array', function (t) {
t.plan(6);
var dir = path.join(__dirname, 'module_dir');
var aopts = {
basedir: dir,
moduleDirectory: ['xmodules', 'ymodules', 'zmodules']
};
resolve('aaa', aopts, function (err, res, pkg) {
t.ifError(err);
t.equal(res, path.join(dir, '/xmodules/aaa/index.js'));
});
var bopts = {
basedir: dir,
moduleDirectory: ['zmodules', 'ymodules', 'xmodules']
};
resolve('aaa', bopts, function (err, res, pkg) {
t.ifError(err);
t.equal(res, path.join(dir, '/ymodules/aaa/index.js'));
});
var copts = {
basedir: dir,
moduleDirectory: ['xmodules', 'ymodules', 'zmodules']
};
resolve('bbb', copts, function (err, res, pkg) {
t.ifError(err);
t.equal(res, path.join(dir, '/zmodules/bbb/main.js'));
});
});

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.01053,"48":0.00351,"51":0.00351,"52":0.04211,"60":0.00351,"78":0.00702,"85":0.00351,"93":0.00351,"111":0.00702,"115":0.20703,"118":0.00351,"121":0.00702,"125":0.00351,"127":0.00351,"128":0.00351,"132":0.02456,"133":0.00351,"134":0.00351,"136":0.00351,"137":0.00351,"139":0.00351,"140":0.01404,"141":0.00702,"142":0.01053,"143":0.01404,"144":0.00351,"145":0.52986,"146":0.86672,"147":0.00351,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 49 50 53 54 55 56 57 58 59 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 86 87 88 89 90 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 112 113 114 116 117 119 120 122 123 124 126 129 130 131 135 138 148 149 3.5 3.6"},D:{"38":0.00351,"49":0.00702,"53":0.00351,"55":0.00351,"56":0.00702,"66":0.00351,"68":0.00351,"69":0.04562,"70":0.01404,"72":0.00351,"73":0.00702,"75":0.00351,"79":0.18949,"83":0.03158,"86":0.00351,"87":0.08773,"89":0.00351,"91":0.00351,"93":0.00351,"94":0.01404,"95":0.01404,"98":0.00702,"99":0.00351,"101":0.00351,"102":0.01404,"103":0.04211,"104":0.03158,"105":0.03158,"106":0.03509,"107":0.03158,"108":0.04211,"109":1.65274,"110":0.0386,"111":0.04913,"112":1.85977,"113":0.00351,"114":0.01755,"116":0.08422,"117":0.03509,"118":0.00702,"119":0.01053,"120":0.05264,"121":0.00702,"122":0.05965,"123":0.01755,"124":0.04211,"125":0.21054,"126":0.57197,"127":0.01053,"128":0.05965,"129":0.00702,"130":0.01053,"131":0.16492,"132":0.0386,"133":0.16141,"134":0.05264,"135":0.04562,"136":0.02456,"137":0.04211,"138":0.1158,"139":0.29125,"140":0.17194,"141":0.20703,"142":6.68465,"143":11.32003,"144":0.00351,"145":0.00351,_:"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 39 40 41 42 43 44 45 46 47 48 50 51 52 54 57 58 59 60 61 62 63 64 65 67 71 74 76 77 78 80 81 84 85 88 90 92 96 97 100 115 146"},F:{"36":0.02456,"46":0.03158,"79":0.00351,"90":0.00351,"92":0.00351,"93":0.05264,"95":0.05614,"114":0.00702,"119":0.00351,"120":0.00351,"123":0.00351,"124":0.65969,"125":0.23159,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 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 80 81 82 83 84 85 86 87 88 89 91 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00351,"92":0.00351,"109":0.01053,"113":0.00351,"115":0.01053,"122":0.00351,"131":0.00702,"132":0.00351,"133":0.00702,"134":0.00702,"135":0.00351,"136":0.00351,"137":0.01053,"138":0.00351,"140":0.00351,"141":0.02105,"142":0.4667,"143":1.28429,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 114 116 117 118 119 120 121 123 124 125 126 127 128 129 130 139"},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 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.4 17.3 18.0","11.1":0.00702,"13.1":0.00351,"15.6":0.00702,"16.3":0.00702,"16.5":0.00351,"16.6":0.02456,"17.0":0.00351,"17.1":0.03158,"17.2":0.00351,"17.4":0.00351,"17.5":0.01053,"17.6":0.02456,"18.1":0.00351,"18.2":0.00702,"18.3":0.0772,"18.4":0.00702,"18.5-18.6":0.02105,"26.0":0.02807,"26.1":0.12632,"26.2":0.04211,"26.3":0.00351},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00418,"5.0-5.1":0,"6.0-6.1":0.00836,"7.0-7.1":0.00627,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01672,"10.0-10.2":0.00209,"10.3":0.02925,"11.0-11.2":0.35939,"11.3-11.4":0.01045,"12.0-12.1":0.00836,"12.2-12.5":0.09403,"13.0-13.1":0.00209,"13.2":0.01463,"13.3":0.00418,"13.4-13.7":0.01463,"14.0-14.4":0.02925,"14.5-14.8":0.03134,"15.0-15.1":0.03343,"15.2-15.3":0.02507,"15.4":0.02716,"15.5":0.02925,"15.6-15.8":0.45341,"16.0":0.05224,"16.1":0.10029,"16.2":0.05224,"16.3":0.09403,"16.4":0.02298,"16.5":0.0397,"16.6-16.7":0.58923,"17.0":0.03343,"17.1":0.05433,"17.2":0.0397,"17.3":0.06059,"17.4":0.10238,"17.5":0.20059,"17.6-17.7":0.46386,"18.0":0.10447,"18.1":0.2173,"18.2":0.11492,"18.3":0.37401,"18.4":0.19223,"18.5-18.7":13.80293,"26.0":0.26954,"26.1":2.24198,"26.2":0.42625,"26.3":0.01881},P:{"4":0.17332,"21":0.02039,"22":0.02039,"23":0.0102,"24":0.03059,"25":0.03059,"26":0.02039,"27":0.05098,"28":0.46897,"29":2.67109,_:"20 6.2-6.4 8.2 9.2 10.1 12.0 15.0 17.0 18.0 19.0","5.0-5.4":0.02039,"7.2-7.4":0.11215,"11.1-11.2":0.0102,"13.0":0.0102,"14.0":0.02039,"16.0":0.0102},I:{"0":0.01296,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},A:{"11":0.03158,_:"6 7 8 9 10 5.5"},K:{"0":0.16877,_:"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":0.00649},H:{"0":0},L:{"0":43.91501},R:{_:"0"},M:{"0":0.09737}};

View File

@@ -0,0 +1,660 @@
### Versions
## 4.7.0
- package: update @monaco-editor/loader to the latest (v1.5.0) version (this uses monaco-editor v0.52.2)
- package: inherit all changes from v4.7.0-rc.0
## 4.7.0-rc.0
- package: add support for react/react-dom v19 as a peer dependency
- playground: update playground's React version to 19
## 4.6.0
###### _Oct 6, 2023_
- Editor/DiffEditor: use `'use client'` on top of `Editor.tsx` and `DiffEditor.tsx`
- loader: update `@monaco-editor/loader` version (1.4.0)
- playground: use createRoot for bootstrapping
## 4.5.2
###### _Aug 23, 2023_
- DiffEditor: apply updated on `originalModelPath` and `modifiedModelPath` before `original` and `modified` props
## 4.5.1
###### _May 5, 2023_
- DiffEditor: track `originalModelPath` and `modifiedModelPath` changes and get or create a new model accordingly
- types: fix typo in comment
- package: replace `prepublish` with `prepublishOnly`
## 4.5.0
###### _Apr 7, 2023_
- Editor: implement `preventTriggerChangeEvent` flag
from `4.5.0-beta.0`
- DiffEditor: add preventCreation flag to diff editor
- project: rewrite with TypeScript
- project: implement prettier
- loader: update `@monaco-editor/loader` version (1.3.2)
## 4.5.0-beta.0
###### _Apr 2, 2023_
- DiffEditor: add preventCreation flag to diff editor
- project: rewrite with TypeScript
- project: implement prettier
- loader: update `@monaco-editor/loader` version (1.3.2)
## 4.4.6
###### _Sep 24, 2022_
- fix onChange: unconditionally call onChange inside onDidChangeModelContent
- add preventCreation flag
- update lock files
## 4.4.5
###### _May 11, 2022_
- loader: update `@monaco-editor/loader` version (1.3.2)
## 4.4.4
###### _Apr 23, 2022_
- package: fix npm prepublish step
## 4.4.3
###### _Apr 23, 2022_
- loader: update `@monaco-editor/loader` version (1.3.1)
## 4.4.2
###### _Apr 12, 2022_
- package: support react/react-dom v18 as a peer dependency
## 4.4.1
###### _Mar 29, 2022_
- types: add missing type `monaco` in `loader.config`
## 4.4.0
###### _Mar 28, 2022_
- loader: update `@monaco-editor/loader` version (1.3.0); using `monaco` from `node_modules` is supported
- playground: update playground packages
## 4.3.1
###### _Oct 3, 2021_
- types: update types according to the new `loader` version and the new `wrapperProps` property
## 4.3.0
###### _Oct 3, 2021_
- Editor/DiffEditor: add `wrapperProps` property
- DiffEditor: allow `DiffEditor` to use existing models
- package.json: update `@monaco-editor/loader` version to `v1.2.0` (monaco version 0.28.1)
## 4.2.2
###### _Aug 9, 2021_
- Editor: `onValidate` integrate `onDidChangeMarkers` (released in `v0.22.0`)
- package.json: after `onDidChangeMarkers` integration `state-local` became redundant; remove it
## 4.2.1
###### _Jun 21, 2021_
- loader: update `@monaco-editor/loader` package version to the latest one (v1.1.1)
- monaco-editor: set `monaco-editor` peerDependency version to `>= 0.25.0 < 1`
- tests: update snapshots
## 4.2.0
###### _Jun 13, 2021_
- loader: update `@monaco-editor/loader` package version to the latest one (v1.1.0)
- demo: update demo examples
- tests: update snapshots
## 4.1.3
###### _Apr 21, 2021_
- types: add `keepCurrentOriginalModel` and `keepCurrentModifiedModel` to type definition
## 4.1.2
###### _Apr 19, 2021_
- DiffEditor: add `keepCurrentOriginalModel` and `keepCurrentModifiedModel` properties; indicator whether to dispose the current original/modified model when the DiffEditor is unmounted or not
- package.json: update monaco-editor peerDependency to the lates one (0.23.0)
## 4.1.1
###### _Apr 2, 2021_
- DiffEditor: update `DiffEditor`'s `modified` value by `executeEdits`
- README: add an example for getting the values of `DiffEditor`
## 4.1.0
###### _Mar 15, 2021_
- loader: update @monaco-editor/loader dependency to version 1.0.1
- types: fix Theme type; vs-dark instead of dark
## 4.0.11
###### _Feb 27, 2021_
- Editor: add an additional check in case if `line` is undefined
## 4.0.10
###### _Feb 16, 2021_
- Editor: use `revealLine` for line update instead of `setScrollPosition`
## 4.0.9
###### _Jan 29, 2021_
- Editor: save and restore current model view state, if `keepCurrentModel` is true
## 4.0.8
###### _Jan 29, 2021_
- Editor: add `keepCurrentModel` property to the `Editor` component; indicator whether to dispose the current model when the Editor is unmounted or not
## 4.0.7
###### _Jan 21, 2021_
- Editor: fire `onValidate` unconditionally, always, with the current model markers
## 4.0.6
###### _Jan 19, 2021_
- DiffEditor: check if `originalModelPath` and `modifiedModelPath` exist in `setModels` function
- DiffEditor: remove `originalModelPath` and `modifiedModelPath` from `defaultProps`
## 4.0.5
###### _Jan 19, 2021_
- utils: check if `path` exists in `createModel` utility function
- Editor: remove `defaultPath` from `defaultProps`
## 4.0.4
###### _Jan 18, 2021_
- package.json: update husky precommit hook to remove lib folder
## 4.0.3
###### _Jan 18, 2021_
- Editor: enable multi-model support
- types: add `path`, `defaultLanguage` and `saveViewState` for multi-model support
## 4.0.2
###### _Jan 18, 2021_
- types: declare and export `useMonaco` type
## 4.0.1
###### _Jan 18, 2021_
- Editor: dispose the current model if the Editor component is unmounted
## 4.0.0
###### _Jan 16, 2021_
- package.json: update dependency (`@monaco-editor/loader`) version to - `v1.0.0`
- hooks: create `useMonaco` hook
- lib: export (named) `useMonaco` from the entry file
- monaco: rename the main utility: monaco -> loader
- Editor/Diff: rename `editorDidMount` to `onMount`
- Editor/Diff: expose monaco instance from `onMount` as a second argument (first is the editor instance)
- Editor/Diff: add `beforeMount` prop: function with a single argument -> monaco instance
- Editor: add `defaultModelPath` prop, use it as a default model path
- Editor: add `defaultValue` prop and use it during default model creation
- Editor: add subscription (`onChange` prop) to listen default model content change
- Editor: remove `_isControlledMode` prop
- Diff: add `originalModelPath` and `modifiedModelPath` props, use them as model paths for original/modified models
- ControlledEditor: remove; the `Editor` component, now, handles both controlled and uncontrolled modes
- package.json: move `prop-types` to dependencies
- types: fix types according to changed
- Editor: add `onValidate` prop: an event emitted when the length of the model markers of the current model isn't 0
## 3.8.3
###### _Jan 8, 2021_
- README: fix DiffEditor `options` prop type name
- types: rename index.d.ts to types.d.ts
## 3.8.2
###### _Jan 7, 2021_
- package.json: add `@monaco-editor/loader` as a dependency
- Editor/Diff Editor components: use `@monaco-editor/loader` instead of `monaco` utility
- utilities: remove utilities that were being replaced by the `@monaco-editor/loader`
- utilities: collect remaining utilities all in the entry file / add some new ones for the next version
- config: remove config as it's already replaced by the `@monaco-editor/loader`
- hooks: create `usePrevious` hook
- cs: coding style fixes
- build: use `Rollup` as a build system; now, we have bundles for `cjs/es/umd`
## 3.7.5
###### _Jan 3, 2021_
- utilities (monaco): fix `state-local` import
## 3.7.4
###### _Dec 16, 2020_
- Editor/Diff Editor components: fix `componentDidMount` call order
- src: (minor) some corrections according to coding style
## 3.7.3
###### _Dec 15, 2020_
- Editor component: set `forceMoveMarkers` `true` in `executeEdits`
## 3.7.2
###### _Dec 5, 2020_
- package: add react/react-dom 17 version as a peer dependency
## 3.7.1
###### _Nov 29, 2020_
- editor: fix - remove unnecessary `value set` before language update
## 3.7.0
###### _Nov 11, 2020_
- monaco: update monaco version to 0.21.2
## 3.6.3
###### _Sep 22, 2020_
- types: add missing props; `className` and `wrapperClassName`
## 3.6.2
###### _Aug 19, 2020_
- eslint: update eslint rules: add 'eslint:recommended' and 'no-unused-vars' -> 'error'
- src: refactor according to new eslint rules
- package.json: update github username, add author email
## 3.6.1
###### _Aug 18, 2020_
- ControlledEditor: store current value in ref instead of making it a dependency of `handleEditorModelChange`
## 3.6.0
###### _Aug 18, 2020_
- ControlledEditor: fix onChange handler issue; dispose prev listener and attach a new one for every new onChange
- ControlledEditor: do not trigger onChange in programmatic changes
## 3.5.7
###### _Aug 9, 2020_
- utilities (monaco): remove intermediate function for injecting scripts
## 3.5.6
###### _Aug 6, 2020_
- dependencies: add `state-local` as a dependency (replace with `local-state` util)
## 3.5.5
###### _Aug 3, 2020_
- dependencies: move `@babel/runtime` from peer dependencies to dependencies
## 3.5.4
###### _Aug 3, 2020_
- dependencies: add `@babel/runtime` as a peer dependency
## 3.5.3
###### _Aug 3, 2020_
- babel: update babel version (v.7.11.0) / activate helpers (decrease bundle size)
- hooks: move out hooks from utils to root
- utilities: remove utils/store to utils/local-state
## 3.5.2
###### _Aug 2, 2020_
- utilities: redesign `store` utility
## 3.5.1
###### _July 30, 2020_
- utilities (monaco): correct config obj name
## 3.5.0
###### _July 30, 2020_
- utilities (monaco): redesign utility `monaco`; get rid of class, make it more fp
- utilities: create `compose` utility
- utilities: create `store` utility; for internal usage (in other utilities)
## 3.4.2
###### _July 15, 2020_
- controlled editor: fix undo/redo issue
## 3.4.1
###### _July 3, 2020_
- editor: improve initialization error handling
## 3.4.0
###### _June 28, 2020_
- editor: fix 'readOnly' option check
- editor: add className and wrapperClassName props
- diffEditor: add className and wrapperClassName props
## 3.3.2
###### _June 20, 2020_
- utils: (monaco) add a possibility to pass src of config script
## 3.3.1
###### _May 30, 2020_
- editor: add overrideServices prop
## 3.2.1
###### _Apr 13, 2020_
- package: update default package version to 0.20.0
## 3.2.1
###### _Mar 31, 2020_
- types: fix monaco.config types
## 3.2.0
###### _Mar 31, 2020_
- fix: check the existence of target[key] in deepMerge
- config: deprecate indirect way of configuration and add deprecation message
- config: create a new structure of the configuration; the passed object will be directly passed to require.config
- readme: redesign the config section according to the new structure
## 3.1.2
###### _Mar 16, 2020_
- diff editor: remove line prop as it's not used (and can't be used)
## 3.1.1
###### _Feb 25, 2020_
- package: update devDependencies
- demo: update all dependencies
## 3.1.0
###### _Feb 6, 2020_
- monaco: update monaco version to 0.19.0
- utils: create new util - makeCancelable (for promises)
- editor/diffEditor: cancel promise before unmount
- demo: make "dark" default theme, update package version
## 3.0.1
###### _Dec 26, 2019_
- readme: update installation section
## 3.0.0
###### _Dec 24, 2019_
- monaco: update monaco version to 0.19.0
## 2.6.1
###### _Dec 23, 2019_
- versions: fix version
## 2.5.1
###### _Dec 23, 2019_
- types: fix type of "loading"
## 2.5.0
###### _Dec 19, 2019_
- types: fix type of theme; user should be able to pass any kind of theme (string)
## 2.4.0
###### _Dec 11, 2019_
- types: add config into namespace monaco
- types: change type of "loading" from React.ElementType to React.ReactNode
## 2.3.5
###### _Dec 10, 2019_
- optimize babel build with runtime transform
## 2.3.4
###### _Dec 10, 2019_
- add xxx.spec.js.snap files to npmignore
## 2.3.2 & 3
###### _Dec 10, 2019_
- fix typo in npmignore
## 2.3.1
###### _Dec 10, 2019_
- add unnecessary files to npmignore
## 2.3.0
###### _Nov 9, 2019_
- prevent onchange in case of undo/redo (controlled editor)
- create separate component for MonacoContainer
## 2.2.0
###### _Nov 9, 2019_
- force additional tokenization in controlled mode to avoid blinking
## 2.1.1
###### _Oct 25, 2019_
- fix "options" types
## 2.1.0
###### _Oct 25, 2019_
- add monaco-editor as peer dependency for proper type definitions
- write more proper types
## 2.0.0
###### _Oct 9, 2019_
- set the default version of monaco to 0.18.1
- set last value by .setValue method before changing the language
## 1.2.3
###### _Oct 7, 2019_
- (TYPES) add "void" to the "ControlledEditorOnChange" return types
## 1.2.2
###### _Oct 3, 2019_
- update dev dependencies
- check editor existence in "removeEditor" function
- replace "jest-dom" with "@testing-library/jest-dom"
## 1.2.1
###### _Aug 20, 2019_
- Set editor value directly in case of read only
## 1.2.0
###### _Aug 16, 2019_
- Add method to modify default config
## 1.1.0
###### _July 26, 2019_
- Apply edit by using `executeEdits` method
- Correct ControlledEditor usage examples in Docs
## 1.0.8
###### _July 24, 2019_
- Export utility 'monaco' to be able to access to the monaco instance
## 1.0.7
###### _July 21, 2019_
- Add controlled version of editor component
## 1.0.5
###### _July 19, 2019_
- Add a possibility to interact with Editor before it is mounted
## 1.0.4
###### _July 13, 2019_
- FIX: add "types" fild to package.json
## 1.0.3
###### _July 13, 2019_
- Add basic support for TypeScript
## 1.0.2
###### _June 26, 2019_
- Update package description
## 1.0.1
###### _June 26, 2019_
- Move from 'unpkg.com' to 'cdn.jsdelivr.net' (NOTE: in the future, it will be configurable)
## 1.0.0
###### _June 25, 2019_
:tada: First stable version :tada:
- Add monaco version to CDN urls to avoid 302 redirects
## 0.0.3
###### _June 22, 2019_
- Remove redundant peer dependency
## 0.0.2
###### _June 22, 2019_
- Make text-align of the wrapper of editors independent from outside
## 0.0.1
###### _June 21, 2019_
First version of the library

View File

@@ -0,0 +1 @@
{"version":3,"names":["_index","require","buildUndefinedNode","unaryExpression","numericLiteral"],"sources":["../../src/builders/productions.ts"],"sourcesContent":["import { numericLiteral, unaryExpression } from \"./generated/index.ts\";\n\nexport function buildUndefinedNode() {\n return unaryExpression(\"void\", numericLiteral(0), true);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,OAAO,IAAAC,sBAAe,EAAC,MAAM,EAAE,IAAAC,qBAAc,EAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACzD","ignoreList":[]}

View File

@@ -0,0 +1,122 @@
import { importJWK } from '../key/import.js';
import { JWKSInvalid, JOSENotSupported, JWKSNoMatchingKey, JWKSMultipleMatchingKeys, } from '../util/errors.js';
import isObject from '../lib/is_object.js';
function getKtyFromAlg(alg) {
switch (typeof alg === 'string' && alg.slice(0, 2)) {
case 'RS':
case 'PS':
return 'RSA';
case 'ES':
return 'EC';
case 'Ed':
return 'OKP';
default:
throw new JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set');
}
}
function isJWKSLike(jwks) {
return (jwks &&
typeof jwks === 'object' &&
Array.isArray(jwks.keys) &&
jwks.keys.every(isJWKLike));
}
function isJWKLike(key) {
return isObject(key);
}
function clone(obj) {
if (typeof structuredClone === 'function') {
return structuredClone(obj);
}
return JSON.parse(JSON.stringify(obj));
}
class LocalJWKSet {
_jwks;
_cached = new WeakMap();
constructor(jwks) {
if (!isJWKSLike(jwks)) {
throw new JWKSInvalid('JSON Web Key Set malformed');
}
this._jwks = clone(jwks);
}
async getKey(protectedHeader, token) {
const { alg, kid } = { ...protectedHeader, ...token?.header };
const kty = getKtyFromAlg(alg);
const candidates = this._jwks.keys.filter((jwk) => {
let candidate = kty === jwk.kty;
if (candidate && typeof kid === 'string') {
candidate = kid === jwk.kid;
}
if (candidate && typeof jwk.alg === 'string') {
candidate = alg === jwk.alg;
}
if (candidate && typeof jwk.use === 'string') {
candidate = jwk.use === 'sig';
}
if (candidate && Array.isArray(jwk.key_ops)) {
candidate = jwk.key_ops.includes('verify');
}
if (candidate && alg === 'EdDSA') {
candidate = jwk.crv === 'Ed25519' || jwk.crv === 'Ed448';
}
if (candidate) {
switch (alg) {
case 'ES256':
candidate = jwk.crv === 'P-256';
break;
case 'ES256K':
candidate = jwk.crv === 'secp256k1';
break;
case 'ES384':
candidate = jwk.crv === 'P-384';
break;
case 'ES512':
candidate = jwk.crv === 'P-521';
break;
}
}
return candidate;
});
const { 0: jwk, length } = candidates;
if (length === 0) {
throw new JWKSNoMatchingKey();
}
if (length !== 1) {
const error = new JWKSMultipleMatchingKeys();
const { _cached } = this;
error[Symbol.asyncIterator] = async function* () {
for (const jwk of candidates) {
try {
yield await importWithAlgCache(_cached, jwk, alg);
}
catch { }
}
};
throw error;
}
return importWithAlgCache(this._cached, jwk, alg);
}
}
async function importWithAlgCache(cache, jwk, alg) {
const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk);
if (cached[alg] === undefined) {
const key = await importJWK({ ...jwk, ext: true }, alg);
if (key instanceof Uint8Array || key.type !== 'public') {
throw new JWKSInvalid('JSON Web Key Set members must be public keys');
}
cached[alg] = key;
}
return cached[alg];
}
export function createLocalJWKSet(jwks) {
const set = new LocalJWKSet(jwks);
const localJWKSet = async (protectedHeader, token) => set.getKey(protectedHeader, token);
Object.defineProperties(localJWKSet, {
jwks: {
value: () => clone(set._jwks),
enumerable: true,
configurable: false,
writable: false,
},
});
return localJWKSet;
}

View File

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

View File

@@ -0,0 +1,75 @@
"use strict";
var test = require("tape");
var truncate = require("./");
var browserTruncate = require("./browser");
function isHighSurrogate(codePoint) {
return codePoint >= 0xd800 && codePoint <= 0xdbff;
}
function repeat(string, times) {
return new Array(times + 1).join(string);
}
function assertLengths(t, string, charLength, byteLength) {
t.equal(string.length, charLength);
t.equal(Buffer.byteLength(string), byteLength);
}
// Test writing files to the fs
//
try {
var blns = require("./vendor/big-list-of-naughty-strings/blns.json");
}
catch (err) {
console.error("Error: Cannot load file './vendor/big-list-of-naughty-strings/blns.json'");
console.error();
console.error("Make sure you've initialized git submodules by running");
console.error();
console.error(" git submodule update --init");
console.error();
process.exit(1);
}
// Run tests against both implementations
[truncate, browserTruncate].forEach(function(truncate) {
test("strings", function(t) {
assertLengths(t, truncate("a☃", 2), 1, 1);
assertLengths(t, truncate(repeat("a", 250) + '\uD800\uDC00', 255), 252, 254);
assertLengths(t, truncate(repeat("a", 251) + '\uD800\uDC00', 255), 253, 255);
assertLengths(t, truncate(repeat("a", 252) + '\uD800\uDC00', 255), 252, 252);
assertLengths(t, truncate(repeat("a", 253) + '\uD800\uDC00', 255), 253, 253);
assertLengths(t, truncate(repeat("a", 254) + '\uD800\uDC00', 255), 254, 254);
assertLengths(t, truncate(repeat("a", 255) + '\uD800\uDC00', 255), 255, 255);
t.end();
});
// Truncate various strings
[].concat(
[
repeat("a", 300),
repeat("a", 252) + '\uD800\uDC00',
repeat("a", 251) + '\uD800\uDC00',
repeat("a", 253) + '\uD800\uDC00',
],
blns
).forEach(function(str) {
test(JSON.stringify(str), function(t) {
var i = 0;
t.equals(truncate(str, 0), "");
// Truncate string one byte at a time
while (true) {
var truncated = truncate(str, i);
t.ok(Buffer.byteLength(truncated) <= i);
t.ok( ! isHighSurrogate(truncated[truncated.length - 1]));
if (truncated === str) {
break;
}
i += 1;
}
t.end();
});
});
});

View File

@@ -0,0 +1,12 @@
import { IPropertyIdentValueDescriptor } from '../IPropertyDescriptor';
export declare const enum BORDER_STYLE {
NONE = 0,
SOLID = 1,
DASHED = 2,
DOTTED = 3,
DOUBLE = 4
}
export declare const borderTopStyle: IPropertyIdentValueDescriptor<BORDER_STYLE>;
export declare const borderRightStyle: IPropertyIdentValueDescriptor<BORDER_STYLE>;
export declare const borderBottomStyle: IPropertyIdentValueDescriptor<BORDER_STYLE>;
export declare const borderLeftStyle: IPropertyIdentValueDescriptor<BORDER_STYLE>;

View File

@@ -0,0 +1,142 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^(\d+)(ম|য়|র্থ|ষ্ঠ|শে|ই|তম)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(খ্রিঃপূঃ|খ্রিঃ)/i,
abbreviated: /^(খ্রিঃপূর্ব|খ্রিঃ)/i,
wide: /^(খ্রিস্টপূর্ব|খ্রিস্টাব্দ)/i,
};
const parseEraPatterns = {
narrow: [/^খ্রিঃপূঃ/i, /^খ্রিঃ/i],
abbreviated: [/^খ্রিঃপূর্ব/i, /^খ্রিঃ/i],
wide: [/^খ্রিস্টপূর্ব/i, /^খ্রিস্টাব্দ/i],
};
const matchQuarterPatterns = {
narrow: /^[১২৩৪]/i,
abbreviated: /^[১২৩৪]ত্রৈ/i,
wide: /^[১২৩৪](ম|য়|র্থ)? ত্রৈমাসিক/i,
};
const parseQuarterPatterns = {
any: [/১/i, /২/i, /৩/i, //i],
};
const matchMonthPatterns = {
narrow:
/^(জানু|ফেব্রু|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্ট|অক্টো|নভে|ডিসে)/i,
abbreviated:
/^(জানু|ফেব্রু|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্ট|অক্টো|নভে|ডিসে)/i,
wide: /^(জানুয়ারি|ফেব্রুয়ারি|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্টেম্বর|অক্টোবর|নভেম্বর|ডিসেম্বর)/i,
};
const parseMonthPatterns = {
any: [
/^জানু/i,
/^ফেব্রু/i,
/^মার্চ/i,
/^এপ্রিল/i,
/^মে/i,
/^জুন/i,
/^জুলাই/i,
/^আগস্ট/i,
/^সেপ্ট/i,
/^অক্টো/i,
/^নভে/i,
/^ডিসে/i,
],
};
const matchDayPatterns = {
narrow: /^(র|সো|ম|বু|বৃ|শু|শ)+/i,
short: /^(রবি|সোম|মঙ্গল|বুধ|বৃহ|শুক্র|শনি)+/i,
abbreviated: /^(রবি|সোম|মঙ্গল|বুধ|বৃহ|শুক্র|শনি)+/i,
wide: /^(রবিবার|সোমবার|মঙ্গলবার|বুধবার|বৃহস্পতিবার |শুক্রবার|শনিবার)+/i,
};
const parseDayPatterns = {
narrow: [/^র/i, /^সো/i, /^ম/i, /^বু/i, /^বৃ/i, /^শু/i, /^শ/i],
short: [/^রবি/i, /^সোম/i, /^মঙ্গল/i, /^বুধ/i, /^বৃহ/i, /^শুক্র/i, /^শনি/i],
abbreviated: [
/^রবি/i,
/^সোম/i,
/^মঙ্গল/i,
/^বুধ/i,
/^বৃহ/i,
/^শুক্র/i,
/^শনি/i,
],
wide: [
/^রবিবার/i,
/^সোমবার/i,
/^মঙ্গলবার/i,
/^বুধবার/i,
/^বৃহস্পতিবার /i,
/^শুক্রবার/i,
/^শনিবার/i,
],
};
const matchDayPeriodPatterns = {
narrow: /^(পূ|অপ|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,
abbreviated: /^(পূর্বাহ্ন|অপরাহ্ন|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,
wide: /^(পূর্বাহ্ন|অপরাহ্ন|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^পূ/i,
pm: /^অপ/i,
midnight: /^মধ্যরাত/i,
noon: /^মধ্যাহ্ন/i,
morning: /সকাল/i,
afternoon: /বিকাল/i,
evening: /সন্ধ্যা/i,
night: /রাত/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "wide",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "wide",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"onHidden.js","sources":["../../../../../src/metrics/web-vitals/lib/onHidden.ts"],"sourcesContent":["/*\n * Copyright 2020 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\nimport { WINDOW } from '../../../types';\nimport { addPageListener } from './globalListeners';\n\nexport interface OnHiddenCallback {\n (event: Event): void;\n}\n\n/**\n * Sentry-specific change:\n *\n * This function's logic was NOT updated to web-vitals 4.2.4 or 5.x but we continue\n * to use the web-vitals 3.5.2 version due to having stricter browser support.\n *\n * PR with context that made the changes:\n * https://github.com/GoogleChrome/web-vitals/pull/442/files#r1530492402\n *\n * The PR removed listening to the `pagehide` event, in favour of only listening to\n * the `visibilitychange` event. This is \"more correct\" but some browsers we still\n * support (Safari <14.4) don't fully support `visibilitychange` or have known bugs\n * with respect to the `visibilitychange` event.\n *\n * TODO (v11): If we decide to drop support for Safari 14.4, we can use the logic\n * from web-vitals 4.2.4. In this case, we also need to update the integration tests\n * that currently trigger the `pagehide` event to simulate the page being hidden.\n *\n * @param {OnHiddenCallback} cb - Callback to be executed when the page is hidden or unloaded.\n *\n * @deprecated use `whenIdleOrHidden` or `addPageListener('visibilitychange')` instead\n */\nexport const onHidden = (cb: OnHiddenCallback) => {\n const onHiddenOrPageHide = (event: Event) => {\n if (event.type === 'pagehide' || WINDOW.document?.visibilityState === 'hidden') {\n cb(event);\n }\n };\n\n addPageListener('visibilitychange', onHiddenOrPageHide, { capture: true, once: true });\n // Some browsers have buggy implementations of visibilitychange,\n // so we use pagehide in addition, just to be safe.\n addPageListener('pagehide', onHiddenOrPageHide, { capture: true, once: true });\n};\n"],"names":["WINDOW","addPageListener"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,QAAA,GAAW,CAAC,EAAE,KAAuB;AAClD,EAAE,MAAM,kBAAA,GAAqB,CAAC,KAAK,KAAY;AAC/C,IAAI,IAAI,KAAK,CAAC,SAAS,UAAA,IAAcA,YAAM,CAAC,QAAQ,EAAE,eAAA,KAAoB,QAAQ,EAAE;AACpF,MAAM,EAAE,CAAC,KAAK,CAAC;AACf,IAAI;AACJ,EAAE,CAAC;;AAEH,EAAEC,+BAAe,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAA,EAAM,CAAC;AACxF;AACA;AACA,EAAEA,+BAAe,CAAC,UAAU,EAAE,kBAAkB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAA,EAAM,CAAC;AAChF;;;;"}

View File

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

View File

@@ -0,0 +1,137 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)\.?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(p[řr](\.|ed) Kr\.|p[řr](\.|ed) n\. l\.|po Kr\.|n\. l\.)/i,
abbreviated: /^(p[řr](\.|ed) Kr\.|p[řr](\.|ed) n\. l\.|po Kr\.|n\. l\.)/i,
wide: /^(p[řr](\.|ed) Kristem|p[řr](\.|ed) na[šs][íi]m letopo[čc]tem|po Kristu|na[šs]eho letopo[čc]tu)/i,
};
const parseEraPatterns = {
any: [/^p[řr]/i, /^(po|n)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]\. [čc]tvrtlet[íi]/i,
wide: /^[1234]\. [čc]tvrtlet[íi]/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[lúubdkčcszřrlp]/i,
abbreviated:
/^(led|[úu]no|b[řr]e|dub|kv[ěe]|[čc]vn|[čc]vc|srp|z[áa][řr]|[řr][íi]j|lis|pro)/i,
wide: /^(leden|ledna|[úu]nora?|b[řr]ezen|b[řr]ezna|duben|dubna|kv[ěe]ten|kv[ěe]tna|[čc]erven(ec|ce)?|[čc]ervna|srpen|srpna|z[áa][řr][íi]|[řr][íi]jen|[řr][íi]jna|listopad(a|u)?|prosinec|prosince)/i,
};
const parseMonthPatterns = {
narrow: [
/^l/i,
/^[úu]/i,
/^b/i,
/^d/i,
/^k/i,
/^[čc]/i,
/^[čc]/i,
/^s/i,
/^z/i,
/^[řr]/i,
/^l/i,
/^p/i,
],
any: [
/^led/i,
/^[úu]n/i,
/^b[řr]e/i,
/^dub/i,
/^kv[ěe]/i,
/^[čc]vn|[čc]erven(?!\w)|[čc]ervna/i,
/^[čc]vc|[čc]erven(ec|ce)/i,
/^srp/i,
/^z[áa][řr]/i,
/^[řr][íi]j/i,
/^lis/i,
/^pro/i,
],
};
const matchDayPatterns = {
narrow: /^[npuúsčps]/i,
short: /^(ne|po|[úu]t|st|[čc]t|p[áa]|so)/i,
abbreviated: /^(ned|pon|[úu]te|st[rř]|[čc]tv|p[áa]t|sob)/i,
wide: /^(ned[ěe]le|pond[ěe]l[íi]|[úu]ter[ýy]|st[řr]eda|[čc]tvrtek|p[áa]tek|sobota)/i,
};
const parseDayPatterns = {
narrow: [/^n/i, /^p/i, /^[úu]/i, /^s/i, /^[čc]/i, /^p/i, /^s/i],
any: [/^ne/i, /^po/i, /^[úu]t/i, /^st/i, /^[čc]t/i, /^p[áa]/i, /^so/i],
};
const matchDayPeriodPatterns = {
any: /^dopoledne|dop\.?|odpoledne|odp\.?|p[ůu]lnoc|poledne|r[áa]no|odpoledne|ve[čc]er|(v )?noci?/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^dop/i,
pm: /^odp/i,
midnight: /^p[ůu]lnoc/i,
noon: /^poledne/i,
morning: /r[áa]no/i,
afternoon: /odpoledne/i,
evening: /ve[čc]er/i,
night: /noc/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1,42 @@
import { WINDOW } from '../../../types.js';
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// sentry-specific change:
// add optional param to not check for responseStart (see comment below)
const getNavigationEntry = (checkResponseStart = true) => {
const navigationEntry = WINDOW.performance?.getEntriesByType?.('navigation')[0];
// Check to ensure the `responseStart` property is present and valid.
// In some cases a zero value is reported by the browser (for
// privacy/security reasons), and in other cases (bugs) the value is
// negative or is larger than the current page time. Ignore these cases:
// - https://github.com/GoogleChrome/web-vitals/issues/137
// - https://github.com/GoogleChrome/web-vitals/issues/162
// - https://github.com/GoogleChrome/web-vitals/issues/275
if (
// sentry-specific change:
// We don't want to check for responseStart for our own use of `getNavigationEntry`
!checkResponseStart ||
(navigationEntry && navigationEntry.responseStart > 0 && navigationEntry.responseStart < performance.now())
) {
return navigationEntry;
}
};
export { getNavigationEntry };
//# sourceMappingURL=getNavigationEntry.js.map

View File

@@ -0,0 +1,9 @@
/**
* @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.
*/
export { default } from './folder-cog.js';
//# sourceMappingURL=folder-cog-2.js.map

View File

@@ -0,0 +1,35 @@
import crypto from 'crypto'
import { urlAlphabet } from '../url-alphabet/index.js'
let random = bytes =>
new Promise((resolve, reject) => {
crypto.randomFill(Buffer.allocUnsafe(bytes), (err, buf) => {
if (err) {
reject(err)
} else {
resolve(buf)
}
})
})
let customAlphabet = (alphabet, defaultSize = 21) => {
let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
let tick = (id, size = defaultSize) =>
random(step).then(bytes => {
let i = step
while (i--) {
id += alphabet[bytes[i] & mask] || ''
if (id.length >= size) return id
}
return tick(id, size)
})
return size => tick('', size)
}
let nanoid = (size = 21) =>
random((size |= 0)).then(bytes => {
let id = ''
while (size--) {
id += urlAlphabet[bytes[size] & 63]
}
return id
})
export { nanoid, customAlphabet, random }

View File

@@ -0,0 +1 @@
{"version":3,"file":"groupItemIDsByRelation.d.ts","sourceRoot":"","sources":["../../../src/providers/Folders/groupItemIDsByRelation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,gBAAgB,EAAE,uCAY/D"}

View File

@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ShoppingBasket = createLucideIcon("ShoppingBasket", [
["path", { d: "m15 11-1 9", key: "5wnq3a" }],
["path", { d: "m19 11-4-7", key: "cnml18" }],
["path", { d: "M2 11h20", key: "3eubbj" }],
["path", { d: "m3.5 11 1.6 7.4a2 2 0 0 0 2 1.6h9.8a2 2 0 0 0 2-1.6l1.7-7.4", key: "yiazzp" }],
["path", { d: "M4.5 15.5h15", key: "13mye1" }],
["path", { d: "m5 11 4-7", key: "116ra9" }],
["path", { d: "m9 11 1 9", key: "1ojof7" }]
]);
export { ShoppingBasket as default };
//# sourceMappingURL=shopping-basket.js.map

View File

@@ -0,0 +1,3 @@
import type { ArrayField } from '../../fields/config/types.js';
export declare const sessionsFieldConfig: ArrayField;
//# sourceMappingURL=sessions.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"httpcontext.js","sources":["../../../../../src/integrations/httpcontext.ts"],"sourcesContent":["import { defineIntegration } from '@sentry/core';\nimport { getHttpRequestData, WINDOW } from '../helpers';\n\n/**\n * Collects information about HTTP request headers and\n * attaches them to the event.\n */\nexport const httpContextIntegration = defineIntegration(() => {\n return {\n name: 'HttpContext',\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n const reqData = getHttpRequestData();\n const headers = {\n ...reqData.headers,\n ...event.request?.headers,\n };\n\n event.request = {\n ...reqData,\n ...event.request,\n headers,\n };\n },\n };\n});\n"],"names":["defineIntegration","WINDOW","getHttpRequestData"],"mappings":";;;;;AAGA;AACA;AACA;AACA;MACa,sBAAA,GAAyBA,sBAAiB,CAAC,MAAM;AAC9D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;AACvB,IAAI,eAAe,CAAC,KAAK,EAAE;AAC3B;AACA,MAAM,IAAI,CAACC,cAAM,CAAC,aAAa,CAACA,cAAM,CAAC,YAAY,CAACA,cAAM,CAAC,QAAQ,EAAE;AACrE,QAAQ;AACR,MAAM;;AAEN,MAAM,MAAM,OAAA,GAAUC,0BAAkB,EAAE;AAC1C,MAAM,MAAM,UAAU;AACtB,QAAQ,GAAG,OAAO,CAAC,OAAO;AAC1B,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO;AACjC,OAAO;;AAEP,MAAM,KAAK,CAAC,OAAA,GAAU;AACtB,QAAQ,GAAG,OAAO;AAClB,QAAQ,GAAG,KAAK,CAAC,OAAO;AACxB,QAAQ,OAAO;AACf,OAAO;AACP,IAAI,CAAC;AACL,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,60 @@
import type { SpanAttributeValue } from '../../types-hoist/span';
import type { LangChainLLMResult, LangChainMessage, LangChainSerialized } from './types';
/**
* Returns invocation params from a LangChain `tags` object.
*
* LangChain often passes runtime parameters (model, temperature, etc.) via the
* `tags.invocation_params` bag. If `tags` is an array (LangChain sometimes uses
* string tags), we return `undefined`.
*
* @param tags LangChain tags (string[] or record)
* @returns The `invocation_params` object, if present
*/
export declare function getInvocationParams(tags?: string[] | Record<string, unknown>): Record<string, unknown> | undefined;
/**
* Normalizes a heterogeneous set of LangChain messages to `{ role, content }`.
*
* Why so many branches? LangChain messages can arrive in several shapes:
* - Message classes with `_getType()` (most reliable)
* - Classes with meaningful constructor names (e.g. `SystemMessage`)
* - Plain objects with `type`, or `{ role, content }`
* - Serialized format with `{ lc: 1, id: [...], kwargs: { content } }`
* We preserve the prioritization to minimize behavioral drift.
*
* @param messages Mixed LangChain messages
* @returns Array of normalized `{ role, content }`
*/
export declare function normalizeLangChainMessages(messages: LangChainMessage[]): Array<{
role: string;
content: string;
}>;
/**
* Extracts attributes for plain LLM invocations (string prompts).
*
* - Operation is tagged as `chat` following OpenTelemetry semantic conventions.
* LangChain LLM operations are treated as chat operations.
* - When `recordInputs` is true, string prompts are wrapped into `{role:"user"}`
* messages to align with the chat schema used elsewhere.
*/
export declare function extractLLMRequestAttributes(llm: LangChainSerialized, prompts: string[], recordInputs: boolean, invocationParams?: Record<string, unknown>, langSmithMetadata?: Record<string, unknown>): Record<string, SpanAttributeValue>;
/**
* Extracts attributes for ChatModel invocations (array-of-arrays of messages).
*
* - Operation is tagged as `chat` following OpenTelemetry semantic conventions.
* LangChain chat model operations are chat operations.
* - We flatten LangChain's `LangChainMessage[][]` and normalize shapes into a
* consistent `{ role, content }` array when `recordInputs` is true.
* - Provider system value falls back to `serialized.id?.[2]`.
*/
export declare function extractChatModelRequestAttributes(llm: LangChainSerialized, langChainMessages: LangChainMessage[][], recordInputs: boolean, invocationParams?: Record<string, unknown>, langSmithMetadata?: Record<string, unknown>): Record<string, SpanAttributeValue>;
/**
* Extracts response-related attributes based on a `LangChainLLMResult`.
*
* - Records finish reasons when present on generations (e.g., OpenAI)
* - When `recordOutputs` is true, captures textual response content and any
* tool calls.
* - Also propagates model name (`model_name` or `model`), response `id`, and
* `stop_reason` (for providers that use it).
*/
export declare function extractLlmResponseAttributes(llmResult: LangChainLLMResult, recordOutputs: boolean): Record<string, SpanAttributeValue> | undefined;
//# sourceMappingURL=utils.d.ts.map

View File

@@ -0,0 +1,24 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Cat = createLucideIcon("Cat", [
[
"path",
{
d: "M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",
key: "x6xyqk"
}
],
["path", { d: "M8 14v.5", key: "1nzgdb" }],
["path", { d: "M16 14v.5", key: "1lajdz" }],
["path", { d: "M11.25 16.25h1.5L12 17l-.75-.75Z", key: "12kq1m" }]
]);
export { Cat as default };
//# sourceMappingURL=cat.js.map

View File

@@ -0,0 +1,2 @@
import "./emotion-react-_isolated-hnrs.browser.development.cjs.js";
export { _default as default } from "./emotion-react-_isolated-hnrs.browser.development.cjs.default.js";

View File

@@ -0,0 +1,2 @@
export { ListDrawerCreateNewDocButton } from './ListDrawerCreateNewDocButton.js';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/stripUnselectedFields.ts"],"sourcesContent":["import type { Data } from '../admin/types.js'\nimport type { Field, TabAsField } from '../fields/config/types.js'\nimport type { SelectMode, SelectType } from '../types/index.js'\n\nimport { fieldAffectsData } from '../fields/config/types.js'\n\n/**\n * This is used for the Select API to strip out fields that are not selected.\n * It will mutate the given data object and determine if your recursive function should continue to run.\n * It is used within the `afterRead` hook as well as `getFormState`.\n * @returns boolean - whether or not the recursive function should continue\n */\nexport const stripUnselectedFields = ({\n field,\n select,\n selectMode,\n siblingDoc,\n}: {\n field: Field | TabAsField\n select: SelectType\n selectMode: SelectMode\n siblingDoc: Data\n}): boolean => {\n let shouldContinue = true\n\n if (fieldAffectsData(field) && select && selectMode && field.name) {\n if (selectMode === 'include') {\n if (!select[field.name]) {\n delete siblingDoc[field.name]\n shouldContinue = false\n }\n }\n\n if (selectMode === 'exclude') {\n if (select[field.name] === false) {\n delete siblingDoc[field.name]\n shouldContinue = false\n }\n }\n }\n\n return shouldContinue\n}\n"],"names":["fieldAffectsData","stripUnselectedFields","field","select","selectMode","siblingDoc","shouldContinue","name"],"mappings":"AAIA,SAASA,gBAAgB,QAAQ,4BAA2B;AAE5D;;;;;CAKC,GACD,OAAO,MAAMC,wBAAwB,CAAC,EACpCC,KAAK,EACLC,MAAM,EACNC,UAAU,EACVC,UAAU,EAMX;IACC,IAAIC,iBAAiB;IAErB,IAAIN,iBAAiBE,UAAUC,UAAUC,cAAcF,MAAMK,IAAI,EAAE;QACjE,IAAIH,eAAe,WAAW;YAC5B,IAAI,CAACD,MAAM,CAACD,MAAMK,IAAI,CAAC,EAAE;gBACvB,OAAOF,UAAU,CAACH,MAAMK,IAAI,CAAC;gBAC7BD,iBAAiB;YACnB;QACF;QAEA,IAAIF,eAAe,WAAW;YAC5B,IAAID,MAAM,CAACD,MAAMK,IAAI,CAAC,KAAK,OAAO;gBAChC,OAAOF,UAAU,CAACH,MAAMK,IAAI,CAAC;gBAC7BD,iBAAiB;YACnB;QACF;IACF;IAEA,OAAOA;AACT,EAAC"}

View File

@@ -0,0 +1,150 @@
/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
var isExtglob = require('is-extglob');
var chars = { '{': '}', '(': ')', '[': ']'};
var strictCheck = function(str) {
if (str[0] === '!') {
return true;
}
var index = 0;
var pipeIndex = -2;
var closeSquareIndex = -2;
var closeCurlyIndex = -2;
var closeParenIndex = -2;
var backSlashIndex = -2;
while (index < str.length) {
if (str[index] === '*') {
return true;
}
if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
return true;
}
if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
if (closeSquareIndex < index) {
closeSquareIndex = str.indexOf(']', index);
}
if (closeSquareIndex > index) {
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
return true;
}
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
return true;
}
}
}
if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
closeCurlyIndex = str.indexOf('}', index);
if (closeCurlyIndex > index) {
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
return true;
}
}
}
if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
closeParenIndex = str.indexOf(')', index);
if (closeParenIndex > index) {
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
return true;
}
}
}
if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
if (pipeIndex < index) {
pipeIndex = str.indexOf('|', index);
}
if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
closeParenIndex = str.indexOf(')', pipeIndex);
if (closeParenIndex > pipeIndex) {
backSlashIndex = str.indexOf('\\', pipeIndex);
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
return true;
}
}
}
}
if (str[index] === '\\') {
var open = str[index + 1];
index += 2;
var close = chars[open];
if (close) {
var n = str.indexOf(close, index);
if (n !== -1) {
index = n + 1;
}
}
if (str[index] === '!') {
return true;
}
} else {
index++;
}
}
return false;
};
var relaxedCheck = function(str) {
if (str[0] === '!') {
return true;
}
var index = 0;
while (index < str.length) {
if (/[*?{}()[\]]/.test(str[index])) {
return true;
}
if (str[index] === '\\') {
var open = str[index + 1];
index += 2;
var close = chars[open];
if (close) {
var n = str.indexOf(close, index);
if (n !== -1) {
index = n + 1;
}
}
if (str[index] === '!') {
return true;
}
} else {
index++;
}
}
return false;
};
module.exports = function isGlob(str, options) {
if (typeof str !== 'string' || str === '') {
return false;
}
if (isExtglob(str)) {
return true;
}
var check = strictCheck;
// optionally relax check
if (options && options.strict === false) {
check = relaxedCheck;
}
return check(str);
};

View File

@@ -0,0 +1,99 @@
"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 driver_exports = {};
__export(driver_exports, {
BunSQLDatabase: () => BunSQLDatabase,
drizzle: () => drizzle
});
module.exports = __toCommonJS(driver_exports);
var import_bun = require("bun");
var import_entity = require("../entity.cjs");
var import_logger = require("../logger.cjs");
var import_db = require("../pg-core/db.cjs");
var import_dialect = require("../pg-core/dialect.cjs");
var import_relations = require("../relations.cjs");
var import_utils = require("../utils.cjs");
var import_session = require("./session.cjs");
class BunSQLDatabase extends import_db.PgDatabase {
static [import_entity.entityKind] = "BunSQLDatabase";
}
function construct(client, config = {}) {
const dialect = new import_dialect.PgDialect({ casing: config.casing });
let logger;
if (config.logger === true) {
logger = new import_logger.DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
let schema;
if (config.schema) {
const tablesConfig = (0, import_relations.extractTablesRelationalConfig)(
config.schema,
import_relations.createTableRelationsHelpers
);
schema = {
fullSchema: config.schema,
schema: tablesConfig.tables,
tableNamesMap: tablesConfig.tableNamesMap
};
}
const session = new import_session.BunSQLSession(client, dialect, schema, { logger, cache: config.cache });
const db = new BunSQLDatabase(dialect, session, schema);
db.$client = client;
db.$cache = config.cache;
if (db.$cache) {
db.$cache["invalidate"] = config.cache?.onMutate;
}
return db;
}
function drizzle(...params) {
if (typeof params[0] === "string") {
const instance = new import_bun.SQL(params[0]);
return construct(instance, params[1]);
}
if ((0, import_utils.isConfig)(params[0])) {
const { connection, client, ...drizzleConfig } = params[0];
if (client) return construct(client, drizzleConfig);
if (typeof connection === "object" && connection.url !== void 0) {
const { url, ...config } = connection;
const instance2 = new import_bun.SQL({ url, ...config });
return construct(instance2, drizzleConfig);
}
const instance = new import_bun.SQL(connection);
return construct(instance, drizzleConfig);
}
return construct(params[0], params[1]);
}
((drizzle2) => {
function mock(config) {
return construct({
options: {
parsers: {},
serializers: {}
}
}, config);
}
drizzle2.mock = mock;
})(drizzle || (drizzle = {}));
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BunSQLDatabase,
drizzle
});
//# sourceMappingURL=driver.cjs.map

View File

@@ -0,0 +1,42 @@
/*
* 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 { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';
import { NonRecordingSpan } from './NonRecordingSpan';
const VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
const VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
export function isValidTraceId(traceId) {
return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
}
export function isValidSpanId(spanId) {
return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
}
/**
* Returns true if this {@link SpanContext} is valid.
* @return true if this {@link SpanContext} is valid.
*/
export function isSpanContextValid(spanContext) {
return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));
}
/**
* Wrap the given {@link SpanContext} in a new non-recording {@link Span}
*
* @param spanContext span context to be wrapped
* @returns a new non-recording {@link Span} with the provided context
*/
export function wrapSpanContext(spanContext) {
return new NonRecordingSpan(spanContext);
}
//# sourceMappingURL=spancontext-utils.js.map

View File

@@ -0,0 +1,317 @@
import { getClient } from './currentScopes.js';
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes.js';
import { getActiveSpan } from './utils/spanUtils.js';
import { setHttpStatus, SPAN_STATUS_ERROR } from './tracing/spanstatus.js';
import { isRequest, isInstanceOf } from './utils/is.js';
import { hasSpansEnabled } from './utils/hasSpansEnabled.js';
import { SENTRY_BAGGAGE_KEY_PREFIX } from './utils/baggage.js';
import { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan.js';
import { startInactiveSpan } from './tracing/trace.js';
import { getTraceData } from './utils/traceData.js';
import { stripDataUrlContent, parseStringToURLObject, getSanitizedUrlStringFromUrlObject, isURLObjectRelative } from './utils/url.js';
/**
* Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.
*
* @returns Span if a span was created, otherwise void.
*/
function instrumentFetchRequest(
handlerData,
shouldCreateSpan,
shouldAttachHeaders,
spans,
spanOriginOrOptions,
) {
if (!handlerData.fetchData) {
return undefined;
}
const { method, url } = handlerData.fetchData;
const shouldCreateSpanResult = hasSpansEnabled() && shouldCreateSpan(url);
if (handlerData.endTimestamp && shouldCreateSpanResult) {
const spanId = handlerData.fetchData.__span;
if (!spanId) return;
const span = spans[spanId];
if (span) {
endSpan(span, handlerData);
_callOnRequestSpanEnd(span, handlerData, spanOriginOrOptions);
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete spans[spanId];
}
return undefined;
}
// Backwards-compatible with the old signature. Needed to introduce the combined optional parameter
// to avoid API breakage for anyone calling this function with the optional spanOrigin parameter
// TODO (v11): remove this backwards-compatible code and only accept the options parameter
const { spanOrigin = 'auto.http.browser', propagateTraceparent = false } =
typeof spanOriginOrOptions === 'object' ? spanOriginOrOptions : { spanOrigin: spanOriginOrOptions };
const hasParent = !!getActiveSpan();
const span =
shouldCreateSpanResult && hasParent
? startInactiveSpan(getSpanStartOptions(url, method, spanOrigin))
: new SentryNonRecordingSpan();
handlerData.fetchData.__span = span.spanContext().spanId;
spans[span.spanContext().spanId] = span;
if (shouldAttachHeaders(handlerData.fetchData.url)) {
const request = handlerData.args[0];
// Shallow clone the options object to avoid mutating the original user-provided object
// Examples: users re-using same options object for multiple fetch calls, frozen objects
const options = { ...(handlerData.args[1] || {}) };
const headers = _addTracingHeadersToFetchRequest(
request,
options,
// If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),
// we do not want to use the span as base for the trace headers,
// which means that the headers will be generated from the scope and the sampling decision is deferred
hasSpansEnabled() && hasParent ? span : undefined,
propagateTraceparent,
);
if (headers) {
// Ensure this is actually set, if no options have been passed previously
handlerData.args[1] = options;
options.headers = headers;
}
}
const client = getClient();
if (client) {
const fetchHint = {
input: handlerData.args,
response: handlerData.response,
startTimestamp: handlerData.startTimestamp,
endTimestamp: handlerData.endTimestamp,
} ;
client.emit('beforeOutgoingRequestSpan', span, fetchHint);
}
return span;
}
/**
* Calls the onRequestSpanEnd callback if it is defined.
*/
function _callOnRequestSpanEnd(
span,
handlerData,
spanOriginOrOptions,
) {
const onRequestSpanEnd =
typeof spanOriginOrOptions === 'object' && spanOriginOrOptions !== null
? spanOriginOrOptions.onRequestSpanEnd
: undefined;
onRequestSpanEnd?.(span, {
headers: handlerData.response?.headers,
error: handlerData.error,
});
}
/**
* Adds sentry-trace and baggage headers to the various forms of fetch headers.
* exported only for testing purposes
*
* When we determine if we should add a baggage header, there are 3 cases:
* 1. No previous baggage header -> add baggage
* 2. Previous baggage header has no sentry baggage values -> add our baggage
* 3. Previous baggage header has sentry baggage values -> do nothing (might have been added manually by users)
*/
// eslint-disable-next-line complexity -- yup it's this complicated :(
function _addTracingHeadersToFetchRequest(
request,
fetchOptionsObj
,
span,
propagateTraceparent,
) {
const traceHeaders = getTraceData({ span, propagateTraceparent });
const sentryTrace = traceHeaders['sentry-trace'];
const baggage = traceHeaders.baggage;
const traceparent = traceHeaders.traceparent;
// Nothing to do, when we return undefined here, the original headers will be used
if (!sentryTrace) {
return undefined;
}
const originalHeaders = fetchOptionsObj.headers || (isRequest(request) ? request.headers : undefined);
if (!originalHeaders) {
return { ...traceHeaders };
} else if (isHeaders(originalHeaders)) {
const newHeaders = new Headers(originalHeaders);
// We don't want to override manually added sentry headers
if (!newHeaders.get('sentry-trace')) {
newHeaders.set('sentry-trace', sentryTrace);
}
if (propagateTraceparent && traceparent && !newHeaders.get('traceparent')) {
newHeaders.set('traceparent', traceparent);
}
if (baggage) {
const prevBaggageHeader = newHeaders.get('baggage');
if (!prevBaggageHeader) {
newHeaders.set('baggage', baggage);
} else if (!baggageHeaderHasSentryBaggageValues(prevBaggageHeader)) {
newHeaders.set('baggage', `${prevBaggageHeader},${baggage}`);
}
}
return newHeaders;
} else if (Array.isArray(originalHeaders)) {
const newHeaders = [...originalHeaders];
if (!originalHeaders.find(header => header[0] === 'sentry-trace')) {
newHeaders.push(['sentry-trace', sentryTrace]);
}
if (propagateTraceparent && traceparent && !originalHeaders.find(header => header[0] === 'traceparent')) {
newHeaders.push(['traceparent', traceparent]);
}
const prevBaggageHeaderWithSentryValues = originalHeaders.find(
header => header[0] === 'baggage' && baggageHeaderHasSentryBaggageValues(header[1]),
);
if (baggage && !prevBaggageHeaderWithSentryValues) {
// If there are multiple entries with the same key, the browser will merge the values into a single request header.
// Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
newHeaders.push(['baggage', baggage]);
}
return newHeaders ;
} else {
const existingSentryTraceHeader = 'sentry-trace' in originalHeaders ? originalHeaders['sentry-trace'] : undefined;
const existingTraceparentHeader = 'traceparent' in originalHeaders ? originalHeaders.traceparent : undefined;
const existingBaggageHeader = 'baggage' in originalHeaders ? originalHeaders.baggage : undefined;
const newBaggageHeaders = existingBaggageHeader
? Array.isArray(existingBaggageHeader)
? [...existingBaggageHeader]
: [existingBaggageHeader]
: [];
const prevBaggageHeaderWithSentryValues =
existingBaggageHeader &&
(Array.isArray(existingBaggageHeader)
? existingBaggageHeader.find(headerItem => baggageHeaderHasSentryBaggageValues(headerItem))
: baggageHeaderHasSentryBaggageValues(existingBaggageHeader));
if (baggage && !prevBaggageHeaderWithSentryValues) {
newBaggageHeaders.push(baggage);
}
const newHeaders
= {
...originalHeaders,
'sentry-trace': (existingSentryTraceHeader ) ?? sentryTrace,
baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,
};
if (propagateTraceparent && traceparent && !existingTraceparentHeader) {
newHeaders.traceparent = traceparent;
}
return newHeaders;
}
}
function endSpan(span, handlerData) {
if (handlerData.response) {
setHttpStatus(span, handlerData.response.status);
const contentLength = handlerData.response?.headers?.get('content-length');
if (contentLength) {
const contentLengthNum = parseInt(contentLength);
if (contentLengthNum > 0) {
span.setAttribute('http.response_content_length', contentLengthNum);
}
}
} else if (handlerData.error) {
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
}
span.end();
}
function baggageHeaderHasSentryBaggageValues(baggageHeader) {
return baggageHeader.split(',').some(baggageEntry => baggageEntry.trim().startsWith(SENTRY_BAGGAGE_KEY_PREFIX));
}
function isHeaders(headers) {
return typeof Headers !== 'undefined' && isInstanceOf(headers, Headers);
}
function getSpanStartOptions(
url,
method,
spanOrigin,
) {
// Data URLs need special handling because parseStringToURLObject treats them as "relative"
// (no "://"), causing getSanitizedUrlStringFromUrlObject to return just the pathname
// without the "data:" prefix, making later stripDataUrlContent calls ineffective.
// So for data URLs, we strip the content first and use that directly.
if (url.startsWith('data:')) {
const sanitizedUrl = stripDataUrlContent(url);
return {
name: `${method} ${sanitizedUrl}`,
attributes: getFetchSpanAttributes(url, undefined, method, spanOrigin),
};
}
const parsedUrl = parseStringToURLObject(url);
const sanitizedUrl = parsedUrl ? getSanitizedUrlStringFromUrlObject(parsedUrl) : url;
return {
name: `${method} ${sanitizedUrl}`,
attributes: getFetchSpanAttributes(url, parsedUrl, method, spanOrigin),
};
}
function getFetchSpanAttributes(
url,
parsedUrl,
method,
spanOrigin,
) {
const attributes = {
url: stripDataUrlContent(url),
type: 'fetch',
'http.method': method,
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',
};
if (parsedUrl) {
if (!isURLObjectRelative(parsedUrl)) {
attributes['http.url'] = stripDataUrlContent(parsedUrl.href);
attributes['server.address'] = parsedUrl.host;
}
if (parsedUrl.search) {
attributes['http.query'] = parsedUrl.search;
}
if (parsedUrl.hash) {
attributes['http.fragment'] = parsedUrl.hash;
}
}
return attributes;
}
export { _addTracingHeadersToFetchRequest, _callOnRequestSpanEnd, instrumentFetchRequest };
//# sourceMappingURL=fetch.js.map

View File

@@ -0,0 +1,24 @@
// Copyright 2017 Lovell Fuller and others.
// SPDX-License-Identifier: Apache-2.0
'use strict';
const isLinux = () => process.platform === 'linux';
let report = null;
const getReport = () => {
if (!report) {
/* istanbul ignore next */
if (isLinux() && process.report) {
const orig = process.report.excludeNetwork;
process.report.excludeNetwork = true;
report = process.report.getReport();
process.report.excludeNetwork = orig;
} else {
report = {};
}
}
return report;
};
module.exports = { isLinux, getReport };

View File

@@ -0,0 +1,78 @@
import type { Scope } from '../scope';
import type { Span } from '../types-hoist/span';
import type { StartSpanOptions } from '../types-hoist/startSpanOptions';
import { propagationContextFromHeaders } from '../utils/tracing';
/**
* Wraps a function with a transaction/span and finishes the span after the function is done.
* The created span is the active span and will be used as parent by other spans created inside the function
* and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.
*
* If you want to create a span that is not set as active, use {@link startInactiveSpan}.
*
* You'll always get a span passed to the callback,
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
*/
export declare function startSpan<T>(options: StartSpanOptions, callback: (span: Span) => T): T;
/**
* Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span
* after the function is done automatically. Use `span.end()` to end the span.
*
* The created span is the active span and will be used as parent by other spans created inside the function
* and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.
*
* You'll always get a span passed to the callback,
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
*/
export declare function startSpanManual<T>(options: StartSpanOptions, callback: (span: Span, finish: () => void) => T): T;
/**
* Creates a span. This span is not set as active, so will not get automatic instrumentation spans
* as children or be able to be accessed via `Sentry.getActiveSpan()`.
*
* If you want to create a span that is set as active, use {@link startSpan}.
*
* This function will always return a span,
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
*/
export declare function startInactiveSpan(options: StartSpanOptions): Span;
/**
* Continue a trace from `sentry-trace` and `baggage` values.
* These values can be obtained from incoming request headers, or in the browser from `<meta name="sentry-trace">`
* and `<meta name="baggage">` HTML tags.
*
* Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically
* be attached to the incoming trace.
*/
export declare const continueTrace: <V>(options: {
sentryTrace: Parameters<typeof propagationContextFromHeaders>[0];
baggage: Parameters<typeof propagationContextFromHeaders>[1];
}, callback: () => V) => V;
/**
* Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be
* passed `null` to start an entirely new span tree.
*
* @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed,
* spans started within the callback will not be attached to a parent span.
* @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.
* @returns the value returned from the provided callback function.
*/
export declare function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T;
/** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */
export declare function suppressTracing<T>(callback: () => T): T;
/**
* Starts a new trace for the duration of the provided callback. Spans started within the
* callback will be part of the new trace instead of a potentially previously started trace.
*
* Important: Only use this function if you want to override the default trace lifetime and
* propagation mechanism of the SDK for the duration and scope of the provided callback.
* The newly created trace will also be the root of a new distributed trace, for example if
* you make http requests within the callback.
* This function might be useful if the operation you want to instrument should not be part
* of a potentially ongoing trace.
*
* Default behavior:
* - Server-side: A new trace is started for each incoming request.
* - Browser: A new trace is started for each page our route. Navigating to a new route
* or page will automatically create a new trace.
*/
export declare function startNewTrace<T>(callback: () => T): T;
//# sourceMappingURL=trace.d.ts.map

View File

@@ -0,0 +1,26 @@
{
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
'cflags': [ '-fno-exceptions' ],
'cflags_cc': [ '-fno-exceptions' ],
'conditions': [
["OS=='win'", {
# _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi
#"defines": [
# "_HAS_EXCEPTIONS=0"
#],
"msvs_settings": {
"VCCLCompilerTool": {
'ExceptionHandling': 0,
'EnablePREfast': 'true',
},
},
}],
["OS=='mac'", {
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
},
}],
],
}

View File

@@ -0,0 +1,13 @@
import type { Collection } from '../collections/config/types.js';
import type { SanitizedGlobalConfig } from '../globals/config/types.js';
import type { PayloadRequest } from '../types/index.js';
export declare const getRequestCollection: (req: PayloadRequest) => Collection;
export declare const getRequestCollectionWithID: <T extends boolean>(req: PayloadRequest, { disableSanitize, optionalID, }?: {
disableSanitize?: T;
optionalID?: boolean;
}) => {
collection: Collection;
id: T extends true ? string : number | string;
};
export declare const getRequestGlobal: (req: PayloadRequest) => SanitizedGlobalConfig;
//# sourceMappingURL=getRequestEntity.d.ts.map

View File

@@ -0,0 +1,79 @@
import { WINDOW } from '../../types.js';
import { bindReporter } from './lib/bindReporter.js';
import { getActivationStart } from './lib/getActivationStart.js';
import { getNavigationEntry } from './lib/getNavigationEntry.js';
import { initMetric } from './lib/initMetric.js';
import { whenActivated } from './lib/whenActivated.js';
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Thresholds for TTFB. See https://web.dev/articles/ttfb#what_is_a_good_ttfb_score */
const TTFBThresholds = [800, 1800];
/**
* Runs in the next task after the page is done loading and/or prerendering.
* @param callback
*/
const whenReady = (callback) => {
if (WINDOW.document?.prerendering) {
whenActivated(() => whenReady(callback));
} else if (WINDOW.document?.readyState !== 'complete') {
addEventListener('load', () => whenReady(callback), true);
} else {
// Queue a task so the callback runs after `loadEventEnd`.
setTimeout(callback);
}
};
/**
* Calculates the [TTFB](https://web.dev/articles/ttfb) value for the
* current page and calls the `callback` function once the page has loaded,
* along with the relevant `navigation` performance entry used to determine the
* value. The reported value is a `DOMHighResTimeStamp`.
*
* Note, this function waits until after the page is loaded to call `callback`
* in order to ensure all properties of the `navigation` entry are populated.
* This is useful if you want to report on other metrics exposed by the
* [Navigation Timing API](https://w3c.github.io/navigation-timing/). For
* example, the TTFB metric starts from the page's [time
* origin](https://www.w3.org/TR/hr-time-2/#sec-time-origin), which means it
* includes time spent on DNS lookup, connection negotiation, network latency,
* and server processing time.
*/
const onTTFB = (onReport, opts = {}) => {
const metric = initMetric('TTFB');
const report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);
whenReady(() => {
const navigationEntry = getNavigationEntry();
if (navigationEntry) {
// The activationStart reference is used because TTFB should be
// relative to page activation rather than navigation start if the
// page was prerendered. But in cases where `activationStart` occurs
// after the first byte is received, this time should be clamped at 0.
metric.value = Math.max(navigationEntry.responseStart - getActivationStart(), 0);
metric.entries = [navigationEntry];
report(true);
}
});
};
export { TTFBThresholds, onTTFB };
//# sourceMappingURL=onTTFB.js.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 TrendingUpDown = createLucideIcon("TrendingUpDown", [
["path", { d: "M14.828 14.828 21 21", key: "ar5fw7" }],
["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
["path", { d: "m21 3-9 9-4-4-6 6", key: "1h02xo" }],
["path", { d: "M21 8V3h-5", key: "1qoq8a" }]
]);
export { TrendingUpDown as default };
//# sourceMappingURL=trending-up-down.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/elements/WhereBuilder/Condition/Date/types.ts"],"sourcesContent":["import type { DateFieldClient } from 'payload'\n\nimport type { DefaultFilterProps } from '../types.js'\n\nexport type DateFilterProps = {\n readonly field: DateFieldClient\n readonly value: Date | string\n} & DefaultFilterProps\n"],"mappings":"AAIA","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"integration.js","sources":["../../../../../../../src/integrations/featureFlags/unleash/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\nimport {\n _INTERNAL_addFeatureFlagToActiveSpan,\n _INTERNAL_copyFlagsFromScopeToEvent,\n _INTERNAL_insertFlagToScope,\n debug,\n defineIntegration,\n fill,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { UnleashClient, UnleashClientClass } from './types';\n\ntype UnleashIntegrationOptions = {\n featureFlagClientClass: UnleashClientClass;\n};\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Unleash SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { UnleashClient } from 'unleash-proxy-client';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],\n * });\n *\n * const unleash = new UnleashClient(...);\n * unleash.start();\n *\n * unleash.isEnabled('my-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const unleashIntegration = defineIntegration(\n ({ featureFlagClientClass: unleashClientClass }: UnleashIntegrationOptions) => {\n return {\n name: 'Unleash',\n\n setupOnce() {\n const unleashClientPrototype = unleashClientClass.prototype as UnleashClient;\n fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);\n },\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return _INTERNAL_copyFlagsFromScopeToEvent(event);\n },\n };\n },\n) satisfies IntegrationFn;\n\n/**\n * Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.\n *\n * This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,\n * we log an error and return the original result.\n *\n * @param original - The original method.\n * @returns Wrapped method. Results should match the original.\n */\nfunction _wrappedIsEnabled(\n original: (this: UnleashClient, ...args: unknown[]) => unknown,\n): (this: UnleashClient, ...args: unknown[]) => unknown {\n return function (this: UnleashClient, ...args: unknown[]): unknown {\n const toggleName = args[0];\n const result = original.apply(this, args);\n\n if (typeof toggleName === 'string' && typeof result === 'boolean') {\n _INTERNAL_insertFlagToScope(toggleName, result);\n _INTERNAL_addFeatureFlagToActiveSpan(toggleName, result);\n } else if (DEBUG_BUILD) {\n debug.error(\n `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,\n );\n }\n return result;\n };\n}\n"],"names":["defineIntegration","fill","_INTERNAL_copyFlagsFromScopeToEvent","_INTERNAL_insertFlagToScope","_INTERNAL_addFeatureFlagToActiveSpan","DEBUG_BUILD","debug"],"mappings":";;;;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAA,GAAqBA,sBAAiB;AACnD,EAAE,CAAC,EAAE,sBAAsB,EAAE,kBAAA,EAAoB,KAAgC;AACjF,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,SAAS,GAAG;AAClB,QAAQ,MAAM,sBAAA,GAAyB,kBAAkB,CAAC,SAAA;AAC1D,QAAQC,SAAI,CAAC,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,CAAC;AACpE,MAAM,CAAC;;AAEP,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAOC,wCAAmC,CAAC,KAAK,CAAC;AACzD,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B,EAAE,QAAQ;AACV,EAAwD;AACxD,EAAE,OAAO,WAA+B,GAAG,IAAI,EAAsB;AACrE,IAAI,MAAM,UAAA,GAAa,IAAI,CAAC,CAAC,CAAC;AAC9B,IAAI,MAAM,MAAA,GAAS,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;;AAE7C,IAAI,IAAI,OAAO,UAAA,KAAe,QAAA,IAAY,OAAO,MAAA,KAAW,SAAS,EAAE;AACvE,MAAMC,gCAA2B,CAAC,UAAU,EAAE,MAAM,CAAC;AACrD,MAAMC,yCAAoC,CAAC,UAAU,EAAE,MAAM,CAAC;AAC9D,IAAI,CAAA,MAAO,IAAIC,sBAAW,EAAE;AAC5B,MAAMC,UAAK,CAAC,KAAK;AACjB,QAAQ,CAAC,iFAAiF,EAAE,UAAU,CAAC,EAAE,EAAE,OAAO,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC;AACrK,OAAO;AACP,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB,EAAE,CAAC;AACH;;;;"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"file-video-2.js","sources":["../../../src/icons/file-video-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileVideo2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2NCIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB4PSIyIiB5PSIxMiIgcng9IjEiIC8+CiAgPHBhdGggZD0ibTEwIDE1LjUgNCAyLjV2LTZsLTQgMi41IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/file-video-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 FileVideo2 = createLucideIcon('FileVideo2', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4', key: '1pf5j1' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['rect', { width: '8', height: '6', x: '2', y: '12', rx: '1', key: '1a6c1e' }],\n ['path', { d: 'm10 15.5 4 2.5v-6l-4 2.5', key: 't7cp39' }],\n]);\n\nexport default FileVideo2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC3D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"ProxyTracerProvider.js","sourceRoot":"","sources":["../../../src/trace/ProxyTracerProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,+CAA4C;AAC5C,6DAA0D;AAG1D,MAAM,oBAAoB,GAAG,IAAI,uCAAkB,EAAE,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAa,mBAAmB;IAG9B;;OAEG;IACH,SAAS,CAAC,IAAY,EAAE,OAAgB,EAAE,OAAuB;;QAC/D,OAAO,CACL,MAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,mCAC9C,IAAI,yBAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAC9C,CAAC;IACJ,CAAC;IAED,WAAW;;QACT,OAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,oBAAoB,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,QAAwB;QAClC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,iBAAiB,CACf,IAAY,EACZ,OAAgB,EAChB,OAAuB;;QAEvB,OAAO,MAAA,IAAI,CAAC,SAAS,0CAAE,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AA/BD,kDA+BC","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 { Tracer } from './tracer';\nimport { TracerProvider } from './tracer_provider';\nimport { ProxyTracer } from './ProxyTracer';\nimport { NoopTracerProvider } from './NoopTracerProvider';\nimport { TracerOptions } from './tracer_options';\n\nconst NOOP_TRACER_PROVIDER = new NoopTracerProvider();\n\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n */\nexport class ProxyTracerProvider implements TracerProvider {\n private _delegate?: TracerProvider;\n\n /**\n * Get a {@link ProxyTracer}\n */\n getTracer(name: string, version?: string, options?: TracerOptions): Tracer {\n return (\n this.getDelegateTracer(name, version, options) ??\n new ProxyTracer(this, name, version, options)\n );\n }\n\n getDelegate(): TracerProvider {\n return this._delegate ?? NOOP_TRACER_PROVIDER;\n }\n\n /**\n * Set the delegate tracer provider\n */\n setDelegate(delegate: TracerProvider) {\n this._delegate = delegate;\n }\n\n getDelegateTracer(\n name: string,\n version?: string,\n options?: TracerOptions\n ): Tracer | undefined {\n return this._delegate?.getTracer(name, version, options);\n }\n}\n"]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/index.ts"],"names":[],"mappings":";;AACA,6BAA4B;AAC5B,+BAA8B;AAE9B,MAAM,IAAI,GAAe;IACvB,SAAS;IACT,KAAK;IACL,OAAO;IACP,aAAa;IACb,EAAC,OAAO,EAAE,UAAU,EAAC;IACrB,aAAa;IACb,YAAS;IACT,aAAU;CACX,CAAA;AAED,kBAAe,IAAI,CAAA"}

View File

@@ -0,0 +1,25 @@
@import '../../scss/styles.scss';
@layer payload-default {
.restore-many {
@include blur-bg;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
&__toggle {
@extend %btn-reset;
}
&__checkbox {
padding: calc(var(--base) * 0.5) 0;
.checkbox-input {
label {
padding-bottom: 0;
}
}
}
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.multiplexedtransport.d.ts","sourceRoot":"","sources":["../../../../src/pluggable-exports-bundle/index.multiplexedtransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}

View File

@@ -0,0 +1,9 @@
/**
* Converts a timestamp to ms, if it was in s, or keeps it as ms.
*/
export declare function timestampToMs(timestamp: number): number;
/**
* Converts a timestamp to s, if it was in ms, or keeps it as s.
*/
export declare function timestampToS(timestamp: number): number;
//# sourceMappingURL=timestamp.d.ts.map

View File

@@ -0,0 +1,324 @@
import type {
AnySchema,
AnySchemaObject,
AnyValidateFunction,
AsyncValidateFunction,
EvaluatedProperties,
EvaluatedItems,
} from "../types"
import type Ajv from "../core"
import type {InstanceOptions} from "../core"
import {CodeGen, _, nil, stringify, Name, Code, ValueScopeName} from "./codegen"
import ValidationError from "../runtime/validation_error"
import N from "./names"
import {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from "./resolve"
import {schemaHasRulesButRef, unescapeFragment} from "./util"
import {validateFunctionCode} from "./validate"
import {URIComponent} from "fast-uri"
import {JSONType} from "./rules"
export type SchemaRefs = {
[Ref in string]?: SchemaEnv | AnySchema
}
export interface SchemaCxt {
readonly gen: CodeGen
readonly allErrors?: boolean // validation mode - whether to collect all errors or break on error
readonly data: Name // Name with reference to the current part of data instance
readonly parentData: Name // should be used in keywords modifying data
readonly parentDataProperty: Code | number // should be used in keywords modifying data
readonly dataNames: Name[]
readonly dataPathArr: (Code | number)[]
readonly dataLevel: number // the level of the currently validated data,
// it can be used to access both the property names and the data on all levels from the top.
dataTypes: JSONType[] // data types applied to the current part of data instance
definedProperties: Set<string> // set of properties to keep track of for required checks
readonly topSchemaRef: Code
readonly validateName: Name
evaluated?: Name
readonly ValidationError?: Name
readonly schema: AnySchema // current schema object - equal to parentSchema passed via KeywordCxt
readonly schemaEnv: SchemaEnv
readonly rootId: string
baseId: string // the current schema base URI that should be used as the base for resolving URIs in references (\$ref)
readonly schemaPath: Code // the run-time expression that evaluates to the property name of the current schema
readonly errSchemaPath: string // this is actual string, should not be changed to Code
readonly errorPath: Code
readonly propertyName?: Name
readonly compositeRule?: boolean // true indicates that the current schema is inside the compound keyword,
// where failing some rule doesn't mean validation failure (`anyOf`, `oneOf`, `not`, `if`).
// This flag is used to determine whether you can return validation result immediately after any error in case the option `allErrors` is not `true.
// You only need to use it if you have many steps in your keywords and potentially can define multiple errors.
props?: EvaluatedProperties | Name // properties evaluated by this schema - used by parent schema or assigned to validation function
items?: EvaluatedItems | Name // last item evaluated by this schema - used by parent schema or assigned to validation function
jtdDiscriminator?: string
jtdMetadata?: boolean
readonly createErrors?: boolean
readonly opts: InstanceOptions // Ajv instance option.
readonly self: Ajv // current Ajv instance
}
export interface SchemaObjCxt extends SchemaCxt {
readonly schema: AnySchemaObject
}
interface SchemaEnvArgs {
readonly schema: AnySchema
readonly schemaId?: "$id" | "id"
readonly root?: SchemaEnv
readonly baseId?: string
readonly schemaPath?: string
readonly localRefs?: LocalRefs
readonly meta?: boolean
}
export class SchemaEnv implements SchemaEnvArgs {
readonly schema: AnySchema
readonly schemaId?: "$id" | "id"
readonly root: SchemaEnv
baseId: string // TODO possibly, it should be readonly
schemaPath?: string
localRefs?: LocalRefs
readonly meta?: boolean
readonly $async?: boolean // true if the current schema is asynchronous.
readonly refs: SchemaRefs = {}
readonly dynamicAnchors: {[Ref in string]?: true} = {}
validate?: AnyValidateFunction
validateName?: ValueScopeName
serialize?: (data: unknown) => string
serializeName?: ValueScopeName
parse?: (data: string) => unknown
parseName?: ValueScopeName
constructor(env: SchemaEnvArgs) {
let schema: AnySchemaObject | undefined
if (typeof env.schema == "object") schema = env.schema
this.schema = env.schema
this.schemaId = env.schemaId
this.root = env.root || this
this.baseId = env.baseId ?? normalizeId(schema?.[env.schemaId || "$id"])
this.schemaPath = env.schemaPath
this.localRefs = env.localRefs
this.meta = env.meta
this.$async = schema?.$async
this.refs = {}
}
}
// let codeSize = 0
// let nodeCount = 0
// Compiles schema in SchemaEnv
export function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv {
// TODO refactor - remove compilations
const _sch = getCompilingSchema.call(this, sch)
if (_sch) return _sch
const rootId = getFullPath(this.opts.uriResolver, sch.root.baseId) // TODO if getFullPath removed 1 tests fails
const {es5, lines} = this.opts.code
const {ownProperties} = this.opts
const gen = new CodeGen(this.scope, {es5, lines, ownProperties})
let _ValidationError
if (sch.$async) {
_ValidationError = gen.scopeValue("Error", {
ref: ValidationError,
code: _`require("ajv/dist/runtime/validation_error").default`,
})
}
const validateName = gen.scopeName("validate")
sch.validateName = validateName
const schemaCxt: SchemaCxt = {
gen,
allErrors: this.opts.allErrors,
data: N.data,
parentData: N.parentData,
parentDataProperty: N.parentDataProperty,
dataNames: [N.data],
dataPathArr: [nil], // TODO can its length be used as dataLevel if nil is removed?
dataLevel: 0,
dataTypes: [],
definedProperties: new Set<string>(),
topSchemaRef: gen.scopeValue(
"schema",
this.opts.code.source === true
? {ref: sch.schema, code: stringify(sch.schema)}
: {ref: sch.schema}
),
validateName,
ValidationError: _ValidationError,
schema: sch.schema,
schemaEnv: sch,
rootId,
baseId: sch.baseId || rootId,
schemaPath: nil,
errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
errorPath: _`""`,
opts: this.opts,
self: this,
}
let sourceCode: string | undefined
try {
this._compilations.add(sch)
validateFunctionCode(schemaCxt)
gen.optimize(this.opts.code.optimize)
// gen.optimize(1)
const validateCode = gen.toString()
sourceCode = `${gen.scopeRefs(N.scope)}return ${validateCode}`
// console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))
if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch)
// console.log("\n\n\n *** \n", sourceCode)
const makeValidate = new Function(`${N.self}`, `${N.scope}`, sourceCode)
const validate: AnyValidateFunction = makeValidate(this, this.scope.get())
this.scope.value(validateName, {ref: validate})
validate.errors = null
validate.schema = sch.schema
validate.schemaEnv = sch
if (sch.$async) (validate as AsyncValidateFunction).$async = true
if (this.opts.code.source === true) {
validate.source = {validateName, validateCode, scopeValues: gen._values}
}
if (this.opts.unevaluated) {
const {props, items} = schemaCxt
validate.evaluated = {
props: props instanceof Name ? undefined : props,
items: items instanceof Name ? undefined : items,
dynamicProps: props instanceof Name,
dynamicItems: items instanceof Name,
}
if (validate.source) validate.source.evaluated = stringify(validate.evaluated)
}
sch.validate = validate
return sch
} catch (e) {
delete sch.validate
delete sch.validateName
if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode)
// console.log("\n\n\n *** \n", sourceCode, this.opts)
throw e
} finally {
this._compilations.delete(sch)
}
}
export function resolveRef(
this: Ajv,
root: SchemaEnv,
baseId: string,
ref: string
): AnySchema | SchemaEnv | undefined {
ref = resolveUrl(this.opts.uriResolver, baseId, ref)
const schOrFunc = root.refs[ref]
if (schOrFunc) return schOrFunc
let _sch = resolve.call(this, root, ref)
if (_sch === undefined) {
const schema = root.localRefs?.[ref] // TODO maybe localRefs should hold SchemaEnv
const {schemaId} = this.opts
if (schema) _sch = new SchemaEnv({schema, schemaId, root, baseId})
}
if (_sch === undefined) return
return (root.refs[ref] = inlineOrCompile.call(this, _sch))
}
function inlineOrCompile(this: Ajv, sch: SchemaEnv): AnySchema | SchemaEnv {
if (inlineRef(sch.schema, this.opts.inlineRefs)) return sch.schema
return sch.validate ? sch : compileSchema.call(this, sch)
}
// Index of schema compilation in the currently compiled list
export function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void {
for (const sch of this._compilations) {
if (sameSchemaEnv(sch, schEnv)) return sch
}
}
function sameSchemaEnv(s1: SchemaEnv, s2: SchemaEnv): boolean {
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId
}
// resolve and compile the references ($ref)
// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
function resolve(
this: Ajv,
root: SchemaEnv, // information about the root schema for the current schema
ref: string // reference to resolve
): SchemaEnv | undefined {
let sch
while (typeof (sch = this.refs[ref]) == "string") ref = sch
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref)
}
// Resolve schema, its root and baseId
export function resolveSchema(
this: Ajv,
root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
ref: string // reference to resolve
): SchemaEnv | undefined {
const p = this.opts.uriResolver.parse(ref)
const refPath = _getFullPath(this.opts.uriResolver, p)
let baseId = getFullPath(this.opts.uriResolver, root.baseId, undefined)
// TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests
if (Object.keys(root.schema).length > 0 && refPath === baseId) {
return getJsonPointer.call(this, p, root)
}
const id = normalizeId(refPath)
const schOrRef = this.refs[id] || this.schemas[id]
if (typeof schOrRef == "string") {
const sch = resolveSchema.call(this, root, schOrRef)
if (typeof sch?.schema !== "object") return
return getJsonPointer.call(this, p, sch)
}
if (typeof schOrRef?.schema !== "object") return
if (!schOrRef.validate) compileSchema.call(this, schOrRef)
if (id === normalizeId(ref)) {
const {schema} = schOrRef
const {schemaId} = this.opts
const schId = schema[schemaId]
if (schId) baseId = resolveUrl(this.opts.uriResolver, baseId, schId)
return new SchemaEnv({schema, schemaId, root, baseId})
}
return getJsonPointer.call(this, p, schOrRef)
}
const PREVENT_SCOPE_CHANGE = new Set([
"properties",
"patternProperties",
"enum",
"dependencies",
"definitions",
])
function getJsonPointer(
this: Ajv,
parsedRef: URIComponent,
{baseId, schema, root}: SchemaEnv
): SchemaEnv | undefined {
if (parsedRef.fragment?.[0] !== "/") return
for (const part of parsedRef.fragment.slice(1).split("/")) {
if (typeof schema === "boolean") return
const partSchema = schema[unescapeFragment(part)]
if (partSchema === undefined) return
schema = partSchema
// TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?
const schId = typeof schema === "object" && schema[this.opts.schemaId]
if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
baseId = resolveUrl(this.opts.uriResolver, baseId, schId)
}
}
let env: SchemaEnv | undefined
if (typeof schema != "boolean" && schema.$ref && !schemaHasRulesButRef(schema, this.RULES)) {
const $ref = resolveUrl(this.opts.uriResolver, baseId, schema.$ref)
env = resolveSchema.call(this, root, $ref)
}
// even though resolution failed we need to return SchemaEnv to throw exception
// so that compileAsync loads missing schema.
const {schemaId} = this.opts
env = env || new SchemaEnv({schema, schemaId, root, baseId})
if (env.schema !== env.root.schema) return env
return undefined
}

View File

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

View File

@@ -0,0 +1,96 @@
import { deleteHandler } from './requestHandlers/delete.js';
import { findByIDHandler } from './requestHandlers/findOne.js';
import { updateHandler } from './requestHandlers/update.js';
const preferenceAccess = ({ req })=>{
if (!req.user) {
return false;
}
const userValueCondition = {
'user.value': {
equals: req.user.id
}
};
const userRelationCondition = {
'user.relationTo': {
equals: req.user.collection
}
};
return {
and: [
userValueCondition,
userRelationCondition
]
};
};
export const preferencesCollectionSlug = 'payload-preferences';
export const getPreferencesCollection = (config)=>({
slug: preferencesCollectionSlug,
access: {
delete: preferenceAccess,
read: preferenceAccess
},
admin: {
hidden: true
},
endpoints: [
{
handler: findByIDHandler,
method: 'get',
path: '/:key'
},
{
handler: deleteHandler,
method: 'delete',
path: '/:key'
},
{
handler: updateHandler,
method: 'post',
path: '/:key'
}
],
fields: [
{
name: 'user',
type: 'relationship',
hooks: {
beforeValidate: [
({ req })=>{
if (!req?.user) {
return null;
}
return {
relationTo: req?.user.collection,
value: req?.user.id
};
}
]
},
index: true,
relationTo: config.collections.filter((collectionConfig)=>collectionConfig.auth).map((collectionConfig)=>collectionConfig.slug),
required: true
},
{
name: 'key',
type: 'text',
index: true
},
{
name: 'value',
type: 'json',
validate: (value)=>{
if (value) {
try {
JSON.parse(JSON.stringify(value));
} catch {
return 'Invalid JSON';
}
}
return true;
}
}
],
lockDocuments: false
});
//# sourceMappingURL=config.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"react-select-animated.cjs.d.mts","sourceRoot":"","sources":["../../dist/declarations/src/animated/index.d.ts"],"names":[],"mappings":"AAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"permissions.js","names":[],"sources":["../../../../src/rest/commands/create/permissions.ts"],"sourcesContent":["import type { DirectusPermission } from '../../../schema/permission.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreatePermissionOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusPermission<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Create multiple new permission rules\n *\n * @param items The permission rules to create\n * @param query Optional return data query\n *\n * @returns Returns the permission objects for the created permissions.\n */\nexport const createPermissions =\n\t<Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(\n\t\titems: NestedPartial<DirectusPermission<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<CreatePermissionOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/permissions`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'POST',\n\t});\n\n/**\n * Create a new permission rule\n *\n * @param item The permission rule to create\n * @param query Optional return data query\n *\n * @returns Returns the permission object for the created permission.\n */\nexport const createPermission =\n\t<Schema, const TQuery extends Query<Schema, DirectusPermission<Schema>>>(\n\t\titem: NestedPartial<DirectusPermission<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<CreatePermissionOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/permissions`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'POST',\n\t});\n"],"mappings":"AAkBA,MAAa,GAEX,EACA,SAEM,CACN,KAAM,eACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,OACR,EAUW,GAEX,EACA,SAEM,CACN,KAAM,eACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}

View File

@@ -0,0 +1,5 @@
## Security contact information
To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.

View File

@@ -0,0 +1 @@
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/admin/fields/Checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,+BAA+B,EAC/B,+BAA+B,EAC/B,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,aAAa,CAAA;AAEpB,KAAK,8BAA8B,GAAG,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAA;AAE/E,KAAK,4BAA4B,GAAG;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,uBAAuB,CAAA;CAC5C,CAAA;AAED,KAAK,4BAA4B,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;AAE5D,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,GACjE,eAAe,CAAC,8BAA8B,CAAC,CAAA;AAEjD,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,GACjE,eAAe,CAAC,aAAa,EAAE,8BAA8B,CAAC,CAAA;AAEhE,MAAM,MAAM,4BAA4B,GAAG,oBAAoB,CAC7D,aAAa,EACb,8BAA8B,EAC9B,4BAA4B,CAC7B,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,oBAAoB,CAC7D,8BAA8B,EAC9B,4BAA4B,CAC7B,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG,yBAAyB,CACvE,aAAa,EACb,8BAA8B,CAC/B,CAAA;AAED,MAAM,MAAM,iCAAiC,GAC3C,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;AAE3D,MAAM,MAAM,uCAAuC,GAAG,+BAA+B,CACnF,aAAa,EACb,8BAA8B,CAC/B,CAAA;AAED,MAAM,MAAM,uCAAuC,GACjD,+BAA+B,CAAC,8BAA8B,CAAC,CAAA;AAEjE,MAAM,MAAM,iCAAiC,GAAG,yBAAyB,CACvE,aAAa,EACb,8BAA8B,CAC/B,CAAA;AAED,MAAM,MAAM,iCAAiC,GAC3C,yBAAyB,CAAC,8BAA8B,CAAC,CAAA;AAE3D,MAAM,MAAM,gCAAgC,GAAG,wBAAwB,CACrE,aAAa,EACb,mBAAmB,CACpB,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,wBAAwB,CAAC,mBAAmB,CAAC,CAAA"}

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _nodeCrypto = _interopRequireDefault(require("node:crypto"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function sha1(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === 'string') {
bytes = Buffer.from(bytes, 'utf8');
}
return _nodeCrypto.default.createHash('sha1').update(bytes).digest();
}
var _default = exports.default = sha1;

View File

@@ -0,0 +1,153 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(\d+)(\.)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(mö|ms)/i,
abbreviated: /^(mö|ms)/i,
wide: /^(milattan önce|milattan sonra)/i,
};
const parseEraPatterns = {
any: [/(^mö|^milattan önce)/i, /(^ms|^milattan sonra)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]ç/i,
wide: /^((i|İ)lk|(i|İ)kinci|üçüncü|son) çeyrek/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
abbreviated: [/1ç/i, /2ç/i, /3ç/i, /4ç/i],
wide: [
/^(i|İ)lk çeyrek/i,
/(i|İ)kinci çeyrek/i,
/üçüncü çeyrek/i,
/son çeyrek/i,
],
};
const matchMonthPatterns = {
narrow: /^[oşmnhtaek]/i,
abbreviated: /^(oca|şub|mar|nis|may|haz|tem|ağu|eyl|eki|kas|ara)/i,
wide: /^(ocak|şubat|mart|nisan|mayıs|haziran|temmuz|ağustos|eylül|ekim|kasım|aralık)/i,
};
const parseMonthPatterns = {
narrow: [
/^o/i,
/^ş/i,
/^m/i,
/^n/i,
/^m/i,
/^h/i,
/^t/i,
/^a/i,
/^e/i,
/^e/i,
/^k/i,
/^a/i,
],
any: [
/^o/i,
/^ş/i,
/^mar/i,
/^n/i,
/^may/i,
/^h/i,
/^t/i,
/^ağ/i,
/^ey/i,
/^ek/i,
/^k/i,
/^ar/i,
],
};
const matchDayPatterns = {
narrow: /^[psçc]/i,
short: /^(pz|pt|sa|ça|pe|cu|ct)/i,
abbreviated: /^(paz|pzt|sal|çar|per|cum|cts)/i,
wide: /^(pazar(?!tesi)|pazartesi|salı|çarşamba|perşembe|cuma(?!rtesi)|cumartesi)/i,
};
const parseDayPatterns = {
narrow: [/^p/i, /^p/i, /^s/i, /^ç/i, /^p/i, /^c/i, /^c/i],
any: [/^pz/i, /^pt/i, /^sa/i, /^ça/i, /^pe/i, /^cu/i, /^ct/i],
wide: [
/^pazar(?!tesi)/i,
/^pazartesi/i,
/^salı/i,
/^çarşamba/i,
/^perşembe/i,
/^cuma(?!rtesi)/i,
/^cumartesi/i,
],
};
const matchDayPeriodPatterns = {
narrow: /^(öö|ös|gy|ö|sa|ös|ak|ge)/i,
any: /^(ö\.?\s?[ös]\.?|öğleden sonra|gece yarısı|öğle|(sabah|öğ|akşam|gece)(leyin))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ö\.?ö\.?/i,
pm: /^ö\.?s\.?/i,
midnight: /^(gy|gece yarısı)/i,
noon: /^öğ/i,
morning: /^sa/i,
afternoon: /^öğleden sonra/i,
evening: /^ak/i,
night: /^ge/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (value) {
return parseInt(value, 10);
},
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

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