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,86 @@
import { commitTransaction, createLocalReq, getMigrations, initTransaction, killTransaction, readMigrationFiles } from 'payload';
import { getTransaction } from './utilities/getTransaction.js';
import { migrationTableExists } from './utilities/migrationTableExists.js';
/**
* Run all migrate down functions
*/ export async function migrateReset() {
const { payload } = this;
const migrationFiles = await readMigrationFiles({
payload
});
const { existingMigrations } = await getMigrations({
payload
});
if (!existingMigrations?.length) {
payload.logger.info({
msg: 'No migrations to reset.'
});
return;
}
const req = await createLocalReq({}, payload);
existingMigrations.reverse();
// Rollback all migrations in order
for (const migration of existingMigrations){
const migrationFile = migrationFiles.find((m)=>m.name === migration.name);
try {
if (!migrationFile) {
throw new Error(`Migration ${migration.name} not found locally.`);
}
const start = Date.now();
payload.logger.info({
msg: `Migrating down: ${migrationFile.name}`
});
await initTransaction(req);
const db = await getTransaction(this, req);
await migrationFile.down({
db,
payload,
req
});
payload.logger.info({
msg: `Migrated down: ${migrationFile.name} (${Date.now() - start}ms)`
});
const tableExists = await migrationTableExists(this, db);
if (tableExists) {
await payload.delete({
id: migration.id,
collection: 'payload-migrations',
req
});
}
await commitTransaction(req);
} catch (err) {
let msg = `Error running migration ${migrationFile.name}.`;
if (err instanceof Error) {
msg += ` ${err.message}`;
}
await killTransaction(req);
payload.logger.error({
err,
msg
});
process.exit(1);
}
}
// Delete dev migration
const tableExists = await migrationTableExists(this);
if (tableExists) {
try {
await payload.delete({
collection: 'payload-migrations',
where: {
batch: {
equals: -1
}
}
});
} catch (err) {
payload.logger.error({
err,
msg: 'Error deleting dev migration'
});
}
}
}
//# sourceMappingURL=migrateReset.js.map

View File

@@ -0,0 +1,63 @@
@import '../../../scss/styles.scss';
@layer payload-default {
.list-drawer {
.list-header__title {
@extend %h2;
}
&__header {
margin-top: base(2.5);
width: 100%;
@include mid-break {
margin-top: base(1.5);
}
}
.doc-drawer__toggler.list-header__create-new-button {
background: transparent;
border: 0;
padding: 0;
cursor: pointer;
color: inherit;
border-radius: var(--style-radius-s);
&:hover .pill {
background: var(--theme-elevation-250);
}
&:focus:not(:focus-visible),
&:focus-within:not(:focus-visible) {
outline: none;
}
&:focus-visible {
outline: var(--accessibility-outline);
outline-offset: var(--accessibility-outline-offset);
}
&:disabled {
pointer-events: none;
}
.pill {
cursor: inherit;
}
}
&__select-collection-wrap {
margin-top: base(1);
}
@include mid-break {
.collection-list__header {
margin-bottom: base(0.5);
}
&__select-collection-wrap {
margin-top: calc(var(--base) / 2);
}
}
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"transform-origin.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/transform-origin.ts"],"names":[],"mappings":";;;AAEA,gEAAgF;AAChF,iDAA4D;AAI5D,IAAM,aAAa,GAAqB;IACpC,IAAI,2BAA4B;IAChC,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,wBAAY;CACtB,CAAC;AACF,IAAM,OAAO,GAAoB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAEnD,QAAA,eAAe,GAA6C;IACrE,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE,IAAI;IACZ,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,IAAM,OAAO,GAAuB,MAAM,CAAC,MAAM,CAAC,sCAAkB,CAAC,CAAC;QAEtE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,OAAO,CAAC;SAClB;QAED,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC;CACJ,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"extensions.js","names":[],"sources":["../../../../src/rest/commands/update/extensions.ts"],"sourcesContent":["import type { DirectusExtension } from '../../../schema/extension.js';\nimport type { NestedPartial } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Update an existing extension.\n * @param bundle - Bundle this extension is in\n * @param name - Unique name of the extension\n * @param data - Partial extension object\n * @returns Returns the extension that was updated\n */\nexport const updateExtension =\n\t<Schema>(\n\t\tbundle: string | null,\n\t\tname: string,\n\t\tdata: NestedPartial<DirectusExtension<Schema>>,\n\t): RestCommand<DirectusExtension<Schema>, Schema> =>\n\t() => {\n\t\tif (bundle !== null) throwIfEmpty(bundle, 'Bundle cannot be an empty string');\n\t\tthrowIfEmpty(name, 'Name cannot be empty');\n\n\t\treturn {\n\t\t\tpath: bundle ? `/extensions/${bundle}/${name}` : `/extensions/${name}`,\n\t\t\tparams: {},\n\t\t\tbody: JSON.stringify(data),\n\t\t\tmethod: 'PATCH',\n\t\t};\n\t};\n"],"mappings":"6DAYA,MAAa,GAEX,EACA,EACA,SAGI,IAAW,MAAM,EAAa,EAAQ,mCAAmC,CAC7E,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,EAAS,eAAe,EAAO,GAAG,IAAS,eAAe,IAChE,OAAQ,EAAE,CACV,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,QACR"}

View File

@@ -0,0 +1,4 @@
// Used to read the locale from the middleware
const HEADER_LOCALE_NAME = 'X-NEXT-INTL-LOCALE';
export { HEADER_LOCALE_NAME };

View File

@@ -0,0 +1,205 @@
import { entityKind, is } from "../../entity.js";
import { QueryPromise } from "../../query-promise.js";
import { SelectionProxyHandler } from "../../selection-proxy.js";
import { Param, SQL, sql } from "../../sql/sql.js";
import { Columns, getTableName, Table } from "../../table.js";
import { tracer } from "../../tracing.js";
import { haveSameKeys, mapUpdateSet, orderSelectedFields } from "../../utils.js";
import { extractUsedTable } from "../utils.js";
import { QueryBuilder } from "./query-builder.js";
class PgInsertBuilder {
constructor(table, session, dialect, withList, overridingSystemValue_) {
this.table = table;
this.session = session;
this.dialect = dialect;
this.withList = withList;
this.overridingSystemValue_ = overridingSystemValue_;
}
static [entityKind] = "PgInsertBuilder";
authToken;
/** @internal */
setToken(token) {
this.authToken = token;
return this;
}
overridingSystemValue() {
this.overridingSystemValue_ = true;
return this;
}
values(values) {
values = Array.isArray(values) ? values : [values];
if (values.length === 0) {
throw new Error("values() must be called with at least one value");
}
const mappedValues = values.map((entry) => {
const result = {};
const cols = this.table[Table.Symbol.Columns];
for (const colKey of Object.keys(entry)) {
const colValue = entry[colKey];
result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
}
return result;
});
return new PgInsertBase(
this.table,
mappedValues,
this.session,
this.dialect,
this.withList,
false,
this.overridingSystemValue_
).setToken(this.authToken);
}
select(selectQuery) {
const select = typeof selectQuery === "function" ? selectQuery(new QueryBuilder()) : selectQuery;
if (!is(select, SQL) && !haveSameKeys(this.table[Columns], select._.selectedFields)) {
throw new Error(
"Insert select error: selected fields are not the same or are in a different order compared to the table definition"
);
}
return new PgInsertBase(this.table, select, this.session, this.dialect, this.withList, true);
}
}
class PgInsertBase extends QueryPromise {
constructor(table, values, session, dialect, withList, select, overridingSystemValue_) {
super();
this.session = session;
this.dialect = dialect;
this.config = { table, values, withList, select, overridingSystemValue_ };
}
static [entityKind] = "PgInsert";
config;
cacheConfig;
returning(fields = this.config.table[Table.Symbol.Columns]) {
this.config.returningFields = fields;
this.config.returning = orderSelectedFields(fields);
return this;
}
/**
* Adds an `on conflict do nothing` clause to the query.
*
* Calling this method simply avoids inserting a row as its alternative action.
*
* See docs: {@link https://orm.drizzle.team/docs/insert#on-conflict-do-nothing}
*
* @param config The `target` and `where` clauses.
*
* @example
* ```ts
* // Insert one row and cancel the insert if there's a conflict
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onConflictDoNothing();
*
* // Explicitly specify conflict target
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onConflictDoNothing({ target: cars.id });
* ```
*/
onConflictDoNothing(config = {}) {
if (config.target === void 0) {
this.config.onConflict = sql`do nothing`;
} else {
let targetColumn = "";
targetColumn = Array.isArray(config.target) ? config.target.map((it) => this.dialect.escapeName(this.dialect.casing.getColumnCasing(it))).join(",") : this.dialect.escapeName(this.dialect.casing.getColumnCasing(config.target));
const whereSql = config.where ? sql` where ${config.where}` : void 0;
this.config.onConflict = sql`(${sql.raw(targetColumn)})${whereSql} do nothing`;
}
return this;
}
/**
* Adds an `on conflict do update` clause to the query.
*
* Calling this method will update the existing row that conflicts with the row proposed for insertion as its alternative action.
*
* See docs: {@link https://orm.drizzle.team/docs/insert#upserts-and-conflicts}
*
* @param config The `target`, `set` and `where` clauses.
*
* @example
* ```ts
* // Update the row if there's a conflict
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onConflictDoUpdate({
* target: cars.id,
* set: { brand: 'Porsche' }
* });
*
* // Upsert with 'where' clause
* await db.insert(cars)
* .values({ id: 1, brand: 'BMW' })
* .onConflictDoUpdate({
* target: cars.id,
* set: { brand: 'newBMW' },
* targetWhere: sql`${cars.createdAt} > '2023-01-01'::date`,
* });
* ```
*/
onConflictDoUpdate(config) {
if (config.where && (config.targetWhere || config.setWhere)) {
throw new Error(
'You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.'
);
}
const whereSql = config.where ? sql` where ${config.where}` : void 0;
const targetWhereSql = config.targetWhere ? sql` where ${config.targetWhere}` : void 0;
const setWhereSql = config.setWhere ? sql` where ${config.setWhere}` : void 0;
const setSql = this.dialect.buildUpdateSet(this.config.table, mapUpdateSet(this.config.table, config.set));
let targetColumn = "";
targetColumn = Array.isArray(config.target) ? config.target.map((it) => this.dialect.escapeName(this.dialect.casing.getColumnCasing(it))).join(",") : this.dialect.escapeName(this.dialect.casing.getColumnCasing(config.target));
this.config.onConflict = sql`(${sql.raw(targetColumn)})${targetWhereSql} do update set ${setSql}${whereSql}${setWhereSql}`;
return this;
}
/** @internal */
getSQL() {
return this.dialect.buildInsertQuery(this.config);
}
toSQL() {
const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
return rest;
}
/** @internal */
_prepare(name) {
return tracer.startActiveSpan("drizzle.prepareQuery", () => {
return this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), this.config.returning, name, true, void 0, {
type: "insert",
tables: extractUsedTable(this.config.table)
}, this.cacheConfig);
});
}
prepare(name) {
return this._prepare(name);
}
authToken;
/** @internal */
setToken(token) {
this.authToken = token;
return this;
}
execute = (placeholderValues) => {
return tracer.startActiveSpan("drizzle.operation", () => {
return this._prepare().execute(placeholderValues, this.authToken);
});
};
/** @internal */
getSelectedFields() {
return this.config.returningFields ? new Proxy(
this.config.returningFields,
new SelectionProxyHandler({
alias: getTableName(this.config.table),
sqlAliasedBehavior: "alias",
sqlBehavior: "error"
})
) : void 0;
}
$dynamic() {
return this;
}
}
export {
PgInsertBase,
PgInsertBuilder
};
//# sourceMappingURL=insert.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"arrow-big-right.js","sources":["../../../src/icons/arrow-big-right.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowBigRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiA5aDZWNWw3IDctNyA3di00SDZWOXoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/arrow-big-right\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 ArrowBigRight = createLucideIcon('ArrowBigRight', [\n ['path', { d: 'M6 9h6V5l7 7-7 7v-4H6V9z', key: '7fvt9c' }],\n]);\n\nexport default ArrowBigRight;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,111 @@
{
"name": "@apidevtools/json-schema-ref-parser",
"version": "11.9.3",
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers",
"scripts": {
"prepublishOnly": "yarn build",
"lint": "eslint lib",
"build": "rimraf dist && tsc",
"typecheck": "tsc --noEmit",
"prettier": "prettier --write \"**/*.+(js|jsx|ts|tsx|har||json|css|md)\"",
"test": "vitest --coverage",
"test:node": "yarn test",
"test:browser": "cross-env BROWSER=\"true\" yarn test",
"test:update": "vitest -u",
"test:watch": "vitest -w"
},
"keywords": [
"json",
"schema",
"jsonschema",
"json-schema",
"json-pointer",
"$ref",
"dereference",
"resolve"
],
"author": {
"name": "James Messinger",
"url": "https://jamesmessinger.com"
},
"contributors": [
{
"name": "Boris Cherny",
"email": "boris@performancejs.com"
},
{
"name": "Phil Sturgeon",
"email": "phil@apisyouwonthate.com"
},
{
"name": "Jakub Rożek",
"email": "jakub@stoplight.io"
},
{
"name": "JonLuca DeCaro",
"email": "apis@jonlu.ca"
}
],
"homepage": "https://apitools.dev/json-schema-ref-parser/",
"repository": {
"type": "git",
"url": "https://github.com/APIDevTools/json-schema-ref-parser.git"
},
"license": "MIT",
"funding": "https://github.com/sponsors/philsturgeon",
"types": "dist/lib/index.d.ts",
"main": "dist/lib/index.js",
"browser": {
"fs": false
},
"engines": {
"node": ">= 16"
},
"files": [
"lib",
"dist",
"cjs"
],
"devDependencies": {
"@eslint/compat": "^1.2.5",
"@eslint/js": "^9.18.0",
"@types/eslint": "^9.6.1",
"@types/js-yaml": "^4.0.9",
"@types/node": "^22",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"@vitest/coverage-v8": "^3.0.4",
"cross-env": "^7.0.3",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-promise": "^7.2.1",
"eslint-plugin-unused-imports": "^4.1.4",
"globals": "^15.14.0",
"jsdom": "^26.0.0",
"prettier": "^3.4.2",
"rimraf": "^6.0.1",
"typescript": "^5.7.3",
"typescript-eslint": "^8.21.0",
"vitest": "^3.0.4"
},
"dependencies": {
"@jsdevtools/ono": "^7.1.3",
"@types/json-schema": "^7.0.15",
"js-yaml": "^4.1.0"
},
"release": {
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
},
"packageManager": "yarn@4.2.2"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"bell-ring.js","sources":["../../../src/icons/bell-ring.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BellRing\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiA4YTYgNiAwIDAgMSAxMiAwYzAgNyAzIDkgMyA5SDNzMy0yIDMtOSIgLz4KICA8cGF0aCBkPSJNMTAuMyAyMWExLjk0IDEuOTQgMCAwIDAgMy40IDAiIC8+CiAgPHBhdGggZD0iTTQgMkMyLjggMy43IDIgNS43IDIgOCIgLz4KICA8cGF0aCBkPSJNMjIgOGMwLTIuMy0uOC00LjMtMi02IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/bell-ring\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 BellRing = createLucideIcon('BellRing', [\n ['path', { d: 'M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9', key: '1qo2s2' }],\n ['path', { d: 'M10.3 21a1.94 1.94 0 0 0 3.4 0', key: 'qgo35s' }],\n ['path', { d: 'M4 2C2.8 3.7 2 5.7 2 8', key: 'tap9e0' }],\n ['path', { d: 'M22 8c0-2.3-.8-4.3-2-6', key: '5bb3ad' }],\n]);\n\nexport default BellRing;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACzD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"debugMeta.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/debugMeta.ts"],"names":[],"mappings":"AAAA;;IAEI;AACJ,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC5B;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,mBAAmB,GAAG,eAAe,CAAC;AAEhF,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}

View File

@@ -0,0 +1,22 @@
/**
*
* @deprecated use getObjectDotNotation from `'payload/shared'` instead of `'payload'`
*
* @example
*
* ```ts
* import { getObjectDotNotation } from 'payload/shared'
*
* const obj = { a: { b: { c: 42 } } }
* const value = getObjectDotNotation<number>(obj, 'a.b.c', 0) // value is 42
* const defaultValue = getObjectDotNotation<number>(obj, 'a.b.x', 0) // defaultValue is 0
* ```
*/ export const getObjectDotNotation = (obj, path, defaultValue)=>{
if (!path || !obj) {
return defaultValue;
}
const result = path.split('.').reduce((o, i)=>o?.[i], obj);
return result === undefined ? defaultValue : result;
};
//# sourceMappingURL=getObjectDotNotation.js.map

View File

@@ -0,0 +1,27 @@
"use strict";
exports.arSA = void 0;
var _index = require("./ar-SA/_lib/formatDistance.cjs");
var _index2 = require("./ar-SA/_lib/formatLong.cjs");
var _index3 = require("./ar-SA/_lib/formatRelative.cjs");
var _index4 = require("./ar-SA/_lib/localize.cjs");
var _index5 = require("./ar-SA/_lib/match.cjs");
/**
* @category Locales
* @summary Arabic locale (Sauid Arabic).
* @language Arabic
* @iso-639-2 ara
* @author Dhaifallah Alwadani [@dalwadani](https://github.com/dalwadani)
*/
const arSA = (exports.arSA = {
code: "ar-SA",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
});

View File

@@ -0,0 +1,15 @@
export const deleteSubfoldersBeforeDelete = ({ folderFieldName, folderSlug })=>{
return async ({ id, req })=>{
await req.payload.delete({
collection: folderSlug,
req,
where: {
[folderFieldName]: {
equals: id
}
}
});
};
};
//# sourceMappingURL=deleteSubfoldersAfterDelete.js.map

View File

@@ -0,0 +1,65 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Haijie Xie @hai-x
*/
"use strict";
const makeSerializable = require("../util/makeSerializable");
const ContextDependency = require("./ContextDependency");
const ContextDependencyTemplateAsRequireCall = require("./ContextDependencyTemplateAsRequireCall");
/** @typedef {import("../ContextModule").ContextOptions} ContextOptions */
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {ContextOptions & { request: string }} ContextDependencyOptions */
class URLContextDependency extends ContextDependency {
/**
* @param {ContextDependencyOptions} options options
* @param {Range} range range
* @param {Range} valueRange value range
*/
constructor(options, range, valueRange) {
super(options);
this.range = range;
this.valueRange = valueRange;
}
get type() {
return "new URL() context";
}
get category() {
return "url";
}
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
const { write } = context;
write(this.valueRange);
super.serialize(context);
}
/**
* @param {ObjectDeserializerContext} context context
*/
deserialize(context) {
const { read } = context;
this.valueRange = read();
super.deserialize(context);
}
}
makeSerializable(
URLContextDependency,
"webpack/lib/dependencies/URLContextDependency"
);
URLContextDependency.Template = ContextDependencyTemplateAsRequireCall;
module.exports = URLContextDependency;

View File

@@ -0,0 +1,3 @@
import type { CollisionDetection } from '@dnd-kit/core';
export declare const customCollisionDetection: CollisionDetection;
//# sourceMappingURL=collisionDetection.d.ts.map

View File

@@ -0,0 +1,29 @@
import { SpanAttributeValue, SpanContextData } from './span';
type SpanLinkAttributes = {
/**
* Setting the link type to 'previous_trace' helps the Sentry product linking to the previous trace
*/
'sentry.link.type'?: string | 'previous_trace';
} & Record<string, SpanAttributeValue | undefined>;
export interface SpanLink {
/**
* Contains the SpanContext of the span to link to
*/
context: SpanContextData;
/**
* A key-value pair with primitive values or an array of primitive values
*/
attributes?: SpanLinkAttributes;
}
/**
* Link interface for the event envelope item. It's a flattened representation of `SpanLink`.
* Can include additional fields defined by OTel.
*/
export interface SpanLinkJSON extends Record<string, unknown> {
span_id: string;
trace_id: string;
sampled?: boolean;
attributes?: SpanLinkAttributes;
}
export {};
//# sourceMappingURL=link.d.ts.map

View File

@@ -0,0 +1,14 @@
export * from "./alias.js";
export * from "./columns/index.js";
export * from "./db.js";
export * from "./dialect.js";
export * from "./indexes.js";
export * from "./primary-keys.js";
export * from "./query-builders/index.js";
export * from "./schema.js";
export * from "./session.js";
export * from "./subquery.js";
export * from "./table.js";
export * from "./unique-constraint.js";
export * from "./utils.js";
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier.ts\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/sqlite-core/query-builders/count.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport { SQL, sql, type SQLWrapper } from '~/sql/sql.ts';\nimport type { SQLiteSession } from '../session.ts';\nimport type { SQLiteTable } from '../table.ts';\nimport type { SQLiteView } from '../view.ts';\n\nexport class SQLiteCountBuilder<\n\tTSession extends SQLiteSession<any, any, any, any>,\n> extends SQL<number> implements Promise<number>, SQLWrapper {\n\tprivate sql: SQL<number>;\n\n\tstatic override readonly [entityKind] = 'SQLiteCountBuilderAsync';\n\t[Symbol.toStringTag] = 'SQLiteCountBuilderAsync';\n\n\tprivate session: TSession;\n\n\tprivate static buildEmbeddedCount(\n\t\tsource: SQLiteTable | SQLiteView | SQL | SQLWrapper,\n\t\tfilters?: SQL<unknown>,\n\t): SQL<number> {\n\t\treturn sql<number>`(select count(*) from ${source}${sql.raw(' where ').if(filters)}${filters})`;\n\t}\n\n\tprivate static buildCount(\n\t\tsource: SQLiteTable | SQLiteView | SQL | SQLWrapper,\n\t\tfilters?: SQL<unknown>,\n\t): SQL<number> {\n\t\treturn sql<number>`select count(*) from ${source}${sql.raw(' where ').if(filters)}${filters}`;\n\t}\n\n\tconstructor(\n\t\treadonly params: {\n\t\t\tsource: SQLiteTable | SQLiteView | SQL | SQLWrapper;\n\t\t\tfilters?: SQL<unknown>;\n\t\t\tsession: TSession;\n\t\t},\n\t) {\n\t\tsuper(SQLiteCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);\n\n\t\tthis.session = params.session;\n\n\t\tthis.sql = SQLiteCountBuilder.buildCount(\n\t\t\tparams.source,\n\t\t\tparams.filters,\n\t\t);\n\t}\n\n\tthen<TResult1 = number, TResult2 = never>(\n\t\tonfulfilled?: ((value: number) => TResult1 | PromiseLike<TResult1>) | null | undefined,\n\t\tonrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined,\n\t): Promise<TResult1 | TResult2> {\n\t\treturn Promise.resolve(this.session.count(this.sql)).then(\n\t\t\tonfulfilled,\n\t\t\tonrejected,\n\t\t);\n\t}\n\n\tcatch(\n\t\tonRejected?: ((reason: any) => never | PromiseLike<never>) | null | undefined,\n\t): Promise<number> {\n\t\treturn this.then(undefined, onRejected);\n\t}\n\n\tfinally(onFinally?: (() => void) | null | undefined): Promise<number> {\n\t\treturn this.then(\n\t\t\t(value) => {\n\t\t\t\tonFinally?.();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\t(reason) => {\n\t\t\t\tonFinally?.();\n\t\t\t\tthrow reason;\n\t\t\t},\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAC3B,iBAA0C;AAKnC,MAAM,2BAEH,eAAmD;AAAA,EAsB5D,YACU,QAKR;AACD,UAAM,mBAAmB,mBAAmB,OAAO,QAAQ,OAAO,OAAO,EAAE,WAAW;AAN7E;AAQT,SAAK,UAAU,OAAO;AAEtB,SAAK,MAAM,mBAAmB;AAAA,MAC7B,OAAO;AAAA,MACP,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EApCQ;AAAA,EAER,QAA0B,wBAAU,IAAI;AAAA,EACxC,CAAC,OAAO,WAAW,IAAI;AAAA,EAEf;AAAA,EAER,OAAe,mBACd,QACA,SACc;AACd,WAAO,uCAAoC,MAAM,GAAG,eAAI,IAAI,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,OAAO;AAAA,EAC7F;AAAA,EAEA,OAAe,WACd,QACA,SACc;AACd,WAAO,sCAAmC,MAAM,GAAG,eAAI,IAAI,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,OAAO;AAAA,EAC5F;AAAA,EAmBA,KACC,aACA,YAC+B;AAC/B,WAAO,QAAQ,QAAQ,KAAK,QAAQ,MAAM,KAAK,GAAG,CAAC,EAAE;AAAA,MACpD;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MACC,YACkB;AAClB,WAAO,KAAK,KAAK,QAAW,UAAU;AAAA,EACvC;AAAA,EAEA,QAAQ,WAA8D;AACrE,WAAO,KAAK;AAAA,MACX,CAAC,UAAU;AACV,oBAAY;AACZ,eAAO;AAAA,MACR;AAAA,MACA,CAAC,WAAW;AACX,oBAAY;AACZ,cAAM;AAAA,MACP;AAAA,IACD;AAAA,EACD;AACD;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"diag-api.js","sourceRoot":"","sources":["../../src/diag-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC;;;;;GAKG;AACH,MAAM,CAAC,IAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { DiagAPI } from './api/diag';\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n */\nexport const diag = DiagAPI.instance();\n"]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/Auth/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAM1E,OAAO,KAA+D,MAAM,OAAO,CAAA;AAUnF,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,UAAU,IAAI;IAC1C,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,CAAC,CAAA;CACR,CAAA;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,UAAU,IAAI;IACxC,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAAA;IAC9C,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAA;IAClC,aAAa,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/C,kBAAkB,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAA;IAC7C,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACvC,cAAc,EAAE,CAAC,WAAW,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC3D,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAA;CAChB,CAAA;AAMD,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,WAAW,CAAC,EAAE,oBAAoB,CAAA;IAClC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;CACzB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EAAE,kBAAkB,EAC/B,IAAI,EAAE,WAAW,GAClB,EAAE,KAAK,qBAgUP;AAED,eAAO,MAAM,OAAO,GAAI,CAAC,oBAAmB,WAAW,CAAC,CAAC,CAAmC,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/mysql-proxy/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { MySqlRemoteDatabase } from './driver.ts';\n\nexport type ProxyMigrator = (migrationQueries: string[]) => Promise<void>;\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: MySqlRemoteDatabase<TSchema>,\n\tcallback: ProxyMigrator,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\n\tconst migrationsTable = config.migrationsTable ?? '__drizzle_migrations';\n\tconst migrationTableCreate = sql`\n\t\tcreate table if not exists ${sql.identifier(migrationsTable)} (\n\t\t\tid serial primary key,\n\t\t\thash text not null,\n\t\t\tcreated_at bigint\n\t\t)\n\t`;\n\tawait db.execute(migrationTableCreate);\n\n\tconst dbMigrations = await db.select({\n\t\tid: sql.raw('id'),\n\t\thash: sql.raw('hash'),\n\t\tcreated_at: sql.raw('created_at'),\n\t}).from(sql.identifier(migrationsTable).getSQL()).orderBy(\n\t\tsql.raw('created_at desc'),\n\t).limit(1);\n\n\tconst lastDbMigration = dbMigrations[0];\n\n\tconst queriesToRun: string[] = [];\n\n\tfor (const migration of migrations) {\n\t\tif (\n\t\t\t!lastDbMigration\n\t\t\t|| Number(lastDbMigration.created_at) < migration.folderMillis\n\t\t) {\n\t\t\tqueriesToRun.push(\n\t\t\t\t...migration.sql,\n\t\t\t\t`insert into ${\n\t\t\t\t\tsql.identifier(migrationsTable).value\n\t\t\t\t} (\\`hash\\`, \\`created_at\\`) values('${migration.hash}', '${migration.folderMillis}')`,\n\t\t\t);\n\t\t}\n\t}\n\n\tawait callback(queriesToRun);\n}\n"],"mappings":"AACA,SAAS,0BAA0B;AACnC,SAAS,WAAW;AAKpB,eAAsB,QACrB,IACA,UACA,QACC;AACD,QAAM,aAAa,mBAAmB,MAAM;AAE5C,QAAM,kBAAkB,OAAO,mBAAmB;AAClD,QAAM,uBAAuB;AAAA,+BACC,IAAI,WAAW,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAM7D,QAAM,GAAG,QAAQ,oBAAoB;AAErC,QAAM,eAAe,MAAM,GAAG,OAAO;AAAA,IACpC,IAAI,IAAI,IAAI,IAAI;AAAA,IAChB,MAAM,IAAI,IAAI,MAAM;AAAA,IACpB,YAAY,IAAI,IAAI,YAAY;AAAA,EACjC,CAAC,EAAE,KAAK,IAAI,WAAW,eAAe,EAAE,OAAO,CAAC,EAAE;AAAA,IACjD,IAAI,IAAI,iBAAiB;AAAA,EAC1B,EAAE,MAAM,CAAC;AAET,QAAM,kBAAkB,aAAa,CAAC;AAEtC,QAAM,eAAyB,CAAC;AAEhC,aAAW,aAAa,YAAY;AACnC,QACC,CAAC,mBACE,OAAO,gBAAgB,UAAU,IAAI,UAAU,cACjD;AACD,mBAAa;AAAA,QACZ,GAAG,UAAU;AAAA,QACb,eACC,IAAI,WAAW,eAAe,EAAE,KACjC,uCAAuC,UAAU,IAAI,OAAO,UAAU,YAAY;AAAA,MACnF;AAAA,IACD;AAAA,EACD;AAEA,QAAM,SAAS,YAAY;AAC5B;","names":[]}

View File

@@ -0,0 +1,20 @@
declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
declare function deepmerge<T1, T2>(x: Partial<T1>, y: Partial<T2>, options?: deepmerge.Options): T1 & T2;
declare namespace deepmerge {
export interface Options {
arrayMerge?(target: any[], source: any[], options?: ArrayMergeOptions): any[];
clone?: boolean;
customMerge?: (key: string, options?: Options) => ((x: any, y: any) => any) | undefined;
isMergeableObject?(value: object): boolean;
}
export interface ArrayMergeOptions {
isMergeableObject(value: object): boolean;
cloneUnlessOtherwiseSpecified(value: object, options?: Options): object;
}
export function all (objects: object[], options?: Options): object;
export function all<T> (objects: Partial<T>[], options?: Options): T;
}
export = deepmerge;

View File

@@ -0,0 +1,581 @@
import { CaptureContext } from '../scope';
import { Breadcrumb, BreadcrumbHint } from './breadcrumb';
import { ErrorEvent, EventHint, TransactionEvent } from './event';
import { Integration } from './integration';
import { Log } from './log';
import { Metric } from './metric';
import { TracesSamplerSamplingContext } from './samplingcontext';
import { SdkMetadata } from './sdkmetadata';
import { SpanJSON } from './span';
import { StackLineParser, StackParser } from './stacktrace';
import { TracePropagationTargets } from './tracing';
import { BaseTransportOptions, Transport } from './transport';
/**
* Base options for WinterTC-compatible server-side JavaScript runtimes.
* This interface contains common configuration options shared between
* SDKs.
*/
export interface ServerRuntimeOptions {
/**
* List of strings/regex controlling to which outgoing requests
* the SDK will attach tracing headers.
*
* By default the SDK will attach those headers to all outgoing
* requests. If this option is provided, the SDK will match the
* request URL of outgoing requests against the items in this
* array, and only attach tracing headers if a match was found.
*
* @example
* ```js
* Sentry.init({
* tracePropagationTargets: ['api.site.com'],
* });
* ```
*/
tracePropagationTargets?: TracePropagationTargets;
/**
* Sets an optional server name (device name).
*
* This is useful for identifying which server or instance is sending events.
*/
serverName?: string;
/**
* If you use Spotlight by Sentry during development, use
* this option to forward captured Sentry events to Spotlight.
*
* Either set it to true, or provide a specific Spotlight Sidecar URL.
*
* More details: https://spotlightjs.com/
*
* IMPORTANT: Only set this option to `true` while developing, not in production!
*/
spotlight?: boolean | string;
/**
* If set to `false`, the SDK will not automatically detect the `serverName`.
*
* This is useful if you are using the SDK in a CLI app or Electron where the
* hostname might be considered PII.
*
* @default true
*/
includeServerName?: boolean;
/**
* By default, the SDK will try to identify problems with your instrumentation setup and warn you about it.
* If you want to disable these warnings, set this to `true`.
*/
disableInstrumentationWarnings?: boolean;
/**
* Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause
* problems for sending events from command line applications. Setting it too
* high can cause the application to block for users with network connectivity
* problems.
*/
shutdownTimeout?: number;
/**
* Configures in which interval client reports will be flushed. Defaults to `60_000` (milliseconds).
*/
clientReportFlushInterval?: number;
/**
* The max. duration in seconds that the SDK will wait for parent spans to be finished before discarding a span.
* The SDK will automatically clean up spans that have no finished parent after this duration.
* This is necessary to prevent memory leaks in case of parent spans that are never finished or otherwise dropped/missing.
* However, if you have very long-running spans in your application, a shorter duration might cause spans to be discarded too early.
* In this case, you can increase this duration to a value that fits your expected data.
*
* Defaults to 300 seconds (5 minutes).
*/
maxSpanWaitDuration?: number;
/**
* Callback that is executed when a fatal global error occurs.
*/
onFatalError?(this: void, error: Error): void;
}
/**
* A filter object for ignoring spans.
* At least one of the properties (`op` or `name`) must be set.
*/
type IgnoreSpanFilter = {
/**
* Spans with a name matching this pattern will be ignored.
*/
name: string | RegExp;
/**
* Spans with an op matching this pattern will be ignored.
*/
op?: string | RegExp;
} | {
/**
* Spans with a name matching this pattern will be ignored.
*/
name?: string | RegExp;
/**
* Spans with an op matching this pattern will be ignored.
*/
op: string | RegExp;
};
export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOptions> {
/**
* Enable debug functionality in the SDK itself. If `debug` is set to `true` the SDK will attempt
* to print out useful debugging information about what the SDK is doing.
*
* @default false
*/
debug?: boolean;
/**
* Specifies whether this SDK should send events to Sentry. Setting this to `enabled: false`
* doesn't prevent all overhead from Sentry instrumentation. To disable Sentry completely,
* depending on environment, call `Sentry.init conditionally.
*
* @default true
*/
enabled?: boolean;
/**
* When enabled, stack traces are automatically attached to all events captured with `Sentry.captureMessage`.
*
* Grouping in Sentry is different for events with stack traces and without. As a result, you will get
* new groups as you enable or disable this flag for certain events.
*
* @default false
*/
attachStacktrace?: boolean;
/**
* Send SDK Client Reports, which are used to emit outcomes about events that the SDK dropped
* or failed to capture.
*
* @default true
*/
sendClientReports?: boolean;
/**
* The DSN tells the SDK where to send the events. If this is not set, the SDK will not send any events to Sentry.
*
* @default undefined
*/
dsn?: string | undefined;
/**
* Sets the release. Release names are strings, but some formats are detected by Sentry and might be
* rendered differently. Learn more about how to send release data so Sentry can tell you about
* regressions between releases and identify the potential source in the
* [releases documentation](https://docs.sentry.io/product/releases/)
*
* @default undefined
*/
release?: string | undefined;
/**
* The current environment of your application (e.g. "production").
*
* Environments are case-sensitive. The environment name can't contain newlines, spaces or forward slashes,
* can't be the string "None", or exceed 64 characters. You can't delete environments, but you can hide them.
*
* @default "production"
*/
environment?: string | undefined;
/**
* Sets the distribution of the application. Distributions are used to disambiguate build or
* deployment variants of the same release of an application.
*
* @default undefined
*/
dist?: string | undefined;
/**
* List of integrations that should be installed after SDK was initialized.
*
* @default []
*/
integrations: Integration[];
/**
* A function that takes transport options and returns the Transport object which is used to send events to Sentry.
* The function is invoked internally when the client is initialized.
*/
transport: (transportOptions: TO) => Transport;
/**
* A stack parser implementation. By default, a stack parser is supplied for all supported platforms.
*/
stackParser: StackParser;
/**
* Options for the default transport that the SDK uses.
*/
transportOptions?: Partial<TO>;
/**
* Sample rate to determine trace sampling.
*
* 0.0 = 0% chance of a given trace being sent (send no traces) 1.0 = 100% chance of a given trace being sent (send
* all traces).
*
* Tracing is enabled if either this or `tracesSampler` is defined. If both are defined, `tracesSampleRate` is
* ignored. Set this and `tracesSampler` to `undefined` to disable tracing.
*
* @default undefined
*/
tracesSampleRate?: number;
/**
* If this is enabled, any spans started will always have their parent be the active root span,
* if there is any active span.
*
* This is necessary because in some environments (e.g. browser),
* we cannot guarantee an accurate active span.
* Because we cannot properly isolate execution environments,
* you may get wrong results when using e.g. nested `startSpan()` calls.
*
* To solve this, in these environments we'll by default enable this option.
*/
parentSpanIsAlwaysRootSpan?: boolean;
/**
* Initial data to populate scope.
*
* @default undefined
*/
initialScope?: CaptureContext;
/**
* The maximum number of breadcrumbs sent with events.
* Sentry has a maximum payload size of 1MB and any events exceeding that payload size will be dropped.
*
* @default 100
*/
maxBreadcrumbs?: number;
/**
* A global sample rate to apply to all error events.
*
* 0.0 = 0% chance of a given event being sent (send no events) 1.0 = 100% chance of a given event being sent (send
* all events)
*
* @default 1.0
*/
sampleRate?: number;
/**
* Maximum number of chars a single value can have before it will be truncated.
*/
maxValueLength?: number;
/**
* Maximum number of levels that normalization algorithm will traverse in objects and arrays.
* Used when normalizing an event before sending, on all of the listed attributes:
* - `breadcrumbs.data`
* - `user`
* - `contexts`
* - `extra`
*
* @default 3
*/
normalizeDepth?: number;
/**
* Maximum number of properties or elements that the normalization algorithm will output in any single array or object included in the normalized event.
* Used when normalizing an event before sending, on all of the listed attributes:
* - `breadcrumbs.data`
* - `user`
* - `contexts`
* - `extra`
*
* @default 1000
*/
normalizeMaxBreadth?: number;
/**
* A pattern for error messages which should not be sent to Sentry.
* By default, all errors will be sent.
*
* Behavior of the `ignoreErrors` option is controlled by the `Sentry.eventFiltersIntegration` integration. If the
* event filters integration is not installed, the `ignoreErrors` option will not have any effect.
*
* @default []
*/
ignoreErrors?: Array<string | RegExp>;
/**
* A pattern for transaction names which should not be sent to Sentry.
* By default, all transactions will be sent.
*
* Behavior of the `ignoreTransactions` option is controlled by the `Sentry.eventFiltersIntegration` integration.
* If the event filters integration is not installed, the `ignoreTransactions` option will not have any effect.
*
* @default []
*/
ignoreTransactions?: Array<string | RegExp>;
/**
* A list of span names or patterns to ignore.
*
* If you specify a pattern {@link IgnoreSpanFilter}, at least one
* of the properties (`op` or `name`) must be set.
*
* @default []
*/
ignoreSpans?: (string | RegExp | IgnoreSpanFilter)[];
/**
* A URL to an envelope tunnel endpoint. An envelope tunnel is an HTTP endpoint
* that accepts Sentry envelopes for forwarding. This can be used to force data
* through a custom server independent of the type of data.
*
* @default undefined
*/
tunnel?: string;
/**
* Controls if potentially sensitive data should be sent to Sentry by default.
* Note that this only applies to data that the SDK is sending by default
* but not data that was explicitly set (e.g. by calling `Sentry.setUser()`).
*
* @default false
*
* NOTE: This option currently controls only a few data points in a selected
* set of SDKs. The goal for this option is to eventually control all sensitive
* data the SDK sets by default. However, this would be a breaking change so
* until the next major update this option only controls data points which were
* added in versions above `7.9.0`.
*/
sendDefaultPii?: boolean;
/**
* Controls whether and how to enhance fetch error messages by appending the request hostname.
* Generic fetch errors like "Failed to fetch" will be enhanced to include the hostname
* (e.g., "Failed to fetch (example.com)").
*
* - `'always'` (default): Modifies the actual error message directly. This may break third-party packages
* that rely on exact message matching (e.g., is-network-error, p-retry).
* - `'report-only'`: Only enhances the message when sending to Sentry. The original error
* message remains unchanged, preserving compatibility with third-party packages.
* - `false`: Disables hostname enhancement completely.
*
* @default 'always'
*/
enhanceFetchErrorMessages?: 'always' | 'report-only' | false;
/**
* Set of metadata about the SDK that can be internally used to enhance envelopes and events,
* and provide additional data about every request.
*
* @internal This option is not part of the public API and is subject to change at any time.
*/
_metadata?: SdkMetadata;
/**
* Options which are in beta, or otherwise not guaranteed to be stable.
*/
_experiments?: {
[key: string]: any;
/**
* If metrics support should be enabled.
*
* @default false
* @experimental
* @deprecated Use the top level`enableMetrics` option instead.
*/
enableMetrics?: boolean;
/**
* An event-processing callback for metrics, guaranteed to be invoked after all other metric
* processors. This allows a metric to be modified or dropped before it's sent.
*
* Note that you must return a valid metric from this callback. If you do not wish to modify the metric, simply return
* it at the end. Returning `null` will cause the metric to be dropped.
*
* @default undefined
* @experimental
*
* @param metric The metric generated by the SDK.
* @returns A new metric that will be sent | null.
* @deprecated Use the top level`beforeSendMetric` option instead.
*/
beforeSendMetric?: (metric: Metric) => Metric | null;
/**
* Determines if logs support should be enabled.
*
* @default false
* @deprecated Use the top level `enableLogs` option instead.
*/
enableLogs?: boolean;
};
/**
* A pattern for error URLs which should exclusively be sent to Sentry.
* This is the opposite of {@link CoreOptions.denyUrls}.
* By default, all errors will be sent.
*
* Behavior of the `allowUrls` option is controlled by the `Sentry.eventFiltersIntegration` integration.
* If the event filters integration is not installed, the `allowUrls` option will not have any effect.
*
* @default []
*/
allowUrls?: Array<string | RegExp>;
/**
* A pattern for error URLs which should not be sent to Sentry.
* To allow certain errors instead, use {@link CoreOptions.allowUrls}.
* By default, all errors will be sent.
*
* Behavior of the `denyUrls` option is controlled by the `Sentry.eventFiltersIntegration` integration.
* If the event filters integration is not installed, the `denyUrls` option will not have any effect.
*
* @default []
*/
denyUrls?: Array<string | RegExp>;
/**
* List of strings and/or Regular Expressions used to determine which outgoing requests will have `sentry-trace` and `baggage`
* headers attached.
*
* **Default:** If this option is not provided, tracing headers will be attached to all outgoing requests.
* If you are using a browser SDK, by default, tracing headers will only be attached to outgoing requests to the same origin.
*
* **Disclaimer:** Carelessly setting this option in browser environments may result into CORS errors!
* Only attach tracing headers to requests to the same origin, or to requests to services you can control CORS headers of.
* Cross-origin requests, meaning requests to a different domain, for example a request to `https://api.example.com/` while you're on `https://example.com/`, take special care.
* If you are attaching headers to cross-origin requests, make sure the backend handling the request returns a `"Access-Control-Allow-Headers: sentry-trace, baggage"` header to ensure your requests aren't blocked.
*
* If you provide a `tracePropagationTargets` array, the entries you provide will be matched against the entire URL of the outgoing request.
* If you are using a browser SDK, the entries will also be matched against the pathname of the outgoing requests.
* This is so you can have matchers for relative requests, for example, `/^\/api/` if you want to trace requests to your `/api` routes on the same domain.
*
* If any of the two match any of the provided values, tracing headers will be attached to the outgoing request.
* Both, the string values, and the RegExes you provide in the array will match if they partially match the URL or pathname.
*
* Examples:
* - `tracePropagationTargets: [/^\/api/]` and request to `https://same-origin.com/api/posts`:
* - Tracing headers will be attached because the request is sent to the same origin and the regex matches the pathname "/api/posts".
* - `tracePropagationTargets: [/^\/api/]` and request to `https://different-origin.com/api/posts`:
* - Tracing headers will not be attached because the pathname will only be compared when the request target lives on the same origin.
* - `tracePropagationTargets: [/^\/api/, 'https://external-api.com']` and request to `https://external-api.com/v1/data`:
* - Tracing headers will be attached because the request URL matches the string `'https://external-api.com'`.
*/
tracePropagationTargets?: TracePropagationTargets;
/**
* If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,
* in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}
* option to control to which outgoing requests the header will be attached.
*
* **Important:** If you set this option to `true`, make sure that you configured your servers'
* CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.
*
* @see https://www.w3.org/TR/trace-context/
*
* @default false
*/
propagateTraceparent?: boolean;
/**
* If set to `true`, the SDK will only continue a trace if the `organization ID` of the incoming trace found in the
* `baggage` header matches the `organization ID` of the current Sentry client.
*
* The client's organization ID is extracted from the DSN or can be set with the `orgId` option.
*
* If the organization IDs do not match, the SDK will start a new trace instead of continuing the incoming one.
* This is useful to prevent traces of unknown third-party services from being continued in your application.
*
* @default false
*/
strictTraceContinuation?: boolean;
/**
* The organization ID for your Sentry project.
*
* The SDK will try to extract the organization ID from the DSN. If it cannot be found, or if you need to override it,
* you can provide the ID with this option. The organization ID is used for trace propagation and for features like `strictTraceContinuation`.
*/
orgId?: string | number;
/**
* If logs support should be enabled.
*
* @default false
*/
enableLogs?: boolean;
/**
* An event-processing callback for logs, guaranteed to be invoked after all other log
* processors. This allows a log to be modified or dropped before it's sent.
*
* Note that you must return a valid log from this callback. If you do not wish to modify the log, simply return
* it at the end. Returning `null` will cause the log to be dropped.
*
* @default undefined
*
* @param log The log generated by the SDK.
* @returns A new log that will be sent | null.
*/
beforeSendLog?: (log: Log) => Log | null;
/**
* If metrics support should be enabled.
*
* @default true
*/
enableMetrics?: boolean;
/**
* An event-processing callback for metrics, guaranteed to be invoked after all other metric
* processors. This allows a metric to be modified or dropped before it's sent.
*
* Note that you must return a valid metric from this callback. If you do not wish to modify the metric, simply return
* it at the end. Returning `null` will cause the metric to be dropped.
*
* @default undefined
*
* @param metric The metric generated by the SDK.
* @returns A new metric that will be sent | null.
*/
beforeSendMetric?: (metric: Metric) => Metric | null;
/**
* Function to compute tracing sample rate dynamically and filter unwanted traces.
*
* Tracing is enabled if either this or `tracesSampleRate` is defined. If both are defined, `tracesSampleRate` is
* ignored. Set this and `tracesSampleRate` to `undefined` to disable tracing.
*
* Will automatically be passed a context object of default and optional custom data.
*
* @returns A sample rate between 0 and 1 (0 drops the trace, 1 guarantees it will be sent). Returning `true` is
* equivalent to returning 1 and returning `false` is equivalent to returning 0.
*/
tracesSampler?: (samplingContext: TracesSamplerSamplingContext) => number | boolean;
/**
* An event-processing callback for error and message events, guaranteed to be invoked after all other event
* processors, which allows an event to be modified or dropped.
*
* Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
* it at the end. Returning `null` will cause the event to be dropped.
*
* @param event The error or message event generated by the SDK.
* @param hint Event metadata useful for processing.
* @returns A new event that will be sent | null.
*/
beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<ErrorEvent | null> | ErrorEvent | null;
/**
* This function can be defined to modify a child span before it's sent.
*
* @param span The span generated by the SDK.
*
* @returns The modified span payload that will be sent.
*/
beforeSendSpan?: (span: SpanJSON) => SpanJSON;
/**
* An event-processing callback for transaction events, guaranteed to be invoked after all other event
* processors. This allows an event to be modified or dropped before it's sent.
*
* Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
* it at the end. Returning `null` will cause the event to be dropped.
*
* @param event The error or message event generated by the SDK.
* @param hint Event metadata useful for processing.
* @returns A new event that will be sent | null.
*/
beforeSendTransaction?: (event: TransactionEvent, hint: EventHint) => PromiseLike<TransactionEvent | null> | TransactionEvent | null;
/**
* A callback invoked when adding a breadcrumb, allowing to optionally modify
* it before adding it to future events.
*
* Note that you must return a valid breadcrumb from this callback. If you do
* not wish to modify the breadcrumb, simply return it at the end.
* Returning null will cause the breadcrumb to be dropped.
*
* @param breadcrumb The breadcrumb as created by the SDK.
* @returns The breadcrumb that will be added | null.
*/
beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
}
/** Base configuration options for every SDK. */
export interface CoreOptions<TO extends BaseTransportOptions = BaseTransportOptions> extends Pick<Partial<ClientOptions<TO>>, Exclude<keyof Partial<ClientOptions<TO>>, 'integrations' | 'transport' | 'stackParser'>> {
/**
* If this is set to false, default integrations will not be added, otherwise this will internally be set to the
* recommended default integrations.
*/
defaultIntegrations?: false | Integration[];
/**
* List of integrations that should be installed after SDK was initialized.
* Accepts either a list of integrations or a function that receives
* default integrations and returns a new, updated list.
*/
integrations?: Integration[] | ((integrations: Integration[]) => Integration[]);
/**
* A function that takes transport options and returns the Transport object which is used to send events to Sentry.
* The function is invoked internally during SDK initialization.
* By default, the SDK initializes its default transports.
*/
transport?: (transportOptions: TO) => Transport;
/**
* A stack parser implementation or an array of stack line parsers
* By default, a stack parser is supplied for all supported browsers
*/
stackParser?: StackParser | StackLineParser[];
}
export {};
//# sourceMappingURL=options.d.ts.map

View File

@@ -0,0 +1,3 @@
import type { Coordinates, ClientRect } from '../../types';
export declare function createRectAdjustmentFn(modifier: number): (rect: ClientRect, ...adjustments: Coordinates[]) => ClientRect;
export declare const getAdjustedRect: (rect: ClientRect, ...adjustments: Coordinates[]) => ClientRect;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/Hidden/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,OAAO,KAAoB,MAAM,OAAO,CAAA;AAkCxC,eAAO,MAAM,WAAW,4BAAsC,CAAA"}

View File

@@ -0,0 +1,200 @@
import { trace, TraceFlags, context, SpanKind } from '@opentelemetry/api';
import { PrismaInstrumentation } from '@prisma/instrumentation';
import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, consoleSandbox } from '@sentry/core';
import { generateInstrumentOnce } from '@sentry/node-core';
const INTEGRATION_NAME = 'Prisma';
function isPrismaV6TracingHelper(helper) {
return !!helper && typeof helper === 'object' && 'dispatchEngineSpans' in helper;
}
function getPrismaTracingHelper() {
const prismaInstrumentationObject = (globalThis ).PRISMA_INSTRUMENTATION;
const prismaTracingHelper =
prismaInstrumentationObject &&
typeof prismaInstrumentationObject === 'object' &&
'helper' in prismaInstrumentationObject
? prismaInstrumentationObject.helper
: undefined;
return prismaTracingHelper;
}
class SentryPrismaInteropInstrumentation extends PrismaInstrumentation {
constructor(options) {
super(options?.instrumentationConfig);
}
enable() {
super.enable();
// The PrismaIntegration (super class) defines a global variable `global["PRISMA_INSTRUMENTATION"]` when `enable()` is called. This global variable holds a "TracingHelper" which Prisma uses internally to create tracing data. It's their way of not depending on OTEL with their main package. The sucky thing is, prisma broke the interface of the tracing helper with the v6 major update. This means that if you use Prisma 5 with the v6 instrumentation (or vice versa) Prisma just blows up, because tries to call methods on the helper that no longer exist.
// Because we actually want to use the v6 instrumentation and not blow up in Prisma 5 user's faces, what we're doing here is backfilling the v5 method (`createEngineSpan`) with a noop so that no longer crashes when it attempts to call that function.
const prismaTracingHelper = getPrismaTracingHelper();
if (isPrismaV6TracingHelper(prismaTracingHelper)) {
// Inspired & adjusted from https://github.com/prisma/prisma/tree/5.22.0/packages/instrumentation
(prismaTracingHelper ).createEngineSpan = (
engineSpanEvent,
) => {
const tracer = trace.getTracer('prismaV5Compatibility') ;
// Prisma v5 relies on being able to create spans with a specific span & trace ID
// this is no longer possible in OTEL v2, there is no public API to do this anymore
// So in order to kind of hack this possibility, we rely on the internal `_idGenerator` property
// This is used to generate the random IDs, and we overwrite this temporarily to generate static IDs
// This is flawed and may not work, e.g. if the code is bundled and the private property is renamed
// in such cases, these spans will not be captured and some Prisma spans will be missing
const initialIdGenerator = tracer._idGenerator;
if (!initialIdGenerator) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
'[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!',
);
});
return;
}
try {
engineSpanEvent.spans.forEach(engineSpan => {
const kind = engineSpanKindToOTELSpanKind(engineSpan.kind);
const parentSpanId = engineSpan.parent_span_id;
const spanId = engineSpan.span_id;
const traceId = engineSpan.trace_id;
const links = engineSpan.links?.map(link => {
return {
context: {
traceId: link.trace_id,
spanId: link.span_id,
traceFlags: TraceFlags.SAMPLED,
},
};
});
const ctx = trace.setSpanContext(context.active(), {
traceId,
spanId: parentSpanId,
traceFlags: TraceFlags.SAMPLED,
});
context.with(ctx, () => {
const temporaryIdGenerator = {
generateTraceId: () => {
return traceId;
},
generateSpanId: () => {
return spanId;
},
};
tracer._idGenerator = temporaryIdGenerator;
const span = tracer.startSpan(engineSpan.name, {
kind,
links,
startTime: engineSpan.start_time,
attributes: engineSpan.attributes,
});
span.end(engineSpan.end_time);
tracer._idGenerator = initialIdGenerator;
});
});
} finally {
// Ensure we always restore this at the end, even if something errors
tracer._idGenerator = initialIdGenerator;
}
};
}
}
}
function engineSpanKindToOTELSpanKind(engineSpanKind) {
switch (engineSpanKind) {
case 'client':
return SpanKind.CLIENT;
case 'internal':
default: // Other span kinds aren't currently supported
return SpanKind.INTERNAL;
}
}
const instrumentPrisma = generateInstrumentOnce(INTEGRATION_NAME, options => {
return new SentryPrismaInteropInstrumentation(options);
});
/**
* Adds Sentry tracing instrumentation for the [prisma](https://www.npmjs.com/package/prisma) library.
* For more information, see the [`prismaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/).
*
* NOTE: By default, this integration works with Prisma version 6.
* To get performance instrumentation for other Prisma versions,
* 1. Install the `@prisma/instrumentation` package with the desired version.
* 1. Pass a `new PrismaInstrumentation()` instance as exported from `@prisma/instrumentation` to the `prismaInstrumentation` option of this integration:
*
* ```js
* import { PrismaInstrumentation } from '@prisma/instrumentation'
*
* Sentry.init({
* integrations: [
* prismaIntegration({
* // Override the default instrumentation that Sentry uses
* prismaInstrumentation: new PrismaInstrumentation()
* })
* ]
* })
* ```
*
* The passed instrumentation instance will override the default instrumentation instance the integration would use, while the `prismaIntegration` will still ensure data compatibility for the various Prisma versions.
* 1. Depending on your Prisma version (prior to version 6), add `previewFeatures = ["tracing"]` to the client generator block of your Prisma schema:
*
* ```
* generator client {
* provider = "prisma-client-js"
* previewFeatures = ["tracing"]
* }
* ```
*/
const prismaIntegration = defineIntegration((options) => {
return {
name: INTEGRATION_NAME,
setupOnce() {
instrumentPrisma(options);
},
setup(client) {
// If no tracing helper exists, we skip any work here
// this means that prisma is not being used
if (!getPrismaTracingHelper()) {
return;
}
client.on('spanStart', span => {
const spanJSON = spanToJSON(span);
if (spanJSON.description?.startsWith('prisma:')) {
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.prisma');
}
// Make sure we use the query text as the span name, for ex. SELECT * FROM "User" WHERE "id" = $1
if (spanJSON.description === 'prisma:engine:db_query' && spanJSON.data['db.query.text']) {
span.updateName(spanJSON.data['db.query.text'] );
}
// In Prisma v5.22+, the `db.system` attribute is automatically set
// On older versions, this is missing, so we add it here
if (spanJSON.description === 'prisma:engine:db_query' && !spanJSON.data['db.system']) {
span.setAttribute('db.system', 'prisma');
}
});
},
};
});
export { instrumentPrisma, prismaIntegration };
//# sourceMappingURL=prisma.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/mysql-core/columns/varchar.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyMySqlTable } from '~/mysql-core/table.ts';\nimport { getColumnNameAndConfig, type Writable } from '~/utils.ts';\nimport { MySqlColumn, MySqlColumnBuilder } from './common.ts';\n\nexport type MySqlVarCharBuilderInitial<\n\tTName extends string,\n\tTEnum extends [string, ...string[]],\n\tTLength extends number | undefined,\n> = MySqlVarCharBuilder<\n\t{\n\t\tname: TName;\n\t\tdataType: 'string';\n\t\tcolumnType: 'MySqlVarChar';\n\t\tdata: TEnum[number];\n\t\tdriverParam: number | string;\n\t\tenumValues: TEnum;\n\t\tlength: TLength;\n\t}\n>;\n\nexport class MySqlVarCharBuilder<\n\tT extends ColumnBuilderBaseConfig<'string', 'MySqlVarChar'> & { length?: number | undefined },\n> extends MySqlColumnBuilder<T, MySqlVarCharConfig<T['enumValues'], T['length']>> {\n\tstatic override readonly [entityKind]: string = 'MySqlVarCharBuilder';\n\n\t/** @internal */\n\tconstructor(name: T['name'], config: MySqlVarCharConfig<T['enumValues'], T['length']>) {\n\t\tsuper(name, 'string', 'MySqlVarChar');\n\t\tthis.config.length = config.length;\n\t\tthis.config.enum = config.enum;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyMySqlTable<{ name: TTableName }>,\n\t): MySqlVarChar<MakeColumnConfig<T, TTableName> & { length: T['length']; enumValues: T['enumValues'] }> {\n\t\treturn new MySqlVarChar<MakeColumnConfig<T, TTableName> & { length: T['length']; enumValues: T['enumValues'] }>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class MySqlVarChar<T extends ColumnBaseConfig<'string', 'MySqlVarChar'> & { length?: number | undefined }>\n\textends MySqlColumn<T, MySqlVarCharConfig<T['enumValues'], T['length']>, { length: T['length'] }>\n{\n\tstatic override readonly [entityKind]: string = 'MySqlVarChar';\n\n\treadonly length: number | undefined = this.config.length;\n\n\toverride readonly enumValues = this.config.enum;\n\n\tgetSQLType(): string {\n\t\treturn this.length === undefined ? `varchar` : `varchar(${this.length})`;\n\t}\n}\n\nexport interface MySqlVarCharConfig<\n\tTEnum extends string[] | readonly string[] | undefined = string[] | readonly string[] | undefined,\n\tTLength extends number | undefined = number | undefined,\n> {\n\tenum?: TEnum;\n\tlength: TLength;\n}\n\nexport function varchar<U extends string, T extends Readonly<[U, ...U[]]>, L extends number | undefined>(\n\tconfig: MySqlVarCharConfig<T | Writable<T>, L>,\n): MySqlVarCharBuilderInitial<'', Writable<T>, L>;\nexport function varchar<\n\tTName extends string,\n\tU extends string,\n\tT extends Readonly<[U, ...U[]]>,\n\tL extends number | undefined,\n>(\n\tname: TName,\n\tconfig: MySqlVarCharConfig<T | Writable<T>, L>,\n): MySqlVarCharBuilderInitial<TName, Writable<T>, L>;\nexport function varchar(a?: string | MySqlVarCharConfig, b?: MySqlVarCharConfig): any {\n\tconst { name, config } = getColumnNameAndConfig<MySqlVarCharConfig>(a, b);\n\treturn new MySqlVarCharBuilder(name, config as any);\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B,SAAS,8BAA6C;AACtD,SAAS,aAAa,0BAA0B;AAkBzC,MAAM,4BAEH,mBAAwE;AAAA,EACjF,QAA0B,UAAU,IAAY;AAAA;AAAA,EAGhD,YAAY,MAAiB,QAA0D;AACtF,UAAM,MAAM,UAAU,cAAc;AACpC,SAAK,OAAO,SAAS,OAAO;AAC5B,SAAK,OAAO,OAAO,OAAO;AAAA,EAC3B;AAAA;AAAA,EAGS,MACR,OACuG;AACvG,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,qBACJ,YACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEvC,SAA6B,KAAK,OAAO;AAAA,EAEhC,aAAa,KAAK,OAAO;AAAA,EAE3C,aAAqB;AACpB,WAAO,KAAK,WAAW,SAAY,YAAY,WAAW,KAAK,MAAM;AAAA,EACtE;AACD;AAsBO,SAAS,QAAQ,GAAiC,GAA6B;AACrF,QAAM,EAAE,MAAM,OAAO,IAAI,uBAA2C,GAAG,CAAC;AACxE,SAAO,IAAI,oBAAoB,MAAM,MAAa;AACnD;","names":[]}

View File

@@ -0,0 +1,6 @@
import type { Event } from '../types-hoist/event';
/**
* Get a list of possible event messages from a Sentry event.
*/
export declare function getPossibleEventMessages(event: Event): string[];
//# sourceMappingURL=eventUtils.d.ts.map

View File

@@ -0,0 +1,581 @@
# cosmiconfig
[![Build Status](https://img.shields.io/travis/davidtheclark/cosmiconfig/main.svg?label=unix%20build)](https://travis-ci.org/davidtheclark/cosmiconfig) [![Build status](https://img.shields.io/appveyor/ci/davidtheclark/cosmiconfig/main.svg?label=windows%20build)](https://ci.appveyor.com/project/davidtheclark/cosmiconfig/branch/main)
[![codecov](https://codecov.io/gh/davidtheclark/cosmiconfig/branch/main/graph/badge.svg)](https://codecov.io/gh/davidtheclark/cosmiconfig)
Cosmiconfig searches for and loads configuration for your program.
It features smart defaults based on conventional expectations in the JavaScript ecosystem.
But it's also flexible enough to search wherever you'd like to search, and load whatever you'd like to load.
By default, Cosmiconfig will start where you tell it to start and search up the directory tree for the following:
- a `package.json` property
- a JSON or YAML, extensionless "rc file"
- an "rc file" with the extensions `.json`, `.yaml`, `.yml`, `.js`, or `.cjs`
- any of the above two inside a `.config` subdirectory
- a `.config.js` or `.config.cjs` CommonJS module
For example, if your module's name is "myapp", cosmiconfig will search up the directory tree for configuration in the following places:
- a `myapp` property in `package.json`
- a `.myapprc` file in JSON or YAML format
- a `.myapprc.json`, `.myapprc.yaml`, `.myapprc.yml`, `.myapprc.js`, or `.myapprc.cjs` file
- a `myapprc`, `myapprc.json`, `myapprc.yaml`, `myapprc.yml`, `myapprc.js` or `myapprc.cjs` file inside a `.config` subdirectory`
- a `myapp.config.js` or `myapp.config.cjs` CommonJS module exporting an object
Cosmiconfig continues to search up the directory tree, checking each of these places in each directory, until it finds some acceptable configuration (or hits the home directory).
## Table of contents
- [Installation](#installation)
- [Usage](#usage)
- [Result](#result)
- [Asynchronous API](#asynchronous-api)
- [cosmiconfig()](#cosmiconfig-1)
- [explorer.search()](#explorersearch)
- [explorer.load()](#explorerload)
- [explorer.clearLoadCache()](#explorerclearloadcache)
- [explorer.clearSearchCache()](#explorerclearsearchcache)
- [explorer.clearCaches()](#explorerclearcaches)
- [Synchronous API](#synchronous-api)
- [cosmiconfigSync()](#cosmiconfigsync)
- [explorerSync.search()](#explorersyncsearch)
- [explorerSync.load()](#explorersyncload)
- [explorerSync.clearLoadCache()](#explorersyncclearloadcache)
- [explorerSync.clearSearchCache()](#explorersyncclearsearchcache)
- [explorerSync.clearCaches()](#explorersyncclearcaches)
- [cosmiconfigOptions](#cosmiconfigoptions)
- [searchPlaces](#searchplaces)
- [loaders](#loaders)
- [packageProp](#packageprop)
- [stopDir](#stopdir)
- [cache](#cache)
- [transform](#transform)
- [ignoreEmptySearchPlaces](#ignoreemptysearchplaces)
- [Caching](#caching)
- [Differences from rc](#differences-from-rc)
- [Contributing & Development](#contributing--development)
## Installation
```
npm install cosmiconfig
```
Tested in Node 10+.
## Usage
Create a Cosmiconfig explorer, then either `search` for or directly `load` a configuration file.
```js
const { cosmiconfig, cosmiconfigSync } = require('cosmiconfig');
// ...
const explorer = cosmiconfig(moduleName);
// Search for a configuration by walking up directories.
// See documentation for search, below.
explorer.search()
.then((result) => {
// result.config is the parsed configuration object.
// result.filepath is the path to the config file that was found.
// result.isEmpty is true if there was nothing to parse in the config file.
})
.catch((error) => {
// Do something constructive.
});
// Load a configuration directly when you know where it should be.
// The result object is the same as for search.
// See documentation for load, below.
explorer.load(pathToConfig).then(..);
// You can also search and load synchronously.
const explorerSync = cosmiconfigSync(moduleName);
const searchedFor = explorerSync.search();
const loaded = explorerSync.load(pathToConfig);
```
## Result
The result object you get from `search` or `load` has the following properties:
- **config:** The parsed configuration object. `undefined` if the file is empty.
- **filepath:** The path to the configuration file that was found.
- **isEmpty:** `true` if the configuration file is empty. This property will not be present if the configuration file is not empty.
## Asynchronous API
### cosmiconfig()
```js
const { cosmiconfig } = require('cosmiconfig');
const explorer = cosmiconfig(moduleName[, cosmiconfigOptions])
```
Creates a cosmiconfig instance ("explorer") configured according to the arguments, and initializes its caches.
#### moduleName
Type: `string`. **Required.**
Your module name. This is used to create the default [`searchPlaces`] and [`packageProp`].
If your [`searchPlaces`] value will include files, as it does by default (e.g. `${moduleName}rc`), your `moduleName` must consist of characters allowed in filenames. That means you should not copy scoped package names, such as `@my-org/my-package`, directly into `moduleName`.
**[`cosmiconfigOptions`] are documented below.**
You may not need them, and should first read about the functions you'll use.
### explorer.search()
```js
explorer.search([searchFrom]).then(result => {..})
```
Searches for a configuration file. Returns a Promise that resolves with a [result] or with `null`, if no configuration file is found.
You can do the same thing synchronously with [`explorerSync.search()`].
Let's say your module name is `goldengrahams` so you initialized with `const explorer = cosmiconfig('goldengrahams');`.
Here's how your default [`search()`] will work:
- Starting from `process.cwd()` (or some other directory defined by the `searchFrom` argument to [`search()`]), look for configuration objects in the following places:
1. A `goldengrahams` property in a `package.json` file.
2. A `.goldengrahamsrc` file with JSON or YAML syntax.
3. A `.goldengrahamsrc.json`, `.goldengrahamsrc.yaml`, `.goldengrahamsrc.yml`, `.goldengrahamsrc.js`, or `.goldengrahamsrc.cjs` file.
4. A `goldengrahamsrc`, `goldengrahamsrc.json`, `goldengrahamsrc.yaml`, `goldengrahamsrc.yml`, `goldengrahamsrc.js`, or `goldengrahamsrc.cjs` file in the `.config` subdirectory.
5. A `goldengrahams.config.js` or `goldengrahams.config.cjs` CommonJS module exporting the object.
- If none of those searches reveal a configuration object, move up one directory level and try again.
So the search continues in `./`, `../`, `../../`, `../../../`, etc., checking the same places in each directory.
- Continue searching until arriving at your home directory (or some other directory defined by the cosmiconfig option [`stopDir`]).
- If at any point a parsable configuration is found, the [`search()`] Promise resolves with its [result] \(or, with [`explorerSync.search()`], the [result] is returned).
- If no configuration object is found, the [`search()`] Promise resolves with `null` (or, with [`explorerSync.search()`], `null` is returned).
- If a configuration object is found *but is malformed* (causing a parsing error), the [`search()`] Promise rejects with that error (so you should `.catch()` it). (Or, with [`explorerSync.search()`], the error is thrown.)
**If you know exactly where your configuration file should be, you can use [`load()`], instead.**
**The search process is highly customizable.**
Use the cosmiconfig options [`searchPlaces`] and [`loaders`] to precisely define where you want to look for configurations and how you want to load them.
#### searchFrom
Type: `string`.
Default: `process.cwd()`.
A filename.
[`search()`] will start its search here.
If the value is a directory, that's where the search starts.
If it's a file, the search starts in that file's directory.
### explorer.load()
```js
explorer.load(loadPath).then(result => {..})
```
Loads a configuration file. Returns a Promise that resolves with a [result] or rejects with an error (if the file does not exist or cannot be loaded).
Use `load` if you already know where the configuration file is and you just need to load it.
```js
explorer.load('load/this/file.json'); // Tries to load load/this/file.json.
```
If you load a `package.json` file, the result will be derived from whatever property is specified as your [`packageProp`].
You can do the same thing synchronously with [`explorerSync.load()`].
### explorer.clearLoadCache()
Clears the cache used in [`load()`].
### explorer.clearSearchCache()
Clears the cache used in [`search()`].
### explorer.clearCaches()
Performs both [`clearLoadCache()`] and [`clearSearchCache()`].
## Synchronous API
### cosmiconfigSync()
```js
const { cosmiconfigSync } = require('cosmiconfig');
const explorerSync = cosmiconfigSync(moduleName[, cosmiconfigOptions])
```
Creates a *synchronous* cosmiconfig instance ("explorerSync") configured according to the arguments, and initializes its caches.
See [`cosmiconfig()`].
### explorerSync.search()
```js
const result = explorerSync.search([searchFrom]);
```
Synchronous version of [`explorer.search()`].
Returns a [result] or `null`.
### explorerSync.load()
```js
const result = explorerSync.load(loadPath);
```
Synchronous version of [`explorer.load()`].
Returns a [result].
### explorerSync.clearLoadCache()
Clears the cache used in [`load()`].
### explorerSync.clearSearchCache()
Clears the cache used in [`search()`].
### explorerSync.clearCaches()
Performs both [`clearLoadCache()`] and [`clearSearchCache()`].
## cosmiconfigOptions
Type: `Object`.
Possible options are documented below.
### searchPlaces
Type: `Array<string>`.
Default: See below.
An array of places that [`search()`] will check in each directory as it moves up the directory tree.
Each place is relative to the directory being searched, and the places are checked in the specified order.
**Default `searchPlaces`:**
```js
[
'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.js`,
`.${moduleName}rc.cjs`,
`.config/${moduleName}rc`,
`.config/${moduleName}rc.json`,
`.config/${moduleName}rc.yaml`,
`.config/${moduleName}rc.yml`,
`.config/${moduleName}rc.js`,
`.config/${moduleName}rc.cjs`,
`${moduleName}.config.js`,
`${moduleName}.config.cjs`,
]
```
Create your own array to search more, fewer, or altogether different places.
Every item in `searchPlaces` needs to have a loader in [`loaders`] that corresponds to its extension.
(Common extensions are covered by default loaders.)
Read more about [`loaders`] below.
`package.json` is a special value: When it is included in `searchPlaces`, Cosmiconfig will always parse it as JSON and load a property within it, not the whole file.
That property is defined with the [`packageProp`] option, and defaults to your module name.
Examples, with a module named `porgy`:
```js
// Disallow extensions on rc files:
[
'package.json',
'.porgyrc',
'porgy.config.js'
]
// ESLint searches for configuration in these places:
[
'.eslintrc.js',
'.eslintrc.yaml',
'.eslintrc.yml',
'.eslintrc.json',
'.eslintrc',
'package.json'
]
// Babel looks in fewer places:
[
'package.json',
'.babelrc'
]
// Maybe you want to look for a wide variety of JS flavors:
[
'porgy.config.js',
'porgy.config.mjs',
'porgy.config.ts',
'porgy.config.coffee'
]
// ^^ You will need to designate custom loaders to tell
// Cosmiconfig how to handle these special JS flavors.
// Look within a .config/ subdirectory of every searched directory:
[
'package.json',
'.porgyrc',
'.config/.porgyrc',
'.porgyrc.json',
'.config/.porgyrc.json'
]
```
### loaders
Type: `Object`.
Default: See below.
An object that maps extensions to the loader functions responsible for loading and parsing files with those extensions.
Cosmiconfig exposes its default loaders on a named export `defaultLoaders`.
**Default `loaders`:**
```js
const { defaultLoaders } = require('cosmiconfig');
console.log(Object.entries(defaultLoaders))
// [
// [ '.cjs', [Function: loadJs] ],
// [ '.js', [Function: loadJs] ],
// [ '.json', [Function: loadJson] ],
// [ '.yaml', [Function: loadYaml] ],
// [ '.yml', [Function: loadYaml] ],
// [ 'noExt', [Function: loadYaml] ]
// ]
```
(YAML is a superset of JSON; which means YAML parsers can parse JSON; which is how extensionless files can be either YAML *or* JSON with only one parser.)
**If you provide a `loaders` object, your object will be *merged* with the defaults.**
So you can override one or two without having to override them all.
**Keys in `loaders`** are extensions (starting with a period), or `noExt` to specify the loader for files *without* extensions, like `.myapprc`.
**Values in `loaders`** are a loader function (described below) whose values are loader functions.
**The most common use case for custom loaders value is to load extensionless `rc` files as strict JSON**, instead of JSON *or* YAML (the default).
To accomplish that, provide the following `loaders` value:
```js
{
noExt: defaultLoaders['.json']
}
```
If you want to load files that are not handled by the loader functions Cosmiconfig exposes, you can write a custom loader function or use one from NPM if it exists.
**Third-party loaders:**
- [cosmiconfig-typescript-loader](https://github.com/codex-/cosmiconfig-typescript-loader)
**Use cases for custom loader function:**
- Allow configuration syntaxes that aren't handled by Cosmiconfig's defaults, like JSON5, INI, or XML.
- Allow ES2015 modules from `.mjs` configuration files.
- Parse JS files with Babel before deriving the configuration.
**Custom loader functions** have the following signature:
```js
// Sync
(filepath: string, content: string) => Object | null
// Async
(filepath: string, content: string) => Object | null | Promise<Object | null>
```
Cosmiconfig reads the file when it checks whether the file exists, so it will provide you with both the file's path and its content.
Do whatever you need to, and return either a configuration object or `null` (or, for async-only loaders, a Promise that resolves with one of those).
`null` indicates that no real configuration was found and the search should continue.
A few things to note:
- If you use a custom loader, be aware of whether it's sync or async: you cannot use async customer loaders with the sync API ([`cosmiconfigSync()`]).
- **Special JS syntax can also be handled by using a `require` hook**, because `defaultLoaders['.js']` just uses `require`.
Whether you use custom loaders or a `require` hook is up to you.
Examples:
```js
// Allow JSON5 syntax:
{
'.json': json5Loader
}
// Allow a special configuration syntax of your own creation:
{
'.special': specialLoader
}
// Allow many flavors of JS, using custom loaders:
{
'.mjs': esmLoader,
'.ts': typeScriptLoader,
'.coffee': coffeeScriptLoader
}
// Allow many flavors of JS but rely on require hooks:
{
'.mjs': defaultLoaders['.js'],
'.ts': defaultLoaders['.js'],
'.coffee': defaultLoaders['.js']
}
```
### packageProp
Type: `string | Array<string>`.
Default: `` `${moduleName}` ``.
Name of the property in `package.json` to look for.
Use a period-delimited string or an array of strings to describe a path to nested properties.
For example, the value `'configs.myPackage'` or `['configs', 'myPackage']` will get you the `"myPackage"` value in a `package.json` like this:
```json
{
"configs": {
"myPackage": {..}
}
}
```
If nested property names within the path include periods, you need to use an array of strings. For example, the value `['configs', 'foo.bar', 'baz']` will get you the `"baz"` value in a `package.json` like this:
```json
{
"configs": {
"foo.bar": {
"baz": {..}
}
}
}
```
If a string includes period but corresponds to a top-level property name, it will not be interpreted as a period-delimited path. For example, the value `'one.two'` will get you the `"three"` value in a `package.json` like this:
```json
{
"one.two": "three",
"one": {
"two": "four"
}
}
```
### stopDir
Type: `string`.
Default: Absolute path to your home directory.
Directory where the search will stop.
### cache
Type: `boolean`.
Default: `true`.
If `false`, no caches will be used.
Read more about ["Caching"](#caching) below.
### transform
Type: `(Result) => Promise<Result> | Result`.
A function that transforms the parsed configuration. Receives the [result].
If using [`search()`] or [`load()`] \(which are async), the transform function can return the transformed result or return a Promise that resolves with the transformed result.
If using `cosmiconfigSync`, [`search()`] or [`load()`], the function must be synchronous and return the transformed result.
The reason you might use this option — instead of simply applying your transform function some other way — is that *the transformed result will be cached*. If your transformation involves additional filesystem I/O or other potentially slow processing, you can use this option to avoid repeating those steps every time a given configuration is searched or loaded.
### ignoreEmptySearchPlaces
Type: `boolean`.
Default: `true`.
By default, if [`search()`] encounters an empty file (containing nothing but whitespace) in one of the [`searchPlaces`], it will ignore the empty file and move on.
If you'd like to load empty configuration files, instead, set this option to `false`.
Why might you want to load empty configuration files?
If you want to throw an error, or if an empty configuration file means something to your program.
## Caching
As of v2, cosmiconfig uses caching to reduce the need for repetitious reading of the filesystem or expensive transforms. Every new cosmiconfig instance (created with `cosmiconfig()`) has its own caches.
To avoid or work around caching, you can do the following:
- Set the `cosmiconfig` option [`cache`] to `false`.
- Use the cache-clearing methods [`clearLoadCache()`], [`clearSearchCache()`], and [`clearCaches()`].
- Create separate instances of cosmiconfig (separate "explorers").
## Differences from [rc](https://github.com/dominictarr/rc)
[rc](https://github.com/dominictarr/rc) serves its focused purpose well. cosmiconfig differs in a few key ways — making it more useful for some projects, less useful for others:
- Looks for configuration in some different places: in a `package.json` property, an rc file, a `.config.js` file, and rc files with extensions.
- Built-in support for JSON, YAML, and CommonJS formats.
- Stops at the first configuration found, instead of finding all that can be found up the directory tree and merging them automatically.
- Options.
- Asynchronous by default (though can be run synchronously).
## Contributing & Development
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
And please do participate!
[result]: #result
[`load()`]: #explorerload
[`search()`]: #explorersearch
[`clearloadcache()`]: #explorerclearloadcache
[`clearsearchcache()`]: #explorerclearsearchcache
[`cosmiconfig()`]: #cosmiconfig
[`cosmiconfigSync()`]: #cosmiconfigsync
[`clearcaches()`]: #explorerclearcaches
[`packageprop`]: #packageprop
[`cache`]: #cache
[`stopdir`]: #stopdir
[`searchplaces`]: #searchplaces
[`loaders`]: #loaders
[`cosmiconfigoptions`]: #cosmiconfigoptions
[`explorerSync.search()`]: #explorersyncsearch
[`explorerSync.load()`]: #explorersyncload
[`explorer.search()`]: #explorersearch
[`explorer.load()`]: #explorerload

View File

@@ -0,0 +1,7 @@
import { ReplayContainer } from '../types';
/**
* Check whether a given request URL should be filtered out. This is so we
* don't log Sentry ingest requests.
*/
export declare function shouldFilterRequest(replay: ReplayContainer, url: string): boolean;
//# sourceMappingURL=shouldFilterRequest.d.ts.map

View File

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

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const TestTube = createLucideIcon("TestTube", [
["path", { d: "M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2", key: "125lnx" }],
["path", { d: "M8.5 2h7", key: "csnxdl" }],
["path", { d: "M14.5 16h-5", key: "1ox875" }]
]);
export { TestTube as default };
//# sourceMappingURL=test-tube.js.map

View File

@@ -0,0 +1,13 @@
Prism.languages.properties = {
'comment': /^[ \t]*[#!].*$/m,
'value': {
pattern: /(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,
lookbehind: true,
alias: 'attr-value'
},
'key': {
pattern: /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,
alias: 'attr-name'
},
'punctuation': /[=:]/
};

View File

@@ -0,0 +1,34 @@
/**
* Un-escape a string that has been escaped with {@link escape}.
*
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
* square-bracket escapes are removed, but not backslash escapes.
*
* For example, it will turn the string `'[*]'` into `*`, but it will not
* turn `'\\*'` into `'*'`, because `\` is a path separator in
* `windowsPathsNoEscape` mode.
*
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
* backslash escapes are removed.
*
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
* or unescaped.
*
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
* unescaped.
*/
export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
if (magicalBraces) {
return windowsPathsNoEscape ?
s.replace(/\[([^\/\\])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
.replace(/\\([^\/])/g, '$1');
}
return windowsPathsNoEscape ?
s.replace(/\[([^\/\\{}])\]/g, '$1')
: s
.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
.replace(/\\([^\/{}])/g, '$1');
};
//# sourceMappingURL=unescape.js.map

View File

@@ -0,0 +1,2 @@
module.exports = require('./dist/types').Pair
require('./dist/legacy-exports').warnFileDeprecation(__filename)

View File

@@ -0,0 +1 @@
Prism.languages.aspnet=Prism.languages.extend("markup",{"page-directive":{pattern:/<%\s*@.*%>/,alias:"tag",inside:{"page-directive":{pattern:/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,alias:"tag"},rest:Prism.languages.markup.tag.inside}},directive:{pattern:/<%.*%>/,alias:"tag",inside:{directive:{pattern:/<%\s*?[$=%#:]{0,2}|%>/,alias:"tag"},rest:Prism.languages.csharp}}}),Prism.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/,Prism.languages.insertBefore("inside","punctuation",{directive:Prism.languages.aspnet.directive},Prism.languages.aspnet.tag.inside["attr-value"]),Prism.languages.insertBefore("aspnet","comment",{"asp-comment":{pattern:/<%--[\s\S]*?--%>/,alias:["asp","comment"]}}),Prism.languages.insertBefore("aspnet",Prism.languages.javascript?"script":"tag",{"asp-script":{pattern:/(<script(?=.*runat=['"]?server\b)[^>]*>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,alias:["asp","script"],inside:Prism.languages.csharp||{}}});

View File

@@ -0,0 +1,25 @@
const { EOL } = require('os')
const getFirstRegexpMatchOrDefault = (text, regexp, defaultValue) => {
regexp.lastIndex = 0 // https://stackoverflow.com/a/11477448/4536543
let match = regexp.exec(text)
if (match !== null) {
return match[1]
} else {
return defaultValue
}
}
const DEFAULT_INDENT = ' '
const INDENT_REGEXP = /^([ \t]+)[^\s]/m
module.exports.detectIndent = text =>
getFirstRegexpMatchOrDefault(text, INDENT_REGEXP, DEFAULT_INDENT)
module.exports.DEFAULT_INDENT = DEFAULT_INDENT
const DEFAULT_EOL = EOL
const EOL_REGEXP = /(\r\n|\n|\r)/g
module.exports.detectEOL = text =>
getFirstRegexpMatchOrDefault(text, EOL_REGEXP, DEFAULT_EOL)
module.exports.DEFAULT_EOL = DEFAULT_EOL

View File

@@ -0,0 +1 @@
{"version":3,"file":"dashboards.js","names":[],"sources":["../../../../src/rest/commands/read/dashboards.ts"],"sourcesContent":["import type { DirectusDashboard } from '../../../schema/dashboard.js';\nimport type { ApplyQueryFields, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadDashboardOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusDashboard<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * List all dashboards that exist in Directus.\n * @param query The query parameters\n * @returns An array of up to limit dashboard objects. If no items are available, data will be an empty array.\n */\nexport const readDashboards =\n\t<Schema, const TQuery extends Query<Schema, DirectusDashboard<Schema>>>(\n\t\tquery?: TQuery,\n\t): RestCommand<ReadDashboardOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/dashboards`,\n\t\tparams: query ?? {},\n\t\tmethod: 'GET',\n\t});\n\n/**\n * List an existing dashboard by primary key.\n * @param key The primary key of the dashboard\n * @param query The query parameters\n * @returns Returns the requested dashboard object.\n * @throws Will throw if key is empty\n */\nexport const readDashboard =\n\t<Schema, const TQuery extends Query<Schema, DirectusDashboard<Schema>>>(\n\t\tkey: DirectusDashboard<Schema>['id'],\n\t\tquery?: TQuery,\n\t): RestCommand<ReadDashboardOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/dashboards/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"6DAgBA,MAAa,EAEX,QAEM,CACN,KAAM,cACN,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR,EASW,GAEX,EACA,SAGA,EAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,eAAe,IACrB,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR"}

View File

@@ -0,0 +1,68 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* @template T
* @template {Error} E
* @param {Iterable<T>} items initial items
* @param {number} concurrency number of items running in parallel
* @param {(item: T, push: (item: T) => void, callback: (err?: E) => void) => void} processor worker which pushes more items
* @param {(err?: E) => void} callback all items processed
* @returns {void}
*/
const processAsyncTree = (items, concurrency, processor, callback) => {
const queue = [...items];
if (queue.length === 0) return callback();
let processing = 0;
let finished = false;
let processScheduled = true;
/**
* @param {T} item item
*/
const push = (item) => {
queue.push(item);
if (!processScheduled && processing < concurrency) {
processScheduled = true;
process.nextTick(processQueue);
}
};
/**
* @param {E | null | undefined} err error
*/
const processorCallback = (err) => {
processing--;
if (err && !finished) {
finished = true;
callback(err);
return;
}
if (!processScheduled) {
processScheduled = true;
process.nextTick(processQueue);
}
};
const processQueue = () => {
if (finished) return;
while (processing < concurrency && queue.length > 0) {
processing++;
const item = /** @type {T} */ (queue.pop());
processor(item, push, processorCallback);
}
processScheduled = false;
if (queue.length === 0 && processing === 0 && !finished) {
finished = true;
callback();
}
};
processQueue();
};
module.exports = processAsyncTree;

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Pilcrow = createLucideIcon("Pilcrow", [
["path", { d: "M13 4v16", key: "8vvj80" }],
["path", { d: "M17 4v16", key: "7dpous" }],
["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
]);
export { Pilcrow as default };
//# sourceMappingURL=pilcrow.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"repeat.js","sources":["../../../src/icons/repeat.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Repeat\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTcgMiA0IDQtNCA0IiAvPgogIDxwYXRoIGQ9Ik0zIDExdi0xYTQgNCAwIDAgMSA0LTRoMTQiIC8+CiAgPHBhdGggZD0ibTcgMjItNC00IDQtNCIgLz4KICA8cGF0aCBkPSJNMjEgMTN2MWE0IDQgMCAwIDEtNCA0SDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/repeat\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 Repeat = createLucideIcon('Repeat', [\n ['path', { d: 'm17 2 4 4-4 4', key: 'nntrym' }],\n ['path', { d: 'M3 11v-1a4 4 0 0 1 4-4h14', key: '84bu3i' }],\n ['path', { d: 'm7 22-4-4 4-4', key: '1wqhfi' }],\n ['path', { d: 'M21 13v1a4 4 0 0 1-4 4H3', key: '1rx37r' }],\n]);\n\nexport default Repeat;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,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,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,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,CAC9C,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":"outgoingFetchRequest.d.ts","sourceRoot":"","sources":["../../../src/utils/outgoingFetchRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAwB,MAAM,cAAc,CAAC;AAUjE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAStF;;;;;GAKG;AAEH,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,aAAa,EACtB,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9C,IAAI,CAiEN;AAED,6DAA6D;AAC7D,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAsBhG;AAyBD,oDAAoD;AACpD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,MAAY,GAAG,MAAM,CAkBzE"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"RenderField.d.ts","sourceRoot":"","sources":["../../../src/forms/RenderFields/RenderField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,MAAM,OAAO,CAAA;AA2BzB,KAAK,gBAAgB,GAAG;IACtB,iBAAiB,EAAE,WAAW,CAAA;IAC9B,WAAW,EAAE,yBAAyB,CAAA;CACvC,GAAG,UAAU,GACZ,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,UAAU,GAAG,YAAY,CAAC,CAAA;AAEvE,wBAAgB,WAAW,CAAC,EAC1B,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,UAAU,GACX,EAAE,gBAAgB,0PA+FlB"}

View File

@@ -0,0 +1,98 @@
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {
checkReportMissingProp,
checkMissingProp,
reportMissingProp,
propertyInData,
noPropertyInData,
} from "../code"
import {_, str, nil, not, Name, Code} from "../../compile/codegen"
import {checkStrictMode} from "../../compile/util"
export type RequiredError = ErrorObject<
"required",
{missingProperty: string},
string[] | {$data: string}
>
const error: KeywordErrorDefinition = {
message: ({params: {missingProperty}}) => str`must have required property '${missingProperty}'`,
params: ({params: {missingProperty}}) => _`{missingProperty: ${missingProperty}}`,
}
const def: CodeKeywordDefinition = {
keyword: "required",
type: "object",
schemaType: "array",
$data: true,
error,
code(cxt: KeywordCxt) {
const {gen, schema, schemaCode, data, $data, it} = cxt
const {opts} = it
if (!$data && schema.length === 0) return
const useLoop = schema.length >= opts.loopRequired
if (it.allErrors) allErrorsMode()
else exitOnErrorMode()
if (opts.strictRequired) {
const props = cxt.parentSchema.properties
const {definedProperties} = cxt.it
for (const requiredKey of schema) {
if (props?.[requiredKey] === undefined && !definedProperties.has(requiredKey)) {
const schemaPath = it.schemaEnv.baseId + it.errSchemaPath
const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`
checkStrictMode(it, msg, it.opts.strictRequired)
}
}
}
function allErrorsMode(): void {
if (useLoop || $data) {
cxt.block$data(nil, loopAllRequired)
} else {
for (const prop of schema) {
checkReportMissingProp(cxt, prop)
}
}
}
function exitOnErrorMode(): void {
const missing = gen.let("missing")
if (useLoop || $data) {
const valid = gen.let("valid", true)
cxt.block$data(valid, () => loopUntilMissing(missing, valid))
cxt.ok(valid)
} else {
gen.if(checkMissingProp(cxt, schema, missing))
reportMissingProp(cxt, missing)
gen.else()
}
}
function loopAllRequired(): void {
gen.forOf("prop", schemaCode as Code, (prop) => {
cxt.setParams({missingProperty: prop})
gen.if(noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error())
})
}
function loopUntilMissing(missing: Name, valid: Name): void {
cxt.setParams({missingProperty: missing})
gen.forOf(
missing,
schemaCode as Code,
() => {
gen.assign(valid, propertyInData(gen, data, missing, opts.ownProperties))
gen.if(not(valid), () => {
cxt.error()
gen.break()
})
},
nil
)
}
},
}
export default def

View File

@@ -0,0 +1,25 @@
import { millisecondsInSecond } from "./constants.js";
/**
* @name secondsToMilliseconds
* @category Conversion Helpers
* @summary Convert seconds to milliseconds.
*
* @description
* Convert a number of seconds to a full number of milliseconds.
*
* @param seconds - The number of seconds to be converted
*
* @returns The number of seconds converted in milliseconds
*
* @example
* // Convert 2 seconds into milliseconds
* const result = secondsToMilliseconds(2)
* //=> 2000
*/
export function secondsToMilliseconds(seconds) {
return seconds * millisecondsInSecond;
}
// Fallback for modularized imports:
export default secondsToMilliseconds;

View File

@@ -0,0 +1,17 @@
// lib/types/utils.ts
var decoder = new TextDecoder();
var toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
var getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
var readInt32LE = (input, offset = 0) => getView(input, offset).getInt32(0, true);
var readUInt32LE = (input, offset = 0) => getView(input, offset).getUint32(0, true);
// lib/types/bmp.ts
var BMP = {
validate: (input) => toUTF8String(input, 0, 2) === "BM",
calculate: (input) => ({
height: Math.abs(readInt32LE(input, 22)),
width: readUInt32LE(input, 18)
})
};
export { BMP };

View File

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

View File

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

View File

@@ -0,0 +1,30 @@
import { endOfWeek } from "./endOfWeek.mjs";
/**
* @name endOfISOWeek
* @category ISO Week Helpers
* @summary Return the end of an ISO week for the given date.
*
* @description
* Return the end of an ISO week for the given date.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
*
* @returns The end of an ISO week
*
* @example
* // The end of an ISO week for 2 September 2014 11:55:00:
* const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Sun Sep 07 2014 23:59:59.999
*/
export function endOfISOWeek(date) {
return endOfWeek(date, { weekStartsOn: 1 });
}
// Fallback for modularized imports:
export default endOfISOWeek;

View File

@@ -0,0 +1,6 @@
import type { TFunction } from '@payloadcms/translations';
import { APIError } from './APIError.js';
export declare class UnauthorizedError extends APIError {
constructor(t?: TFunction);
}
//# sourceMappingURL=UnauthorizedError.d.ts.map

View File

@@ -0,0 +1,41 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Authors Ivan Kopeykin @vankop
*/
"use strict";
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./config/target").PlatformTargetProperties} PlatformTargetProperties */
const PLUGIN_NAME = "PlatformPlugin";
/**
* Should be used only for "target === false" or
* when you want to overwrite platform target properties
*/
class PlatformPlugin {
/**
* @param {Partial<PlatformTargetProperties>} platform target properties
*/
constructor(platform) {
/** @type {Partial<PlatformTargetProperties>} */
this.platform = platform;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.environment.tap(PLUGIN_NAME, () => {
compiler.platform = {
...compiler.platform,
...this.platform
};
});
}
}
module.exports = PlatformPlugin;

View File

@@ -0,0 +1,46 @@
"use strict";
exports.ISOWeekYearParser = void 0;
var _index = require("../../../startOfISOWeek.js");
var _index2 = require("../../../constructFrom.js");
var _Parser = require("../Parser.js");
var _utils = require("../utils.js");
// ISO week-numbering year
class ISOWeekYearParser extends _Parser.Parser {
priority = 130;
parse(dateString, token) {
if (token === "R") {
return (0, _utils.parseNDigitsSigned)(4, dateString);
}
return (0, _utils.parseNDigitsSigned)(token.length, dateString);
}
set(date, _flags, value) {
const firstWeekOfYear = (0, _index2.constructFrom)(date, 0);
firstWeekOfYear.setFullYear(value, 0, 4);
firstWeekOfYear.setHours(0, 0, 0, 0);
return (0, _index.startOfISOWeek)(firstWeekOfYear);
}
incompatibleTokens = [
"G",
"y",
"Y",
"u",
"Q",
"q",
"M",
"L",
"w",
"d",
"D",
"e",
"c",
"t",
"T",
];
}
exports.ISOWeekYearParser = ISOWeekYearParser;

View File

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

View File

@@ -0,0 +1,15 @@
import type * as errors from "./errors.js";
export interface $ZodConfig {
/** Custom error map. Overrides `config().localeError`. */
customError?: errors.$ZodErrorMap | undefined;
/** Localized error map. Lowest priority. */
localeError?: errors.$ZodErrorMap | undefined;
}
export const globalConfig: $ZodConfig = {};
export function config(config?: Partial<$ZodConfig>): $ZodConfig {
if (config) Object.assign(globalConfig, config);
return globalConfig;
}

View File

@@ -0,0 +1,121 @@
"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: /^((пр)?н\.?\s?е\.?)/i,
abbreviated: /^((пр)?н\.?\s?е\.?)/i,
wide: /^(преди новата ера|новата ера|нова ера)/i,
};
const parseEraPatterns = {
any: [/^п/i, /^н/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234](-?[врт]?o?)? тримес.?/i,
wide: /^[1234](-?[врт]?о?)? тримесечие/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchDayPatterns = {
narrow: /^[нпвсч]/i,
short: /^(нд|пн|вт|ср|чт|пт|сб)/i,
abbreviated: /^(нед|пон|вто|сря|чет|пет|съб)/i,
wide: /^(неделя|понеделник|вторник|сряда|четвъртък|петък|събота)/i,
};
const parseDayPatterns = {
narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
any: [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[ъб]/i],
};
const matchMonthPatterns = {
abbreviated: /^(яну|фев|мар|апр|май|юни|юли|авг|сеп|окт|ное|дек)/i,
wide: /^(януари|февруари|март|април|май|юни|юли|август|септември|октомври|ноември|декември)/i,
};
const parseMonthPatterns = {
any: [
/^я/i,
/^ф/i,
/^мар/i,
/^ап/i,
/^май/i,
/^юн/i,
/^юл/i,
/^ав/i,
/^се/i,
/^окт/i,
/^но/i,
/^де/i,
],
};
const matchDayPeriodPatterns = {
any: /^(преди о|след о|в по|на о|през|веч|сут|следо)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^преди о/i,
pm: /^след о/i,
midnight: /^в пол/i,
noon: /^на об/i,
morning: /^сут/i,
afternoon: /^следо/i,
evening: /^веч/i,
night: /^през н/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,135 @@
'use strict'
const os = require('node:os')
const { join } = require('node:path')
const { readFile } = require('node:fs').promises
const { watchFileCreated, file } = require('../helper')
const { test } = require('tap')
const pino = require('../../')
const { DEFAULT_LEVELS } = require('../../lib/constants')
const { pid } = process
const hostname = os.hostname()
test('pino.transport with a pipeline', async ({ same, teardown }) => {
const destination = file()
const transport = pino.transport({
pipeline: [{
target: join(__dirname, '..', 'fixtures', 'transport-transform.js')
}, {
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination }
}]
})
teardown(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destination)
const result = JSON.parse(await readFile(destination))
delete result.time
same(result, {
pid,
hostname,
level: DEFAULT_LEVELS.info,
msg: 'hello',
service: 'pino' // this property was added by the transform
})
})
test('pino.transport with targets containing pipelines', async ({ same, teardown }) => {
const destinationA = file()
const destinationB = file()
const transport = pino.transport({
targets: [
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination: destinationA }
},
{
pipeline: [
{
target: join(__dirname, '..', 'fixtures', 'transport-transform.js')
},
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination: destinationB }
}
]
}
]
})
teardown(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destinationA)
await watchFileCreated(destinationB)
const resultA = JSON.parse(await readFile(destinationA))
const resultB = JSON.parse(await readFile(destinationB))
delete resultA.time
delete resultB.time
same(resultA, {
pid,
hostname,
level: DEFAULT_LEVELS.info,
msg: 'hello'
})
same(resultB, {
pid,
hostname,
level: DEFAULT_LEVELS.info,
msg: 'hello',
service: 'pino' // this property was added by the transform
})
})
test('pino.transport with targets containing pipelines with levels defined and dedupe', async ({ same, teardown }) => {
const destinationA = file()
const destinationB = file()
const transport = pino.transport({
targets: [
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination: destinationA },
level: DEFAULT_LEVELS.info
},
{
pipeline: [
{
target: join(__dirname, '..', 'fixtures', 'transport-transform.js')
},
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination: destinationB }
}
],
level: DEFAULT_LEVELS.error
}
],
dedupe: true
})
teardown(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello info')
instance.error('hello error')
await watchFileCreated(destinationA)
await watchFileCreated(destinationB)
const resultA = JSON.parse(await readFile(destinationA))
const resultB = JSON.parse(await readFile(destinationB))
delete resultA.time
delete resultB.time
same(resultA, {
pid,
hostname,
level: DEFAULT_LEVELS.info,
msg: 'hello info'
})
same(resultB, {
pid,
hostname,
level: DEFAULT_LEVELS.error,
msg: 'hello error',
service: 'pino' // this property was added by the transform
})
})

View File

@@ -0,0 +1 @@
{"version":3,"file":"TraceIdRatioBasedSampler.js","sourceRoot":"","sources":["../../../src/sampler/TraceIdRatioBasedSampler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAAoD;AACpD,wCAAuE;AAEvE,2FAA2F;AAC3F,MAAa,wBAAwB;IAClB,MAAM,CAAC;IAChB,WAAW,CAAS;IAE5B,YAAY,KAAK,GAAG,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;IAC1D,CAAC;IAED,YAAY,CAAC,OAAgB,EAAE,OAAe;QAC5C,OAAO;YACL,QAAQ,EACN,IAAA,oBAAc,EAAC,OAAO,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW;gBACrE,CAAC,CAAC,0BAAgB,CAAC,kBAAkB;gBACrC,CAAC,CAAC,0BAAgB,CAAC,UAAU;SAClC,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,OAAO,qBAAqB,IAAI,CAAC,MAAM,GAAG,CAAC;IAC7C,CAAC;IAEO,UAAU,CAAC,KAAa;QAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QACxD,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACjD,CAAC;IAEO,WAAW,CAAC,OAAe;QACjC,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC3C,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YAClB,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvD,YAAY,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;SAC5C;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AApCD,4DAoCC","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 { isValidTraceId } from '@opentelemetry/api';\nimport { Sampler, SamplingDecision, SamplingResult } from '../Sampler';\n\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nexport class TraceIdRatioBasedSampler implements Sampler {\n private readonly _ratio;\n private _upperBound: number;\n\n constructor(ratio = 0) {\n this._ratio = this._normalize(ratio);\n this._upperBound = Math.floor(this._ratio * 0xffffffff);\n }\n\n shouldSample(context: unknown, traceId: string): SamplingResult {\n return {\n decision:\n isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound\n ? SamplingDecision.RECORD_AND_SAMPLED\n : SamplingDecision.NOT_RECORD,\n };\n }\n\n toString(): string {\n return `TraceIdRatioBased{${this._ratio}}`;\n }\n\n private _normalize(ratio: number): number {\n if (typeof ratio !== 'number' || isNaN(ratio)) return 0;\n return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n }\n\n private _accumulate(traceId: string): number {\n let accumulation = 0;\n for (let i = 0; i < traceId.length / 8; i++) {\n const pos = i * 8;\n const part = parseInt(traceId.slice(pos, pos + 8), 16);\n accumulation = (accumulation ^ part) >>> 0;\n }\n return accumulation;\n }\n}\n"]}

View File

@@ -0,0 +1,5 @@
import type { KeywordDefinition } from "ajv";
export interface DefinitionOptions {
defaultMeta?: string | boolean;
}
export declare type GetDefinition<T extends KeywordDefinition> = (opts?: DefinitionOptions) => T;

View File

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

View File

@@ -0,0 +1,129 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["v.C.", "n.C."],
abbreviated: ["v.Chr.", "n.Chr."],
wide: ["voor Christus", "na Christus"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["1e kwartaal", "2e kwartaal", "3e kwartaal", "4e kwartaal"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"jan.",
"feb.",
"mrt.",
"apr.",
"mei",
"jun.",
"jul.",
"aug.",
"sep.",
"okt.",
"nov.",
"dec.",
],
wide: [
"januari",
"februari",
"maart",
"april",
"mei",
"juni",
"juli",
"augustus",
"september",
"oktober",
"november",
"december",
],
};
const dayValues = {
narrow: ["Z", "M", "D", "W", "D", "V", "Z"],
short: ["zo", "ma", "di", "wo", "do", "vr", "za"],
abbreviated: ["zon", "maa", "din", "woe", "don", "vri", "zat"],
wide: [
"zondag",
"maandag",
"dinsdag",
"woensdag",
"donderdag",
"vrijdag",
"zaterdag",
],
};
const dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "middernacht",
noon: "het middag",
morning: "'s ochtends",
afternoon: "'s namiddags",
evening: "'s avonds",
night: "'s nachts",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "middernacht",
noon: "het middag",
morning: "'s ochtends",
afternoon: "'s namiddags",
evening: "'s avonds",
night: "'s nachts",
},
wide: {
am: "AM",
pm: "PM",
midnight: "middernacht",
noon: "het middag",
morning: "'s ochtends",
afternoon: "'s namiddags",
evening: "'s avonds",
night: "'s nachts",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + "e";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
}),
};

View File

@@ -0,0 +1,5 @@
import type { StepNavItem } from './types.js';
export declare const SetStepNav: React.FC<{
nav: StepNavItem[];
}>;
//# sourceMappingURL=SetStepNav.d.ts.map

View File

@@ -0,0 +1,60 @@
'use strict';
// lib/types/utils.ts
var decoder = new TextDecoder();
var toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
var toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + `0${i.toString(16)}`.slice(-2), "");
var getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
var readInt16LE = (input, offset = 0) => getView(input, offset).getInt16(0, true);
var readUInt16BE = (input, offset = 0) => getView(input, offset).getUint16(0, false);
var readUInt16LE = (input, offset = 0) => getView(input, offset).getUint16(0, true);
var readUInt24LE = (input, offset = 0) => {
const view = getView(input, offset);
return view.getUint16(0, true) + (view.getUint8(2) << 16);
};
var readInt32LE = (input, offset = 0) => getView(input, offset).getInt32(0, true);
var readUInt32BE = (input, offset = 0) => getView(input, offset).getUint32(0, false);
var readUInt32LE = (input, offset = 0) => getView(input, offset).getUint32(0, true);
var readUInt64 = (input, offset, isBigEndian) => getView(input, offset).getBigUint64(0, !isBigEndian);
var methods = {
readUInt16BE,
readUInt16LE,
readUInt32BE,
readUInt32LE
};
function readUInt(input, bits, offset = 0, isBigEndian = false) {
const endian = isBigEndian ? "BE" : "LE";
const methodName = `readUInt${bits}${endian}`;
return methods[methodName](input, offset);
}
function readBox(input, offset) {
if (input.length - offset < 4) return;
const boxSize = readUInt32BE(input, offset);
if (input.length - offset < boxSize) return;
return {
name: toUTF8String(input, 4 + offset, 8 + offset),
offset,
size: boxSize
};
}
function findBox(input, boxName, currentOffset) {
while (currentOffset < input.length) {
const box = readBox(input, currentOffset);
if (!box) break;
if (box.name === boxName) return box;
currentOffset += box.size > 0 ? box.size : 8;
}
}
exports.findBox = findBox;
exports.readInt16LE = readInt16LE;
exports.readInt32LE = readInt32LE;
exports.readUInt = readUInt;
exports.readUInt16BE = readUInt16BE;
exports.readUInt16LE = readUInt16LE;
exports.readUInt24LE = readUInt24LE;
exports.readUInt32BE = readUInt32BE;
exports.readUInt32LE = readUInt32LE;
exports.readUInt64 = readUInt64;
exports.toHexString = toHexString;
exports.toUTF8String = toUTF8String;

View File

@@ -0,0 +1,38 @@
"use strict";
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function") return null;
var cacheBabelInterop = new WeakMap();
var cacheNodeInterop = new WeakMap();
return (_getRequireWildcardCache = function(nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) return obj;
if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) return cache.get(obj);
var newObj = { __proto__: null };
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key in obj) {
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
else newObj[key] = obj[key];
}
}
newObj.default = obj;
if (cache) cache.set(obj, newObj);
return newObj;
}
exports._ = _interop_require_wildcard;

View File

@@ -0,0 +1,121 @@
'use strict'
const hexify = char => {
const h = char.charCodeAt(0).toString(16).toUpperCase()
return '0x' + (h.length % 2 ? '0' : '') + h
}
const parseError = (e, txt, context) => {
if (!txt) {
return {
message: e.message + ' while parsing empty string',
position: 0,
}
}
const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i)
const errIdx = badToken ? +badToken[2]
: e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1
: null
const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${
JSON.stringify(badToken[1])
} (${hexify(badToken[1])})`)
: e.message
if (errIdx !== null && errIdx !== undefined) {
const start = errIdx <= context ? 0
: errIdx - context
const end = errIdx + context >= txt.length ? txt.length
: errIdx + context
const slice = (start === 0 ? '' : '...') +
txt.slice(start, end) +
(end === txt.length ? '' : '...')
const near = txt === slice ? '' : 'near '
return {
message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,
position: errIdx,
}
} else {
return {
message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,
position: 0,
}
}
}
class JSONParseError extends SyntaxError {
constructor (er, txt, context, caller) {
context = context || 20
const metadata = parseError(er, txt, context)
super(metadata.message)
Object.assign(this, metadata)
this.code = 'EJSONPARSE'
this.systemError = er
Error.captureStackTrace(this, caller || this.constructor)
}
get name () { return this.constructor.name }
set name (n) {}
get [Symbol.toStringTag] () { return this.constructor.name }
}
const kIndent = Symbol.for('indent')
const kNewline = Symbol.for('newline')
// only respect indentation if we got a line break, otherwise squash it
// things other than objects and arrays aren't indented, so ignore those
// Important: in both of these regexps, the $1 capture group is the newline
// or undefined, and the $2 capture group is the indent, or undefined.
const formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/
const emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/
const parseJson = (txt, reviver, context) => {
const parseText = stripBOM(txt)
context = context || 20
try {
// get the indentation so that we can save it back nicely
// if the file starts with {" then we have an indent of '', ie, none
// otherwise, pick the indentation of the next line after the first \n
// If the pattern doesn't match, then it means no indentation.
// JSON.stringify ignores symbols, so this is reasonably safe.
// if the string is '{}' or '[]', then use the default 2-space indent.
const [, newline = '\n', indent = ' '] = parseText.match(emptyRE) ||
parseText.match(formatRE) ||
[, '', '']
const result = JSON.parse(parseText, reviver)
if (result && typeof result === 'object') {
result[kNewline] = newline
result[kIndent] = indent
}
return result
} catch (e) {
if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) {
const isEmptyArray = Array.isArray(txt) && txt.length === 0
throw Object.assign(new TypeError(
`Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}`
), {
code: 'EJSONPARSE',
systemError: e,
})
}
throw new JSONParseError(e, parseText, context, parseJson)
}
}
// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
// because the buffer-to-string conversion in `fs.readFileSync()`
// translates it to FEFF, the UTF-16 BOM.
const stripBOM = txt => String(txt).replace(/^\uFEFF/, '')
module.exports = parseJson
parseJson.JSONParseError = JSONParseError
parseJson.noExceptions = (txt, reviver) => {
try {
return JSON.parse(stripBOM(txt), reviver)
} catch (e) {}
}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_t","require","_index","_visitors","_context","VISITOR_KEYS","traverseForScope","path","visitors","state","exploded","explode","enter","exit","Error","_traverse","parentPath","parent","node","container","key","listKey","hub","inPath","NodePath","get","_forceSetScope","call","visitor","type","visit","shouldSkip","keys","length","prop","Array","isArray","i","value"],"sources":["../../src/scope/traverseForScope.ts"],"sourcesContent":["import { VISITOR_KEYS } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { HubInterface, Visitor } from \"../index.ts\";\nimport { NodePath } from \"../index.ts\";\nimport { explode } from \"../visitors.ts\";\nimport { _forceSetScope } from \"../path/context.ts\";\n\nexport default function traverseForScope(\n path: NodePath,\n visitors: Visitor,\n state: any,\n) {\n const exploded = explode(visitors);\n\n if (exploded.enter || exploded.exit) {\n throw new Error(\"Should not be used with enter/exit visitors.\");\n }\n\n _traverse(\n path.parentPath,\n path.parent,\n path.node,\n path.container!,\n path.key!,\n path.listKey,\n path.hub,\n path,\n );\n\n function _traverse(\n parentPath: NodePath,\n parent: t.Node,\n node: t.Node,\n container: t.Node | t.Node[],\n key: string | number,\n listKey: string | null | undefined,\n hub?: HubInterface,\n inPath?: NodePath,\n ) {\n if (!node) {\n return;\n }\n\n const path =\n inPath ||\n NodePath.get({\n hub,\n parentPath,\n parent,\n container,\n listKey,\n key,\n });\n\n _forceSetScope.call(path);\n\n const visitor = exploded[node.type];\n if (visitor?.enter) {\n for (const visit of visitor.enter) {\n visit.call(state, path, state);\n }\n }\n\n if (path.shouldSkip) {\n return;\n }\n\n const keys = VISITOR_KEYS[node.type];\n if (!keys?.length) {\n return;\n }\n\n for (const key of keys) {\n // @ts-expect-error key must present in node\n const prop = node[key];\n if (!prop) continue;\n if (Array.isArray(prop)) {\n for (let i = 0; i < prop.length; i++) {\n const value = prop[i];\n _traverse(path, node, value, prop, i, key);\n }\n } else {\n _traverse(path, node, prop, node, key, null);\n }\n }\n\n if (visitor?.exit) {\n for (const visit of visitor.exit) {\n visit.call(state, path, state);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAAoD;EAL3CI;AAAY,IAAAL,EAAA;AAON,SAASM,gBAAgBA,CACtCC,IAAc,EACdC,QAAiB,EACjBC,KAAU,EACV;EACA,MAAMC,QAAQ,GAAG,IAAAC,iBAAO,EAACH,QAAQ,CAAC;EAElC,IAAIE,QAAQ,CAACE,KAAK,IAAIF,QAAQ,CAACG,IAAI,EAAE;IACnC,MAAM,IAAIC,KAAK,CAAC,8CAA8C,CAAC;EACjE;EAEAC,SAAS,CACPR,IAAI,CAACS,UAAU,EACfT,IAAI,CAACU,MAAM,EACXV,IAAI,CAACW,IAAI,EACTX,IAAI,CAACY,SAAS,EACdZ,IAAI,CAACa,GAAG,EACRb,IAAI,CAACc,OAAO,EACZd,IAAI,CAACe,GAAG,EACRf,IACF,CAAC;EAED,SAASQ,SAASA,CAChBC,UAAoB,EACpBC,MAAc,EACdC,IAAY,EACZC,SAA4B,EAC5BC,GAAoB,EACpBC,OAAkC,EAClCC,GAAkB,EAClBC,MAAiB,EACjB;IACA,IAAI,CAACL,IAAI,EAAE;MACT;IACF;IAEA,MAAMX,IAAI,GACRgB,MAAM,IACNC,eAAQ,CAACC,GAAG,CAAC;MACXH,GAAG;MACHN,UAAU;MACVC,MAAM;MACNE,SAAS;MACTE,OAAO;MACPD;IACF,CAAC,CAAC;IAEJM,uBAAc,CAACC,IAAI,CAACpB,IAAI,CAAC;IAEzB,MAAMqB,OAAO,GAAGlB,QAAQ,CAACQ,IAAI,CAACW,IAAI,CAAC;IACnC,IAAID,OAAO,YAAPA,OAAO,CAAEhB,KAAK,EAAE;MAClB,KAAK,MAAMkB,KAAK,IAAIF,OAAO,CAAChB,KAAK,EAAE;QACjCkB,KAAK,CAACH,IAAI,CAAClB,KAAK,EAAEF,IAAI,EAAEE,KAAK,CAAC;MAChC;IACF;IAEA,IAAIF,IAAI,CAACwB,UAAU,EAAE;MACnB;IACF;IAEA,MAAMC,IAAI,GAAG3B,YAAY,CAACa,IAAI,CAACW,IAAI,CAAC;IACpC,IAAI,EAACG,IAAI,YAAJA,IAAI,CAAEC,MAAM,GAAE;MACjB;IACF;IAEA,KAAK,MAAMb,GAAG,IAAIY,IAAI,EAAE;MAEtB,MAAME,IAAI,GAAGhB,IAAI,CAACE,GAAG,CAAC;MACtB,IAAI,CAACc,IAAI,EAAE;MACX,IAAIC,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,EAAE;QACvB,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,IAAI,CAACD,MAAM,EAAEI,CAAC,EAAE,EAAE;UACpC,MAAMC,KAAK,GAAGJ,IAAI,CAACG,CAAC,CAAC;UACrBtB,SAAS,CAACR,IAAI,EAAEW,IAAI,EAAEoB,KAAK,EAAEJ,IAAI,EAAEG,CAAC,EAAEjB,GAAG,CAAC;QAC5C;MACF,CAAC,MAAM;QACLL,SAAS,CAACR,IAAI,EAAEW,IAAI,EAAEgB,IAAI,EAAEhB,IAAI,EAAEE,GAAG,EAAE,IAAI,CAAC;MAC9C;IACF;IAEA,IAAIQ,OAAO,YAAPA,OAAO,CAAEf,IAAI,EAAE;MACjB,KAAK,MAAMiB,KAAK,IAAIF,OAAO,CAACf,IAAI,EAAE;QAChCiB,KAAK,CAACH,IAAI,CAAClB,KAAK,EAAEF,IAAI,EAAEE,KAAK,CAAC;MAChC;IACF;EACF;AACF","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"migrateFresh.d.ts","sourceRoot":"","sources":["../src/migrateFresh.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAKhD;;GAEG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,EAAE,kBAA0B,EAAE;;CAAA,GAC7B,OAAO,CAAC,IAAI,CAAC,CAoEf"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/versions/migrations/localizeStatus/sql/migrateMainGlobal.ts"],"sourcesContent":["import type { Payload } from '../../../../types/index.js'\n\nimport { toSnakeCase } from '../shared.js'\n\n/**\n * Migrates main global document from _status to per-locale status object\n */\nexport async function migrateMainGlobalStatus({\n db,\n globalSlug,\n locales,\n payload,\n sql,\n versionsTable,\n}: {\n db: any\n globalSlug: string\n locales: string[]\n payload: Payload\n sql: any\n versionsTable: string\n}): Promise<void> {\n const globalTable = toSnakeCase(globalSlug)\n const globalLocalesTable = `${globalTable}_locales`\n\n payload.logger.info({ msg: `Migrating main global locales for: ${globalLocalesTable}` })\n\n // For each locale, get the latest version status\n for (const locale of locales) {\n const latestVersionStatus = await db.execute({\n drizzle: db.drizzle,\n sql: sql`\n SELECT l.version__status as _status\n FROM ${sql.identifier(versionsTable)} v\n JOIN ${sql.raw(`${versionsTable}_locales`)} l ON l._parent_id = v.id\n WHERE l._locale = ${locale}\n ORDER BY v.created_at DESC\n LIMIT 1\n `,\n })\n\n const status = latestVersionStatus.rows[0]?._status || 'draft'\n\n // Get the global document ID from the globals table\n const globalDoc = await db.execute({\n drizzle: db.drizzle,\n sql: sql`\n SELECT id FROM ${sql.identifier(globalTable)} LIMIT 1\n `,\n })\n\n if (globalDoc.rows.length === 0) {\n payload.logger.warn({ msg: `No global document found for ${globalSlug}, skipping` })\n continue\n }\n\n const globalId = globalDoc.rows[0].id\n\n // Update the global's locales table with this status\n await db.execute({\n drizzle: db.drizzle,\n sql: sql`\n UPDATE ${sql.identifier(globalLocalesTable)}\n SET _status = ${status}\n WHERE _parent_id = ${globalId}\n AND _locale = ${locale}\n `,\n })\n }\n\n payload.logger.info({ msg: 'Migrated global document' })\n}\n"],"names":["toSnakeCase","migrateMainGlobalStatus","db","globalSlug","locales","payload","sql","versionsTable","globalTable","globalLocalesTable","logger","info","msg","locale","latestVersionStatus","execute","drizzle","identifier","raw","status","rows","_status","globalDoc","length","warn","globalId","id"],"mappings":"AAEA,SAASA,WAAW,QAAQ,eAAc;AAE1C;;CAEC,GACD,OAAO,eAAeC,wBAAwB,EAC5CC,EAAE,EACFC,UAAU,EACVC,OAAO,EACPC,OAAO,EACPC,GAAG,EACHC,aAAa,EAQd;IACC,MAAMC,cAAcR,YAAYG;IAChC,MAAMM,qBAAqB,GAAGD,YAAY,QAAQ,CAAC;IAEnDH,QAAQK,MAAM,CAACC,IAAI,CAAC;QAAEC,KAAK,CAAC,mCAAmC,EAAEH,oBAAoB;IAAC;IAEtF,iDAAiD;IACjD,KAAK,MAAMI,UAAUT,QAAS;QAC5B,MAAMU,sBAAsB,MAAMZ,GAAGa,OAAO,CAAC;YAC3CC,SAASd,GAAGc,OAAO;YACnBV,KAAKA,GAAG,CAAC;;aAEF,EAAEA,IAAIW,UAAU,CAACV,eAAe;aAChC,EAAED,IAAIY,GAAG,CAAC,GAAGX,cAAc,QAAQ,CAAC,EAAE;0BACzB,EAAEM,OAAO;;;MAG7B,CAAC;QACH;QAEA,MAAMM,SAASL,oBAAoBM,IAAI,CAAC,EAAE,EAAEC,WAAW;QAEvD,oDAAoD;QACpD,MAAMC,YAAY,MAAMpB,GAAGa,OAAO,CAAC;YACjCC,SAASd,GAAGc,OAAO;YACnBV,KAAKA,GAAG,CAAC;uBACQ,EAAEA,IAAIW,UAAU,CAACT,aAAa;MAC/C,CAAC;QACH;QAEA,IAAIc,UAAUF,IAAI,CAACG,MAAM,KAAK,GAAG;YAC/BlB,QAAQK,MAAM,CAACc,IAAI,CAAC;gBAAEZ,KAAK,CAAC,6BAA6B,EAAET,WAAW,UAAU,CAAC;YAAC;YAClF;QACF;QAEA,MAAMsB,WAAWH,UAAUF,IAAI,CAAC,EAAE,CAACM,EAAE;QAErC,qDAAqD;QACrD,MAAMxB,GAAGa,OAAO,CAAC;YACfC,SAASd,GAAGc,OAAO;YACnBV,KAAKA,GAAG,CAAC;eACA,EAAEA,IAAIW,UAAU,CAACR,oBAAoB;sBAC9B,EAAEU,OAAO;2BACJ,EAAEM,SAAS;sBAChB,EAAEZ,OAAO;MACzB,CAAC;QACH;IACF;IAEAR,QAAQK,MAAM,CAACC,IAAI,CAAC;QAAEC,KAAK;IAA2B;AACxD"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"user-check.js","sources":["../../../src/icons/user-check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UserCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgMjF2LTJhNCA0IDAgMCAwLTQtNEg2YTQgNCAwIDAgMC00IDR2MiIgLz4KICA8Y2lyY2xlIGN4PSI5IiBjeT0iNyIgcj0iNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSIxNiAxMSAxOCAxMyAyMiA5IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/user-check\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 UserCheck = createLucideIcon('UserCheck', [\n ['path', { d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2', key: '1yyitq' }],\n ['circle', { cx: '9', cy: '7', r: '4', key: 'nufk8' }],\n ['polyline', { points: '16 11 18 13 22 9', key: '1pwet4' }],\n]);\n\nexport default UserCheck;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1E,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAA,CAAA;AAAA,CAAA,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAoB,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;AAC5D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"handlePreview.d.ts","sourceRoot":"","sources":["../../src/utilities/handlePreview.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AAEhB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,wCAG1B;IACD,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,KAAG,OAQH,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,kEAOvB;IACD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,OAAO,CAAC;IACV,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAoCA,CAAA"}

View File

@@ -0,0 +1,12 @@
{
"type": "module",
"main": "index.cjs",
"module": "index.js",
"react-native": {
"./index.js": "./index.native.js"
},
"browser": {
"./index.js": "./index.browser.js",
"./index.cjs": "./index.browser.cjs"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"relationships-v2-v3.d.ts","sourceRoot":"","sources":["../../src/predefinedMigrations/relationships-v2-v3.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,OAAO,oFAAoF,CAAA;AACjG,QAAA,MAAM,KAAK,mLAMV,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA"}

View File

@@ -0,0 +1,65 @@
import { addNonEnumerableProperty } from '../utils/object.js';
import { GLOBAL_OBJ } from '../utils/worldwide.js';
const SCOPE_ON_START_SPAN_FIELD = '_sentryScope';
const ISOLATION_SCOPE_ON_START_SPAN_FIELD = '_sentryIsolationScope';
/** Wrap a scope with a WeakRef if available, falling back to a direct scope. */
function wrapScopeWithWeakRef(scope) {
try {
// @ts-expect-error - WeakRef is not available in all environments
const WeakRefClass = GLOBAL_OBJ.WeakRef;
if (typeof WeakRefClass === 'function') {
return new WeakRefClass(scope);
}
} catch {
// WeakRef not available or failed to create
// We'll fall back to a direct scope
}
return scope;
}
/** Try to unwrap a scope from a potential WeakRef wrapper. */
function unwrapScopeFromWeakRef(scopeRef) {
if (!scopeRef) {
return undefined;
}
if (typeof scopeRef === 'object' && 'deref' in scopeRef && typeof scopeRef.deref === 'function') {
try {
return scopeRef.deref();
} catch {
return undefined;
}
}
// Fallback to a direct scope
return scopeRef ;
}
/** Store the scope & isolation scope for a span, which can the be used when it is finished. */
function setCapturedScopesOnSpan(span, scope, isolationScope) {
if (span) {
addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, wrapScopeWithWeakRef(isolationScope));
// We don't wrap the scope with a WeakRef here because webkit aggressively garbage collects
// and scopes are not held in memory for long periods of time.
addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);
}
}
/**
* Grabs the scope and isolation scope off a span that were active when the span was started.
* If WeakRef was used and scopes have been garbage collected, returns undefined for those scopes.
*/
function getCapturedScopesOnSpan(span) {
const spanWithScopes = span ;
return {
scope: spanWithScopes[SCOPE_ON_START_SPAN_FIELD],
isolationScope: unwrapScopeFromWeakRef(spanWithScopes[ISOLATION_SCOPE_ON_START_SPAN_FIELD]),
};
}
export { getCapturedScopesOnSpan, setCapturedScopesOnSpan };
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getMachineId-darwin.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,wCAAwC,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM;aACzB,KAAK,CAAC,IAAI,CAAC;aACX,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC9B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC;KAC9C;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"]}

View File

@@ -0,0 +1,143 @@
import { getInteractionCount } from './polyfills/interactionCountPolyfill.js';
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// To prevent unnecessary memory usage on pages with lots of interactions,
// store at most 10 of the longest interactions to consider as INP candidates.
const MAX_INTERACTIONS_TO_CONSIDER = 10;
// Used to store the interaction count after a bfcache restore, since p98
// interaction latencies should only consider the current navigation.
let prevInteractionCount = 0;
/**
* Returns the interaction count since the last bfcache restore (or for the
* full page lifecycle if there were no bfcache restores).
*/
const getInteractionCountForNavigation = () => {
return getInteractionCount() - prevInteractionCount;
};
/**
*
*/
class InteractionManager {constructor() { InteractionManager.prototype.__init.call(this);InteractionManager.prototype.__init2.call(this); }
/**
* A list of longest interactions on the page (by latency) sorted so the
* longest one is first. The list is at most MAX_INTERACTIONS_TO_CONSIDER
* long.
*/
// eslint-disable-next-line @sentry-internal/sdk/no-class-field-initializers, @typescript-eslint/explicit-member-accessibility
__init() {this._longestInteractionList = [];}
/**
* A mapping of longest interactions by their interaction ID.
* This is used for faster lookup.
*/
// eslint-disable-next-line @sentry-internal/sdk/no-class-field-initializers, @typescript-eslint/explicit-member-accessibility
__init2() {this._longestInteractionMap = new Map();}
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility, jsdoc/require-jsdoc
_resetInteractions() {
prevInteractionCount = getInteractionCount();
this._longestInteractionList.length = 0;
this._longestInteractionMap.clear();
}
/**
* Returns the estimated p98 longest interaction based on the stored
* interaction candidates and the interaction count for the current page.
*/
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
_estimateP98LongestInteraction() {
const candidateInteractionIndex = Math.min(
this._longestInteractionList.length - 1,
Math.floor(getInteractionCountForNavigation() / 50),
);
return this._longestInteractionList[candidateInteractionIndex];
}
/**
* Takes a performance entry and adds it to the list of worst interactions
* if its duration is long enough to make it among the worst. If the
* entry is part of an existing interaction, it is merged and the latency
* and entries list is updated as needed.
*/
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
_processEntry(entry) {
this._onBeforeProcessingEntry?.(entry);
// Skip further processing for entries that cannot be INP candidates.
if (!(entry.interactionId || entry.entryType === 'first-input')) return;
// The least-long of the 10 longest interactions.
const minLongestInteraction = this._longestInteractionList.at(-1);
let interaction = this._longestInteractionMap.get(entry.interactionId);
// Only process the entry if it's possibly one of the ten longest,
// or if it's part of an existing interaction.
if (
interaction ||
this._longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER ||
// If the above conditions are false, `minLongestInteraction` will be set.
entry.duration > minLongestInteraction._latency
) {
// If the interaction already exists, update it. Otherwise create one.
if (interaction) {
// If the new entry has a longer duration, replace the old entries,
// otherwise add to the array.
if (entry.duration > interaction._latency) {
interaction.entries = [entry];
interaction._latency = entry.duration;
} else if (entry.duration === interaction._latency && entry.startTime === interaction.entries[0].startTime) {
interaction.entries.push(entry);
}
} else {
interaction = {
id: entry.interactionId,
entries: [entry],
_latency: entry.duration,
};
this._longestInteractionMap.set(interaction.id, interaction);
this._longestInteractionList.push(interaction);
}
// Sort the entries by latency (descending) and keep only the top ten.
this._longestInteractionList.sort((a, b) => b._latency - a._latency);
if (this._longestInteractionList.length > MAX_INTERACTIONS_TO_CONSIDER) {
const removedInteractions = this._longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER);
for (const interaction of removedInteractions) {
this._longestInteractionMap.delete(interaction.id);
}
}
// Call any post-processing on the interaction
this._onAfterProcessingINPCandidate?.(interaction);
}
}
}
export { InteractionManager };
//# sourceMappingURL=InteractionManager.js.map

View File

@@ -0,0 +1,8 @@
export * from "./blob.js";
export * from "./common.js";
export * from "./custom.js";
export * from "./integer.js";
export * from "./numeric.js";
export * from "./real.js";
export * from "./text.js";
//# sourceMappingURL=index.js.map

View File

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

View File

@@ -0,0 +1,342 @@
import { DEFAULT_ENVIRONMENT } from '../constants.js';
import { notifyEventProcessors } from '../eventProcessors.js';
import { Scope } from '../scope.js';
import { getFilenameToDebugIdMap } from './debug-ids.js';
import { uuid4, addExceptionMechanism } from './misc.js';
import { normalize } from './normalize.js';
import { getCombinedScopeData, applyScopeDataToEvent } from './scopeData.js';
import { truncate } from './string.js';
import { resolvedSyncPromise } from './syncpromise.js';
import { dateTimestampInSeconds } from './time.js';
/**
* This type makes sure that we get either a CaptureContext, OR an EventHint.
* It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:
* { user: { id: '123' }, mechanism: { handled: false } }
*/
/**
* Adds common information to events.
*
* The information includes release and environment from `options`,
* breadcrumbs and context (extra, tags and user) from the scope.
*
* Information that is already present in the event is never overwritten. For
* nested objects, such as the context, keys are merged.
*
* @param event The original event.
* @param hint May contain additional information about the original exception.
* @param scope A scope containing event metadata.
* @returns A new event with more information.
* @hidden
*/
function prepareEvent(
options,
event,
hint,
scope,
client,
isolationScope,
) {
const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;
const prepared = {
...event,
event_id: event.event_id || hint.event_id || uuid4(),
timestamp: event.timestamp || dateTimestampInSeconds(),
};
const integrations = hint.integrations || options.integrations.map(i => i.name);
applyClientOptions(prepared, options);
applyIntegrationsMetadata(prepared, integrations);
if (client) {
client.emit('applyFrameMetadata', event);
}
// Only put debug IDs onto frames for error events.
if (event.type === undefined) {
applyDebugIds(prepared, options.stackParser);
}
// If we have scope given to us, use it as the base for further modifications.
// This allows us to prevent unnecessary copying of data if `captureContext` is not provided.
const finalScope = getFinalScope(scope, hint.captureContext);
if (hint.mechanism) {
addExceptionMechanism(prepared, hint.mechanism);
}
const clientEventProcessors = client ? client.getEventProcessors() : [];
// This should be the last thing called, since we want that
// {@link Scope.addEventProcessor} gets the finished prepared event.
// Merge scope data together
const data = getCombinedScopeData(isolationScope, finalScope);
const attachments = [...(hint.attachments || []), ...data.attachments];
if (attachments.length) {
hint.attachments = attachments;
}
applyScopeDataToEvent(prepared, data);
const eventProcessors = [
...clientEventProcessors,
// Run scope event processors _after_ all other processors
...data.eventProcessors,
];
// Skip event processors for internal exceptions to prevent recursion
const isInternalException = hint.data && (hint.data ).__sentry__ === true;
const result = isInternalException
? resolvedSyncPromise(prepared)
: notifyEventProcessors(eventProcessors, prepared, hint);
return result.then(evt => {
if (evt) {
// We apply the debug_meta field only after all event processors have ran, so that if any event processors modified
// file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.
// This should not cause any PII issues, since we're only moving data that is already on the event and not adding
// any new data
applyDebugMeta(evt);
}
if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
}
return evt;
});
}
/**
* Enhances event using the client configuration.
* It takes care of all "static" values like environment, release and `dist`,
* as well as truncating overly long values.
*
* Only exported for tests.
*
* @param event event instance to be enhanced
*/
function applyClientOptions(event, options) {
const { environment, release, dist, maxValueLength } = options;
// empty strings do not make sense for environment, release, and dist
// so we handle them the same as if they were not provided
event.environment = event.environment || environment || DEFAULT_ENVIRONMENT;
if (!event.release && release) {
event.release = release;
}
if (!event.dist && dist) {
event.dist = dist;
}
const request = event.request;
if (request?.url && maxValueLength) {
request.url = truncate(request.url, maxValueLength);
}
if (maxValueLength) {
event.exception?.values?.forEach(exception => {
if (exception.value) {
// Truncates error messages
exception.value = truncate(exception.value, maxValueLength);
}
});
}
}
/**
* Puts debug IDs into the stack frames of an error event.
*/
function applyDebugIds(event, stackParser) {
// Build a map of filename -> debug_id
const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);
event.exception?.values?.forEach(exception => {
exception.stacktrace?.frames?.forEach(frame => {
if (frame.filename) {
frame.debug_id = filenameDebugIdMap[frame.filename];
}
});
});
}
/**
* Moves debug IDs from the stack frames of an error event into the debug_meta field.
*/
function applyDebugMeta(event) {
// Extract debug IDs and filenames from the stack frames on the event.
const filenameDebugIdMap = {};
event.exception?.values?.forEach(exception => {
exception.stacktrace?.frames?.forEach(frame => {
if (frame.debug_id) {
if (frame.abs_path) {
filenameDebugIdMap[frame.abs_path] = frame.debug_id;
} else if (frame.filename) {
filenameDebugIdMap[frame.filename] = frame.debug_id;
}
delete frame.debug_id;
}
});
});
if (Object.keys(filenameDebugIdMap).length === 0) {
return;
}
// Fill debug_meta information
event.debug_meta = event.debug_meta || {};
event.debug_meta.images = event.debug_meta.images || [];
const images = event.debug_meta.images;
Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => {
images.push({
type: 'sourcemap',
code_file: filename,
debug_id,
});
});
}
/**
* This function adds all used integrations to the SDK info in the event.
* @param event The event that will be filled with all integrations.
*/
function applyIntegrationsMetadata(event, integrationNames) {
if (integrationNames.length > 0) {
event.sdk = event.sdk || {};
event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];
}
}
/**
* Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.
* Normalized keys:
* - `breadcrumbs.data`
* - `user`
* - `contexts`
* - `extra`
* @param event Event
* @returns Normalized event
*/
function normalizeEvent(event, depth, maxBreadth) {
if (!event) {
return null;
}
const normalized = {
...event,
...(event.breadcrumbs && {
breadcrumbs: event.breadcrumbs.map(b => ({
...b,
...(b.data && {
data: normalize(b.data, depth, maxBreadth),
}),
})),
}),
...(event.user && {
user: normalize(event.user, depth, maxBreadth),
}),
...(event.contexts && {
contexts: normalize(event.contexts, depth, maxBreadth),
}),
...(event.extra && {
extra: normalize(event.extra, depth, maxBreadth),
}),
};
// event.contexts.trace stores information about a Transaction. Similarly,
// event.spans[] stores information about child Spans. Given that a
// Transaction is conceptually a Span, normalization should apply to both
// Transactions and Spans consistently.
// For now the decision is to skip normalization of Transactions and Spans,
// so this block overwrites the normalized event to add back the original
// Transaction information prior to normalization.
if (event.contexts?.trace && normalized.contexts) {
normalized.contexts.trace = event.contexts.trace;
// event.contexts.trace.data may contain circular/dangerous data so we need to normalize it
if (event.contexts.trace.data) {
normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);
}
}
// event.spans[].data may contain circular/dangerous data so we need to normalize it
if (event.spans) {
normalized.spans = event.spans.map(span => {
return {
...span,
...(span.data && {
data: normalize(span.data, depth, maxBreadth),
}),
};
});
}
// event.contexts.flags (FeatureFlagContext) stores context for our feature
// flag integrations. It has a greater nesting depth than our other typed
// Contexts, so we re-normalize with a fixed depth of 3 here. We do not want
// to skip this in case of conflicting, user-provided context.
if (event.contexts?.flags && normalized.contexts) {
normalized.contexts.flags = normalize(event.contexts.flags, 3, maxBreadth);
}
return normalized;
}
function getFinalScope(scope, captureContext) {
if (!captureContext) {
return scope;
}
const finalScope = scope ? scope.clone() : new Scope();
finalScope.update(captureContext);
return finalScope;
}
/**
* Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.
* This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.
*/
function parseEventHintOrCaptureContext(
hint,
) {
if (!hint) {
return undefined;
}
// If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext
if (hintIsScopeOrFunction(hint)) {
return { captureContext: hint };
}
if (hintIsScopeContext(hint)) {
return {
captureContext: hint,
};
}
return hint;
}
function hintIsScopeOrFunction(hint) {
return hint instanceof Scope || typeof hint === 'function';
}
const captureContextKeys = [
'user',
'level',
'extra',
'contexts',
'tags',
'fingerprint',
'propagationContext',
] ;
function hintIsScopeContext(hint) {
return Object.keys(hint).some(key => captureContextKeys.includes(key ));
}
export { applyClientOptions, applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };
//# sourceMappingURL=prepareEvent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/NoListResults/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAIrB,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAC3B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB,CAAA;AACD,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc,qBAajE"}

View File

@@ -0,0 +1,94 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* intersect creates Set containing the intersection of elements between all sets
* @template T
* @param {Set<T>[]} sets an array of sets being checked for shared elements
* @returns {Set<T>} returns a new Set containing the intersecting items
*/
const intersect = (sets) => {
if (sets.length === 0) return new Set();
if (sets.length === 1) return new Set(sets[0]);
let minSize = Infinity;
let minIndex = -1;
for (let i = 0; i < sets.length; i++) {
const size = sets[i].size;
if (size < minSize) {
minIndex = i;
minSize = size;
}
}
const current = new Set(sets[minIndex]);
for (let i = 0; i < sets.length; i++) {
if (i === minIndex) continue;
const set = sets[i];
for (const item of current) {
if (!set.has(item)) {
current.delete(item);
}
}
}
return current;
};
/**
* Checks if a set is the subset of another set
* @template T
* @param {Set<T>} bigSet a Set which contains the original elements to compare against
* @param {Set<T>} smallSet the set whose elements might be contained inside of bigSet
* @returns {boolean} returns true if smallSet contains all elements inside of the bigSet
*/
const isSubset = (bigSet, smallSet) => {
if (bigSet.size < smallSet.size) return false;
for (const item of smallSet) {
if (!bigSet.has(item)) return false;
}
return true;
};
/**
* @template T
* @param {Set<T>} set a set
* @param {(set: T) => boolean} fn selector function
* @returns {T | undefined} found item
*/
const find = (set, fn) => {
for (const item of set) {
if (fn(item)) return item;
}
};
/**
* @template T
* @param {Set<T> | ReadonlySet<T>} set a set
* @returns {T | undefined} first item
*/
const first = (set) => {
const entry = set.values().next();
return entry.done ? undefined : entry.value;
};
/**
* @template T
* @param {Set<T>} a first
* @param {Set<T>} b second
* @returns {Set<T>} combined set, may be identical to a or b
*/
const combine = (a, b) => {
if (b.size === 0) return a;
if (a.size === 0) return b;
const set = new Set(a);
for (const item of b) set.add(item);
return set;
};
module.exports.combine = combine;
module.exports.find = find;
module.exports.first = first;
module.exports.intersect = intersect;
module.exports.isSubset = isSubset;

View File

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

View File

@@ -0,0 +1,6 @@
export declare const setWeekWithOptions: import("./types.js").FPFn3<
Date,
import("../setWeek.js").SetWeekOptions<Date> | undefined,
number,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,100 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const forEachBail = require("./forEachBail");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
/** @typedef {{ alias: string | string[], extension: string }} ExtensionAliasOption */
module.exports = class ExtensionAliasPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {ExtensionAliasOption} options options
* @param {string | ResolveStepHook} target target
*/
constructor(source, options, target) {
this.source = source;
this.options = options;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
const { extension, alias } = this.options;
resolver
.getHook(this.source)
.tapAsync("ExtensionAliasPlugin", (request, resolveContext, callback) => {
const requestPath = request.request;
if (!requestPath || !requestPath.endsWith(extension)) return callback();
const isAliasString = typeof alias === "string";
/**
* @param {string} alias extension alias
* @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback
* @param {number=} index index
* @returns {void}
*/
const resolve = (alias, callback, index) => {
const newRequest = `${requestPath.slice(
0,
-extension.length,
)}${alias}`;
return resolver.doResolve(
target,
{
...request,
request: newRequest,
fullySpecified: true,
},
`aliased from extension alias with mapping '${extension}' to '${alias}'`,
resolveContext,
(err, result) => {
// Throw error if we are on the last alias (for multiple aliases) and it failed, always throw if we are not an array or we have only one alias
if (!isAliasString && index) {
if (index !== this.options.alias.length) {
if (resolveContext.log) {
resolveContext.log(
`Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newRequest}': ${err}`,
);
}
return callback(null, result);
}
return callback(err, result);
}
callback(err, result);
},
);
};
/**
* @param {(null | Error)=} err error
* @param {(null | ResolveRequest)=} result result
* @returns {void}
*/
const stoppingCallback = (err, result) => {
if (err) return callback(err);
if (result) return callback(null, result);
// Don't allow other aliasing or raw request
return callback(null, null);
};
if (isAliasString) {
resolve(alias, stoppingCallback);
} else if (alias.length > 1) {
forEachBail(alias, resolve, stoppingCallback);
} else {
resolve(alias[0], stoppingCallback);
}
});
}
};

View File

@@ -0,0 +1,20 @@
import type { JsonObject } from 'payload';
import React from 'react';
import type { ReloadDoc } from '../types.js';
import './index.scss';
type Props = {
readonly className?: string;
readonly displayPreview?: boolean;
readonly fileDoc: {
relationTo: string;
value: JsonObject;
};
readonly onRemove?: () => void;
readonly readonly?: boolean;
readonly reloadDoc: ReloadDoc;
readonly serverURL: string;
readonly showCollectionSlug?: boolean;
};
export declare function UploadComponentHasOne(props: Props): React.JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"shares.cjs","names":[],"sources":["../../../../src/rest/commands/read/shares.ts"],"sourcesContent":["import type { DirectusShare } from '../../../schema/share.js';\nimport type { ApplyQueryFields, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadShareOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusShare<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * List all Shares that exist in Directus.\n * @param query The query parameters\n * @returns An array of up to limit Share objects. If no items are available, data will be an empty array.\n */\nexport const readShares =\n\t<Schema, const TQuery extends Query<Schema, DirectusShare<Schema>>>(\n\t\tquery?: TQuery,\n\t): RestCommand<ReadShareOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/shares`,\n\t\tparams: query ?? {},\n\t\tmethod: 'GET',\n\t});\n\n/**\n * List an existing Share by primary key.\n * @param key The primary key of the dashboard\n * @param query The query parameters\n * @returns Returns a Share object if a valid primary key was provided.\n * @throws Will throw if key is empty\n */\nexport const readShare =\n\t<Schema, TQuery extends Query<Schema, DirectusShare<Schema>>>(\n\t\tkey: DirectusShare<Schema>['id'],\n\t\tquery?: TQuery,\n\t): RestCommand<ReadShareOutput<Schema, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/shares/${key}`,\n\t\t\tparams: query ?? {},\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"kDAgBa,EAEX,QAEM,CACN,KAAM,UACN,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR,EASW,GAEX,EACA,SAGA,EAAA,aAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,WAAW,IACjB,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR"}

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