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,133 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(ನೇ|ನೆ)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ಕ್ರಿ.ಪೂ|ಕ್ರಿ.ಶ)/i,
abbreviated: /^(ಕ್ರಿ\.?\s?ಪೂ\.?|ಕ್ರಿ\.?\s?ಶ\.?|ಪ್ರ\.?\s?ಶ\.?)/i,
wide: /^(ಕ್ರಿಸ್ತ ಪೂರ್ವ|ಕ್ರಿಸ್ತ ಶಕ|ಪ್ರಸಕ್ತ ಶಕ)/i,
};
const parseEraPatterns = {
any: [/^ಪೂ/i, /^(ಶ|ಪ್ರ)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^ತ್ರೈ[1234]|ತ್ರೈ [1234]| [1234]ತ್ರೈ/i,
wide: /^[1234](ನೇ)? ತ್ರೈಮಾಸಿಕ/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(ಜೂ|ಜು|ಜ|ಫೆ|ಮಾ|ಏ|ಮೇ|ಆ|ಸೆ|ಅ|ನ|ಡಿ)/i,
abbreviated:
/^(ಜನ|ಫೆಬ್ರ|ಮಾರ್ಚ್|ಏಪ್ರಿ|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗ|ಸೆಪ್ಟೆಂ|ಅಕ್ಟೋ|ನವೆಂ|ಡಿಸೆಂ)/i,
wide: /^(ಜನವರಿ|ಫೆಬ್ರವರಿ|ಮಾರ್ಚ್|ಏಪ್ರಿಲ್|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗಸ್ಟ್|ಸೆಪ್ಟೆಂಬರ್|ಅಕ್ಟೋಬರ್|ನವೆಂಬರ್|ಡಿಸೆಂಬರ್)/i,
};
const parseMonthPatterns = {
narrow: [
/^ಜ$/i,
/^ಫೆ/i,
/^ಮಾ/i,
/^ಏ/i,
/^ಮೇ/i,
/^ಜೂ/i,
/^ಜು$/i,
/^ಆ/i,
/^ಸೆ/i,
/^ಅ/i,
/^ನ/i,
/^ಡಿ/i,
],
any: [
/^ಜನ/i,
/^ಫೆ/i,
/^ಮಾ/i,
/^ಏ/i,
/^ಮೇ/i,
/^ಜೂನ್/i,
/^ಜುಲೈ/i,
/^ಆ/i,
/^ಸೆ/i,
/^ಅ/i,
/^ನ/i,
/^ಡಿ/i,
],
};
const matchDayPatterns = {
narrow: /^(ಭಾ|ಸೋ|ಮ|ಬು|ಗು|ಶು|ಶ)/i,
short: /^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,
abbreviated: /^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,
wide: /^(ಭಾನುವಾರ|ಸೋಮವಾರ|ಮಂಗಳವಾರ|ಬುಧವಾರ|ಗುರುವಾರ|ಶುಕ್ರವಾರ|ಶನಿವಾರ)/i,
};
const parseDayPatterns = {
narrow: [/^ಭಾ/i, /^ಸೋ/i, /^ಮ/i, /^ಬು/i, /^ಗು/i, /^ಶು/i, /^ಶ/i],
any: [/^ಭಾ/i, /^ಸೋ/i, /^ಮ/i, /^ಬು/i, /^ಗು/i, /^ಶು/i, /^ಶ/i],
};
const matchDayPeriodPatterns = {
narrow: /^(ಪೂ|ಅ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i,
any: /^(ಪೂರ್ವಾಹ್ನ|ಅಪರಾಹ್ನ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ಪೂ/i,
pm: /^ಅ/i,
midnight: /ಮಧ್ಯರಾತ್ರಿ/i,
noon: /ಮಧ್ಯಾನ್ಹ/i,
morning: /ಬೆಳಗ್ಗೆ/i,
afternoon: /ಮಧ್ಯಾನ್ಹ/i,
evening: /ಸಂಜೆ/i,
night: /ರಾತ್ರಿ/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1,181 @@
import { NoopCache } from "../cache/core/index.js";
import { entityKind } from "../entity.js";
import { NoopLogger } from "../logger.js";
import { fillPlaceholders, sql } from "../sql/sql.js";
import { SQLiteTransaction } from "../sqlite-core/index.js";
import { SQLitePreparedQuery, SQLiteSession } from "../sqlite-core/session.js";
import { mapResultRow } from "../utils.js";
class SQLiteRemoteSession extends SQLiteSession {
constructor(client, dialect, schema, batchCLient, options = {}) {
super(dialect);
this.client = client;
this.schema = schema;
this.batchCLient = batchCLient;
this.logger = options.logger ?? new NoopLogger();
this.cache = options.cache ?? new NoopCache();
}
static [entityKind] = "SQLiteRemoteSession";
logger;
cache;
prepareQuery(query, fields, executeMethod, isResponseInArrayMode, customResultMapper, queryMetadata, cacheConfig) {
return new RemotePreparedQuery(
this.client,
query,
this.logger,
this.cache,
queryMetadata,
cacheConfig,
fields,
executeMethod,
isResponseInArrayMode,
customResultMapper
);
}
async batch(queries) {
const preparedQueries = [];
const builtQueries = [];
for (const query of queries) {
const preparedQuery = query._prepare();
const builtQuery = preparedQuery.getQuery();
preparedQueries.push(preparedQuery);
builtQueries.push({ sql: builtQuery.sql, params: builtQuery.params, method: builtQuery.method });
}
const batchResults = await this.batchCLient(builtQueries);
return batchResults.map((result, i) => preparedQueries[i].mapResult(result, true));
}
async transaction(transaction, config) {
const tx = new SQLiteProxyTransaction("async", this.dialect, this, this.schema);
await this.run(sql.raw(`begin${config?.behavior ? " " + config.behavior : ""}`));
try {
const result = await transaction(tx);
await this.run(sql`commit`);
return result;
} catch (err) {
await this.run(sql`rollback`);
throw err;
}
}
extractRawAllValueFromBatchResult(result) {
return result.rows;
}
extractRawGetValueFromBatchResult(result) {
return result.rows[0];
}
extractRawValuesValueFromBatchResult(result) {
return result.rows;
}
}
class SQLiteProxyTransaction extends SQLiteTransaction {
static [entityKind] = "SQLiteProxyTransaction";
async transaction(transaction) {
const savepointName = `sp${this.nestedIndex}`;
const tx = new SQLiteProxyTransaction("async", this.dialect, this.session, this.schema, this.nestedIndex + 1);
await this.session.run(sql.raw(`savepoint ${savepointName}`));
try {
const result = await transaction(tx);
await this.session.run(sql.raw(`release savepoint ${savepointName}`));
return result;
} catch (err) {
await this.session.run(sql.raw(`rollback to savepoint ${savepointName}`));
throw err;
}
}
}
class RemotePreparedQuery extends SQLitePreparedQuery {
constructor(client, query, logger, cache, queryMetadata, cacheConfig, fields, executeMethod, _isResponseInArrayMode, customResultMapper) {
super("async", executeMethod, query, cache, queryMetadata, cacheConfig);
this.client = client;
this.logger = logger;
this.fields = fields;
this._isResponseInArrayMode = _isResponseInArrayMode;
this.customResultMapper = customResultMapper;
this.customResultMapper = customResultMapper;
this.method = executeMethod;
}
static [entityKind] = "SQLiteProxyPreparedQuery";
method;
getQuery() {
return { ...this.query, method: this.method };
}
async run(placeholderValues) {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
return await this.queryWithCache(this.query.sql, params, async () => {
return await this.client(this.query.sql, params, "run");
});
}
mapAllResult(rows, isFromBatch) {
if (isFromBatch) {
rows = rows.rows;
}
if (!this.fields && !this.customResultMapper) {
return rows;
}
if (this.customResultMapper) {
return this.customResultMapper(rows);
}
return rows.map((row) => {
return mapResultRow(
this.fields,
row,
this.joinsNotNullableMap
);
});
}
async all(placeholderValues) {
const { query, logger, client } = this;
const params = fillPlaceholders(query.params, placeholderValues ?? {});
logger.logQuery(query.sql, params);
const { rows } = await this.queryWithCache(query.sql, params, async () => {
return await client(query.sql, params, "all");
});
return this.mapAllResult(rows);
}
async get(placeholderValues) {
const { query, logger, client } = this;
const params = fillPlaceholders(query.params, placeholderValues ?? {});
logger.logQuery(query.sql, params);
const clientResult = await this.queryWithCache(query.sql, params, async () => {
return await client(query.sql, params, "get");
});
return this.mapGetResult(clientResult.rows);
}
mapGetResult(rows, isFromBatch) {
if (isFromBatch) {
rows = rows.rows;
}
const row = rows;
if (!this.fields && !this.customResultMapper) {
return row;
}
if (!row) {
return void 0;
}
if (this.customResultMapper) {
return this.customResultMapper([rows]);
}
return mapResultRow(
this.fields,
row,
this.joinsNotNullableMap
);
}
async values(placeholderValues) {
const params = fillPlaceholders(this.query.params, placeholderValues ?? {});
this.logger.logQuery(this.query.sql, params);
const clientResult = await this.queryWithCache(this.query.sql, params, async () => {
return await this.client(this.query.sql, params, "values");
});
return clientResult.rows;
}
/** @internal */
isResponseInArrayMode() {
return this._isResponseInArrayMode;
}
}
export {
RemotePreparedQuery,
SQLiteProxyTransaction,
SQLiteRemoteSession
};
//# sourceMappingURL=session.js.map

View File

@@ -0,0 +1,2 @@
# Set default behavior to automatically convert line endings
* text=auto eol=lf

View File

@@ -0,0 +1,14 @@
import { DirectusClient } from "../types/client.js";
import { RestClient, RestConfig } from "./types.js";
//#region src/rest/composable.d.ts
/**
* Creates a client to communicate with the Directus REST API.
*
* @returns A Directus REST client.
*/
declare const rest: (config?: Partial<RestConfig>) => <Schema>(client: DirectusClient<Schema>) => RestClient<Schema>;
//#endregion
export { rest };
//# sourceMappingURL=composable.d.ts.map

View File

@@ -0,0 +1,30 @@
"use strict";
exports.secondsToMinutes = secondsToMinutes;
var _index = require("./constants.cjs");
/**
* @name secondsToMinutes
* @category Conversion Helpers
* @summary Convert seconds to minutes.
*
* @description
* Convert a number of seconds to a full number of minutes.
*
* @param seconds - The number of seconds to be converted
*
* @returns The number of seconds converted in minutes
*
* @example
* // Convert 120 seconds into minutes
* const result = secondsToMinutes(120)
* //=> 2
*
* @example
* // It uses floor rounding:
* const result = secondsToMinutes(119)
* //=> 1
*/
function secondsToMinutes(seconds) {
const minutes = seconds / _index.secondsInMinute;
return Math.trunc(minutes);
}

View File

@@ -0,0 +1,16 @@
export function isColumnActive({
accessor,
activeColumnsIndices,
column,
columns
}) {
if (column) {
return column.active;
} else if (columns && Array.isArray(columns) && columns.length > 0) {
return Boolean(columns.find(col => col.accessor === accessor)?.active);
} else if (activeColumnsIndices.length < 4) {
return true;
}
return false;
}
//# sourceMappingURL=isColumnActive.js.map

View File

@@ -0,0 +1,86 @@
# OpenTelemetry mongoose Instrumentation for Node.js
[![NPM Published Version][npm-img]][npm-url]
[![Apache License][license-image]][license-image]
This module provides automatic instrumentation for the [`mongoose`](https://github.com/Automattic/mongoose) module, which may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle.
If total installation size is not constrained, it is recommended to use the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle with [@opentelemetry/sdk-node](`https://www.npmjs.com/package/@opentelemetry/sdk-node`) for the most seamless instrumentation experience.
Compatible with OpenTelemetry JS API and SDK `1.0+`.
## Installation
```bash
npm install --save @opentelemetry/instrumentation-mongoose
```
## Supported Versions
- [`mongoose`](https://www.npmjs.com/package/mongoose) versions `>=5.9.7 <9`
## Usage
To load a specific plugin, specify it in the registerInstrumentations's configuration:
```js
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { MongooseInstrumentation } = require('@opentelemetry/instrumentation-mongoose');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const provider = new NodeTracerProvider();
provider.register();
registerInstrumentations({
instrumentations: [
new MongooseInstrumentation(),
],
})
```
## Semantic Conventions
This instrumentation implements Semantic Conventions (semconv) v1.7.0. Since then, networking (in semconv v1.23.1) and database (in semconv v1.33.0) semantic conventions were stabilized. As of `@opentelemetry/instrumentation-mongoose@0.44.0` support has been added for migrating to the stable semantic conventions using the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable as follows:
1. Upgrade to the latest version of this instrumentation package.
2. Set `OTEL_SEMCONV_STABILITY_OPT_IN=http/dup,database/dup` to emit both old and stable semantic conventions. (The `http` token is used to control the `net.*` attributes, the `database` token to control the `db.*` attributes.)
3. Modify alerts, dashboards, metrics, and other processes in your Observability system to use the stable semantic conventions.
4. Set `OTEL_SEMCONV_STABILITY_OPT_IN=http,database` to emit only the stable semantic conventions.
By default, if `OTEL_SEMCONV_STABILITY_OPT_IN` includes neither of the above tokens, the old v1.7.0 semconv is used.
The intent is to provide an approximate 6 month time window for users of this instrumentation to migrate to the new database and networking semconv, after which a new minor version will use the new semconv by default and drop support for the old semconv.
See [the HTTP migration guide](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/) and the [database migration guide](https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/) for details.
Attributes collected:
| Old semconv | Stable semconv | Description |
| ----------------------- | -------------------- | -------------------------------------------------------------------------------------------- |
| `db.system` | `db.system.name` | An identifier for the database management system (DBMS) product being used. Value: 'mongodb' |
| `db.mongodb.collection` | `db.collection.name` | The collection being accessed within the database stated in `db.name`. |
| `db.name` | `db.namespace` | This attribute is used to report the name of the database being accessed. |
| `db.operation` | `db.operation.name` | The name of the operation being executed. |
| `db.statement` | `db.query.text` | The database statement being executed. |
| `db.user` | Removed | Username for accessing the database. |
| `net.peer.name` | `server.address` | Remote hostname or similar. |
| `net.peer.port` | `server.port` | Remote port number. |
Span name format:
- Old: `mongoose.{modelName}.{operation}` (e.g., `mongoose.User.save`)
- Stable: `{operation} {collection}` (e.g., `save users`)
## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
## License
Apache 2.0 - See [LICENSE][license-url] for more information.
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[npm-url]: https://www.npmjs.com/package/@opentelemetry/instrumentation-mongoose
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-mongoose.svg

View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.stat = exports.readFile = void 0;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
const readFile = exports.readFile = _gensync()({
sync: _fs().readFileSync,
errback: _fs().readFile
});
const stat = exports.stat = _gensync()({
sync: _fs().statSync,
errback: _fs().stat
});
0 && 0;
//# sourceMappingURL=fs.js.map

View File

@@ -0,0 +1,27 @@
import { nextDay } from "./nextDay.mjs";
/**
* @name nextWednesday
* @category Weekday Helpers
* @summary When is the next Wednesday?
*
* @description
* When is the next Wednesday?
*
* @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 date to start counting from
*
* @returns The next Wednesday
*
* @example
* // When is the next Wednesday after Mar, 22, 2020?
* const result = nextWednesday(new Date(2020, 2, 22))
* //=> Wed Mar 25 2020 00:00:00
*/
export function nextWednesday(date) {
return nextDay(date, 3);
}
// Fallback for modularized imports:
export default nextWednesday;

View File

@@ -0,0 +1,711 @@
import { inspect } from "node:util";
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("error creation", () => {
const err1 = new z.ZodError([]);
err1.issues.push({
code: "invalid_type",
expected: "object",
path: [],
message: "",
input: "adf",
});
err1.isEmpty;
const err2 = new z.ZodError(err1.issues);
const err3 = new z.ZodError([]);
err3.addIssues(err1.issues);
err3.addIssue(err1.issues[0]);
err1.message;
err2.message;
err3.message;
});
test("do not allow error and message together", () => {
expect(() =>
z.string().refine((_) => true, {
message: "override",
error: (iss) => (iss.input === undefined ? "asdf" : null),
})
).toThrow();
});
const errorMap: z.ZodErrorMap = (issue) => {
if (issue.code === "invalid_type") {
if (issue.expected === "string") {
return { message: "bad type!" };
}
}
if (issue.code === "custom") {
return { message: `less-than-${issue.params?.minimum}` };
}
return undefined;
};
test("type error with custom error map", () => {
const result = z.string().safeParse(234, { error: errorMap });
expect(result.success).toBe(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "bad type!"
}
]]
`);
});
test("refinement fail with params", () => {
const result = z
.number()
.refine((val) => val >= 3, {
params: { minimum: 3 },
})
.safeParse(2, { error: errorMap });
expect(result.success).toBe(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [],
"params": {
"minimum": 3
},
"message": "less-than-3"
}
]]
`);
});
test("hard coded error with custom errormap", () => {
const result = z
.string()
.refine((val) => val.length > 12, {
params: { minimum: 13 },
message: "override",
})
.safeParse("asdf", { error: () => "contextual" });
expect(result.success).toBe(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [],
"params": {
"minimum": 13
},
"message": "override"
}
]]
`);
});
test("default error message", () => {
const result = z
.number()
.refine((x) => x > 3)
.safeParse(2);
expect(result.success).toBe(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [],
"message": "Invalid input"
}
]]
`);
});
test("override error in refine", () => {
const result = z
.number()
.refine((x) => x > 3, "override")
.safeParse(2);
expect(result.success).toBe(false);
expect(result.error!.issues.length).toEqual(1);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [],
"message": "override"
}
]]
`);
});
test("override error in refinement", () => {
const result = z
.number()
.refine((x) => x > 3, {
message: "override",
})
.safeParse(2);
expect(result.success).toBe(false);
expect(result.error!.issues.length).toEqual(1);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [],
"message": "override"
}
]]
`);
});
test("array minimum", () => {
let result = z.array(z.string()).min(3, "tooshort").safeParse(["asdf", "qwer"]);
expect(result.success).toBe(false);
expect(result.error!.issues[0].code).toEqual("too_small");
expect(result.error!.issues[0].message).toEqual("tooshort");
result = z.array(z.string()).min(3).safeParse(["asdf", "qwer"]);
expect(result.success).toBe(false);
expect(result.error!.issues[0].code).toEqual("too_small");
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"origin": "array",
"code": "too_small",
"minimum": 3,
"inclusive": true,
"path": [],
"message": "Too small: expected array to have >=3 items"
}
]]
`);
});
test("literal bigint default error message", () => {
const result = z.literal(BigInt(12)).safeParse(BigInt(13));
expect(result.success).toBe(false);
expect(result.error!.issues.length).toEqual(1);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "invalid_value",
"values": [
"12"
],
"path": [],
"message": "Invalid input: expected 12n"
}
]]
`);
});
test("custom path in custom error map", () => {
const schema = z.object({
items: z.array(z.string()).refine((data) => data.length > 3, {
path: ["items-too-few"],
}),
});
const errorMap: z.ZodErrorMap = (issue) => {
expect((issue.path ?? []).length).toBe(2);
return { message: "doesnt matter" };
};
const result = schema.safeParse({ items: ["first"] }, { error: errorMap });
expect(result.success).toBe(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"code": "custom",
"path": [
"items",
"items-too-few"
],
"message": "doesnt matter"
}
]]
`);
});
// test("error metadata from value", () => {
// const dynamicRefine = z.string().refine(
// (val) => val === val.toUpperCase(),
// (val) => ({ params: { val } })
// );
// const result = dynamicRefine.safeParse("asdf");
// expect(result.success).toEqual(false);
// if (!result.success) {
// const sub = result.error.issues[0];
// expect(result.error.issues[0].code).toEqual("custom");
// if (sub.code === "custom") {
// expect(sub.params?.val).toEqual("asdf");
// }
// }
// });
// test("don't call refine after validation failed", () => {
// const asdf = z
// .union([
// z.number(),
// z.string().transform(z.number(), (val) => {
// return parseFloat(val);
// }),
// ])
// .refine((v) => v >= 1);
// expect(() => asdf.safeParse("foo")).not.toThrow();
// });
test("root level formatting", () => {
const schema = z.string().email();
const result = schema.safeParse("asdfsdf");
expect(result.success).toBe(false);
expect(result.error!.format()).toMatchInlineSnapshot(`
{
"_errors": [
"Invalid email address",
],
}
`);
});
test("custom path", () => {
const schema = z
.object({
password: z.string(),
confirm: z.string(),
})
.refine((val) => val.confirm === val.password, { path: ["confirm"] });
const result = schema.safeParse({
password: "peanuts",
confirm: "qeanuts",
});
expect(result.success).toBe(false);
const error = result.error!.format();
expect(error._errors).toEqual([]);
expect(error.password?._errors).toEqual(undefined);
expect(error.confirm?._errors).toEqual(["Invalid input"]);
});
test("custom path", () => {
const schema = z
.object({
password: z.string().min(6),
confirm: z.string().min(6),
})
.refine((val) => val.confirm === val.password);
const result = schema.safeParse({
password: "qwer",
confirm: "asdf",
});
expect(result.success).toBe(false);
expect(result.error!.issues.length).toEqual(3);
});
const schema = z.object({
inner: z.object({
name: z
.string()
.refine((val) => val.length > 5)
.array()
.refine((val) => val.length <= 1),
}),
});
test("no abort early on refinements", () => {
const invalidItem = {
inner: { name: ["aasd", "asdfasdfasfd"] },
};
const result1 = schema.safeParse(invalidItem);
expect(result1.success).toBe(false);
expect(result1.error!.issues.length).toEqual(2);
});
test("detect issue with input fallback", () => {
const schema = z
.string()
.transform((val) => val.length)
.refine(() => false, { message: "always fails" })
.refine(
(val) => {
if (typeof val !== "number") throw new Error();
return (val ^ 2) > 10;
} // should be number but it's a string
);
expect(() => schema.parse("hello")).toThrow(z.ZodError);
});
test("formatting", () => {
const invalidItem = {
inner: { name: ["aasd", "asdfasdfasfd"] },
};
const invalidArray = {
inner: { name: ["asdfasdf", "asdfasdfasfd"] },
};
const result1 = schema.safeParse(invalidItem);
const result2 = schema.safeParse(invalidArray);
expect(result1.success).toBe(false);
expect(result2.success).toBe(false);
const error1 = result1.error!.format();
expect(error1._errors).toEqual([]);
expect(error1.inner?._errors).toEqual([]);
expect(error1.inner?.name?.[1]).toEqual(undefined);
type FormattedError = z.inferFormattedError<typeof schema>;
const error2: FormattedError = result2.error!.format();
expect(error2._errors).toEqual([]);
expect(error2.inner?._errors).toEqual([]);
expect(error2.inner?.name?._errors).toEqual(["Invalid input"]);
expect(error2.inner?.name?.[0]).toEqual(undefined);
expect(error2.inner?.name?.[1]).toEqual(undefined);
expect(error2.inner?.name?.[2]).toEqual(undefined);
// test custom mapper
type FormattedErrorWithNumber = z.inferFormattedError<typeof schema, number>;
const errorWithNumber: FormattedErrorWithNumber = result2.error!.format(() => 5);
expect(errorWithNumber._errors).toEqual([]);
expect(errorWithNumber.inner?._errors).toEqual([]);
expect(errorWithNumber.inner?.name?._errors).toEqual([5]);
});
test("formatting with nullable and optional fields", () => {
const nameSchema = z.string().refine((val) => val.length > 5);
const schema = z.object({
nullableObject: z.object({ name: nameSchema }).nullable(),
nullableArray: z.array(nameSchema).nullable(),
nullableTuple: z.tuple([nameSchema, nameSchema, z.number()]).nullable(),
optionalObject: z.object({ name: nameSchema }).optional(),
optionalArray: z.array(nameSchema).optional(),
optionalTuple: z.tuple([nameSchema, nameSchema, z.number()]).optional(),
});
const invalidItem = {
nullableObject: { name: "abcd" },
nullableArray: ["abcd"],
nullableTuple: ["abcd", "abcd", 1],
optionalObject: { name: "abcd" },
optionalArray: ["abcd"],
optionalTuple: ["abcd", "abcd", 1],
};
const result = schema.safeParse(invalidItem);
expect(result.success).toBe(false);
const error: z.inferFormattedError<typeof schema> = result.error!.format();
expect(error._errors).toEqual([]);
expect(error.nullableObject?._errors).toEqual([]);
expect(error.nullableObject?.name?._errors).toEqual(["Invalid input"]);
expect(error.nullableArray?._errors).toEqual([]);
expect(error.nullableArray?.[0]?._errors).toEqual(["Invalid input"]);
expect(error.nullableTuple?._errors).toEqual([]);
expect(error.nullableTuple?.[0]?._errors).toEqual(["Invalid input"]);
expect(error.nullableTuple?.[1]?._errors).toEqual(["Invalid input"]);
expect(error.optionalObject?._errors).toEqual([]);
expect(error.optionalObject?.name?._errors).toEqual(["Invalid input"]);
expect(error.optionalArray?._errors).toEqual([]);
expect(error.optionalArray?.[0]?._errors).toEqual(["Invalid input"]);
expect(error.optionalTuple?._errors).toEqual([]);
expect(error.optionalTuple?.[0]?._errors).toEqual(["Invalid input"]);
expect(error.optionalTuple?.[1]?._errors).toEqual(["Invalid input"]);
expect(error).toMatchInlineSnapshot(`
{
"_errors": [],
"nullableArray": {
"0": {
"_errors": [
"Invalid input",
],
},
"_errors": [],
},
"nullableObject": {
"_errors": [],
"name": {
"_errors": [
"Invalid input",
],
},
},
"nullableTuple": {
"0": {
"_errors": [
"Invalid input",
],
},
"1": {
"_errors": [
"Invalid input",
],
},
"_errors": [],
},
"optionalArray": {
"0": {
"_errors": [
"Invalid input",
],
},
"_errors": [],
},
"optionalObject": {
"_errors": [],
"name": {
"_errors": [
"Invalid input",
],
},
},
"optionalTuple": {
"0": {
"_errors": [
"Invalid input",
],
},
"1": {
"_errors": [
"Invalid input",
],
},
"_errors": [],
},
}
`);
});
test("inferFlattenedErrors", () => {
const schemaWithTransform = z.object({ foo: z.string() }).transform((o) => ({ bar: o.foo }));
const result = schemaWithTransform.safeParse({});
expect(result.success).toBe(false);
type ValidationErrors = z.inferFlattenedErrors<typeof schemaWithTransform>;
const error: ValidationErrors = result.error!.flatten();
expect(error).toMatchInlineSnapshot(`
{
"fieldErrors": {
"foo": [
"Invalid input: expected string, received undefined",
],
},
"formErrors": [],
}
`);
});
const stringWithCustomError = z.string({
error: () => "bound",
});
test("schema-bound error map", () => {
const result = stringWithCustomError.safeParse(1234);
expect(result.success).toBe(false);
expect(result.error!.issues[0].message).toEqual("bound");
});
test("bound error map overrides contextual", () => {
// support contextual override
const result = stringWithCustomError.safeParse(undefined, {
error: () => ({ message: "override" }),
});
expect(result.success).toBe(false);
expect(result.error!.issues[0].message).toEqual("bound");
});
test("z.config customError ", () => {
// support overrideErrorMap
z.config({ customError: () => ({ message: "override" }) });
const result = stringWithCustomError.min(10).safeParse("tooshort");
expect(result.success).toBe(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"origin": "string",
"code": "too_small",
"minimum": 10,
"inclusive": true,
"path": [],
"message": "override"
}
]]
`);
expect(result.error!.issues[0].message).toEqual("override");
z.config({ customError: undefined });
});
// test("invalid and required", () => {
// const str = z.string({
// invalid_type_error: "Invalid name",
// required_error: "Name is required",
// });
// const result1 = str.safeParse(1234);
// expect(result1.success).toBe(false);
// if (!result1.success) {
// expect(result1.error.issues[0].message).toEqual("Invalid name");
// }
// const result2 = str.safeParse(undefined);
// expect(result2.success).toBe(false);
// if (!result2.success) {
// expect(result2.error.issues[0].message).toEqual("Name is required");
// }
// });
// test("Fallback to default required error", () => {
// const str = z.string({
// invalid_type_error: "Invalid name",
// // required_error: "Name is required",
// });
// const result2 = str.safeParse(undefined);
// expect(result2.success).toBe(false);
// if (!result2.success) {
// expect(result2.error.issues[0].message).toEqual("Required");
// }
// });
// test("invalid and required and errorMap", () => {
// expect(() => {
// return z.string({
// invalid_type_error: "Invalid name",
// required_error: "Name is required",
// errorMap: () => ({ message: "override" }),
// });
// }).toThrow();
// });
// test("strict error message", () => {
// const errorMsg = "Invalid object";
// const obj = z.object({ x: z.string() }).strict(errorMsg);
// const result = obj.safeParse({ x: "a", y: "b" });
// expect(result.success).toBe(false);
// if (!result.success) {
// expect(result.error.issues[0].message).toEqual(errorMsg);
// }
// });
test("empty string error message", () => {
const schema = z.string().max(1, { message: "" });
const result = schema.safeParse("asdf");
expect(result.success).toBe(false);
expect(result.error!.issues[0].message).toEqual("");
});
test("dont short circuit on continuable errors", () => {
const user = z
.object({
password: z.string().min(6),
confirm: z.string(),
})
.refine((data) => data.password === data.confirm, {
message: "Passwords don't match",
path: ["confirm"],
});
const result = user.safeParse({ password: "asdf", confirm: "qwer" });
expect(result.success).toBe(false);
expect(result.error).toMatchInlineSnapshot(`
[ZodError: [
{
"origin": "string",
"code": "too_small",
"minimum": 6,
"inclusive": true,
"path": [
"password"
],
"message": "Too small: expected string to have >=6 characters"
},
{
"code": "custom",
"path": [
"confirm"
],
"message": "Passwords don't match"
}
]]
`);
// expect(result.error!.issues.length).toEqual(2);
});
test("string error params", () => {
const a = z.string("Bad!");
expect(a.safeParse(123).error!.issues[0].message).toBe("Bad!");
const b = z.string().min(5, "Too short!");
expect(b.safeParse("abc").error!.issues[0].message).toBe("Too short!");
const c = z.uuid("Bad UUID!");
expect(c.safeParse("not-a-uuid").error!.issues[0].message).toBe("Bad UUID!");
const d = z.string().datetime({ message: "Bad date!" });
expect(d.safeParse("not-a-date").error!.issues[0].message).toBe("Bad date!");
const e = z.array(z.string(), "Bad array!");
expect(e.safeParse("not-an-array").error!.issues[0].message).toBe("Bad array!");
const f = z.array(z.string()).min(5, "Too few items!");
expect(f.safeParse(["a", "b"]).error!.issues[0].message).toBe("Too few items!");
const g = z.set(z.string(), "Bad set!");
expect(g.safeParse("not-a-set").error!.issues[0].message).toBe("Bad set!");
const h = z.array(z.string(), "Bad array!");
expect(h.safeParse(123).error!.issues[0].message).toBe("Bad array!");
const i = z.set(z.string(), "Bad set!");
expect(i.safeParse(123).error!.issues[0].message).toBe("Bad set!");
const j = z.array(z.string(), "Bad array!");
expect(j.safeParse(null).error!.issues[0].message).toBe("Bad array!");
});
test("error inheritance", () => {
const e1 = z.string().safeParse(123).error!;
expect(e1).toBeInstanceOf(z.core.$ZodError);
expect(e1).toBeInstanceOf(z.ZodError);
expect(e1).toBeInstanceOf(z.ZodRealError);
// expect(e1).not.toBeInstanceOf(Error);
try {
z.string().parse(123);
} catch (e2) {
expect(e1).toBeInstanceOf(z.core.$ZodError);
expect(e2).toBeInstanceOf(z.ZodError);
expect(e2).toBeInstanceOf(z.ZodRealError);
// expect(e2).toBeInstanceOf(Error);
}
});
test("error serialization", () => {
try {
z.string().parse(123);
} catch (e) {
expect(e).toMatchInlineSnapshot(`
[ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected string, received number"
}
]]
`);
expect(inspect(e).split("\n").slice(0, 8).join("\n")).toMatchInlineSnapshot(`
"ZodError: [
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected string, received number"
}
]"
`);
}
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"permissions.js","names":[],"sources":["../../../../src/rest/commands/delete/permissions.ts"],"sourcesContent":["import type { DirectusPermission } from '../../../schema/permission.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing permissions rules\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deletePermissions =\n\t<Schema>(keys: DirectusPermission<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/permissions`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing permissions rule\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deletePermission =\n\t<Schema>(key: DirectusPermission<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/permissions/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"6DAUA,MAAa,EACH,QAER,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,eACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,gBAAgB,IACtB,OAAQ,SACR"}

View File

@@ -0,0 +1,10 @@
/**
* 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.
*
*/
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalHeadless.dev.mjs') : import('./LexicalHeadless.prod.mjs'));
export const createHeadlessEditor = mod.createHeadlessEditor;

View File

@@ -0,0 +1,10 @@
import type { ASTVisitor } from '../../language/visitor';
import type { SDLValidationContext } from '../ValidationContext';
/**
* Lone Schema definition
*
* A GraphQL document is only valid if it contains only one schema definition.
*/
export declare function LoneSchemaDefinitionRule(
context: SDLValidationContext,
): ASTVisitor;

View File

@@ -0,0 +1,20 @@
/**
* Result extraction functions for MCP server instrumentation
*
* Handles extraction of attributes from tool and prompt execution results.
*/
/**
* Extract tool result attributes for span instrumentation
* @param result - Tool execution result
* @param recordOutputs - Whether to include actual content or just metadata (counts, error status)
* @returns Attributes extracted from tool result content
*/
export declare function extractToolResultAttributes(result: unknown, recordOutputs: boolean): Record<string, string | number | boolean>;
/**
* Extract prompt result attributes for span instrumentation
* @param result - Prompt execution result
* @param recordOutputs - Whether to include actual content or just metadata (counts)
* @returns Attributes extracted from prompt result
*/
export declare function extractPromptResultAttributes(result: unknown, recordOutputs: boolean): Record<string, string | number | boolean>;
//# sourceMappingURL=resultExtraction.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"counter-increment.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/counter-increment.ts"],"names":[],"mappings":";;;AACA,2CAAwE;AAW3D,QAAA,gBAAgB,GAA8C;IACvE,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,MAAM;IACpB,MAAM,EAAE,IAAI;IACZ,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC;SACf;QAED,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAExB,IAAI,KAAK,CAAC,IAAI,yBAA0B,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;YAChE,OAAO,IAAI,CAAC;SACf;QAED,IAAM,UAAU,GAAG,EAAE,CAAC;QACtB,IAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAa,CAAC,CAAC;QAE9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC7B,IAAI,OAAO,CAAC,IAAI,yBAA0B,EAAE;gBACxC,IAAM,SAAS,GAAG,IAAI,IAAI,sBAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChE,UAAU,CAAC,IAAI,CAAC,EAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,WAAA,EAAC,CAAC,CAAC;aACxD;SACJ;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ,CAAC"}

View File

@@ -0,0 +1,202 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('../../currentScopes.js');
const object = require('../../utils/object.js');
const trace = require('../../tracing/trace.js');
const attributes = require('./attributes.js');
const correlation = require('./correlation.js');
const errorCapture = require('./errorCapture.js');
const sessionExtraction = require('./sessionExtraction.js');
const sessionManagement = require('./sessionManagement.js');
const spans = require('./spans.js');
const validation = require('./validation.js');
/**
* Transport layer instrumentation for MCP server
*
* Handles message interception and response correlation.
* @see https://modelcontextprotocol.io/specification/2025-06-18/basic/transports
*/
/**
* Wraps transport.onmessage to create spans for incoming messages.
* For "initialize" requests, extracts and stores client info and protocol version
* in the session data for the transport.
* @param transport - MCP transport instance to wrap
* @param options - Resolved MCP options
*/
function wrapTransportOnMessage(transport, options) {
if (transport.onmessage) {
object.fill(transport, 'onmessage', originalOnMessage => {
return function ( message, extra) {
if (validation.isJsonRpcRequest(message)) {
const isInitialize = message.method === 'initialize';
let initSessionData;
if (isInitialize) {
try {
initSessionData = sessionExtraction.extractSessionDataFromInitializeRequest(message);
sessionManagement.storeSessionDataForTransport(this, initSessionData);
} catch {
// noop
}
}
const isolationScope = currentScopes.getIsolationScope().clone();
return currentScopes.withIsolationScope(isolationScope, () => {
const spanConfig = spans.buildMcpServerSpanConfig(message, this, extra , options);
const span = trace.startInactiveSpan(spanConfig);
// For initialize requests, add client info directly to span (works even for stateless transports)
if (isInitialize && initSessionData) {
span.setAttributes({
...sessionExtraction.buildClientAttributesFromInfo(initSessionData.clientInfo),
...(initSessionData.protocolVersion && {
[attributes.MCP_PROTOCOL_VERSION_ATTRIBUTE]: initSessionData.protocolVersion,
}),
});
}
correlation.storeSpanForRequest(this, message.id, span, message.method);
return trace.withActiveSpan(span, () => {
return (originalOnMessage ).call(this, message, extra);
});
});
}
if (validation.isJsonRpcNotification(message)) {
return spans.createMcpNotificationSpan(message, this, extra , options, () => {
return (originalOnMessage ).call(this, message, extra);
});
}
return (originalOnMessage ).call(this, message, extra);
};
});
}
}
/**
* Wraps transport.send to handle outgoing messages and response correlation.
* For "initialize" responses, extracts and stores protocol version and server info
* in the session data for the transport.
* @param transport - MCP transport instance to wrap
* @param options - Resolved MCP options
*/
function wrapTransportSend(transport, options) {
if (transport.send) {
object.fill(transport, 'send', originalSend => {
return async function ( ...args) {
const [message] = args;
if (validation.isJsonRpcNotification(message)) {
return spans.createMcpOutgoingNotificationSpan(message, this, options, () => {
return (originalSend ).call(this, ...args);
});
}
if (validation.isJsonRpcResponse(message)) {
if (message.id !== null && message.id !== undefined) {
if (message.error) {
captureJsonRpcErrorResponse(message.error);
}
if (validation.isValidContentItem(message.result)) {
if (message.result.protocolVersion || message.result.serverInfo) {
try {
const serverData = sessionExtraction.extractSessionDataFromInitializeResponse(message.result);
sessionManagement.updateSessionDataForTransport(this, serverData);
} catch {
// noop
}
}
}
correlation.completeSpanWithResults(this, message.id, message.result, options);
}
}
return (originalSend ).call(this, ...args);
};
});
}
}
/**
* Wraps transport.onclose to clean up pending spans for this transport only
* @param transport - MCP transport instance to wrap
*/
function wrapTransportOnClose(transport) {
if (transport.onclose) {
object.fill(transport, 'onclose', originalOnClose => {
return function ( ...args) {
correlation.cleanupPendingSpansForTransport(this);
sessionManagement.cleanupSessionDataForTransport(this);
return (originalOnClose ).call(this, ...args);
};
});
}
}
/**
* Wraps transport error handlers to capture connection errors
* @param transport - MCP transport instance to wrap
*/
function wrapTransportError(transport) {
if (transport.onerror) {
object.fill(transport, 'onerror', (originalOnError) => {
return function ( error) {
captureTransportError(error);
return originalOnError.call(this, error);
};
});
}
}
/**
* Captures JSON-RPC error responses for server-side errors.
* @see https://www.jsonrpc.org/specification#error_object
* @internal
* @param errorResponse - JSON-RPC error response
*/
function captureJsonRpcErrorResponse(errorResponse) {
try {
if (errorResponse && typeof errorResponse === 'object' && 'code' in errorResponse && 'message' in errorResponse) {
const jsonRpcError = errorResponse ;
const isServerError =
jsonRpcError.code === -32603 || (jsonRpcError.code >= -32099 && jsonRpcError.code <= -32000);
if (isServerError) {
const error = new Error(jsonRpcError.message);
error.name = `JsonRpcError_${jsonRpcError.code}`;
errorCapture.captureError(error, 'protocol');
}
}
} catch {
// noop
}
}
/**
* Captures transport connection errors
* @internal
* @param error - Transport error
*/
function captureTransportError(error) {
try {
errorCapture.captureError(error, 'transport');
} catch {
// noop
}
}
exports.wrapTransportError = wrapTransportError;
exports.wrapTransportOnClose = wrapTransportOnClose;
exports.wrapTransportOnMessage = wrapTransportOnMessage;
exports.wrapTransportSend = wrapTransportSend;
//# sourceMappingURL=transport.js.map

View File

@@ -0,0 +1,20 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CalendarOff = createLucideIcon("CalendarOff", [
["path", { d: "M4.2 4.2A2 2 0 0 0 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 1.82-1.18", key: "16swn3" }],
["path", { d: "M21 15.5V6a2 2 0 0 0-2-2H9.5", key: "yhw86o" }],
["path", { d: "M16 2v4", key: "4m81vk" }],
["path", { d: "M3 10h7", key: "1wap6i" }],
["path", { d: "M21 10h-5.5", key: "quycpq" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }]
]);
export { CalendarOff as default };
//# sourceMappingURL=calendar-off.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"loadEnv.d.ts","sourceRoot":"","sources":["../../src/bin/loadEnv.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,QAsBpC"}

View File

@@ -0,0 +1,8 @@
export declare const NODE_VERSION: {
major: number;
minor: number;
patch: number;
};
export declare const NODE_MAJOR: number;
export declare const NODE_MINOR: number;
//# sourceMappingURL=nodeVersion.d.ts.map

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_dispose.cjs",
"module": "../../esm/_dispose.js"
}

View File

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

View File

@@ -0,0 +1,52 @@
import constants from 'node:constants';
export const allSignals =
// this is the full list of signals that Node will let us do anything with
Object.keys(constants).filter(k => k.startsWith('SIG') &&
// https://github.com/tapjs/signal-exit/issues/21
k !== 'SIGPROF' &&
// no sense trying to listen for SIGKILL, it's impossible
k !== 'SIGKILL');
// These are some obscure signals that are reported by kill -l
// on macOS, Linux, or Windows, but which don't have any mapping
// in Node.js. No sense trying if they're just going to throw
// every time on every platform.
//
// 'SIGEMT',
// 'SIGLOST',
// 'SIGPOLL',
// 'SIGRTMAX',
// 'SIGRTMAX-1',
// 'SIGRTMAX-10',
// 'SIGRTMAX-11',
// 'SIGRTMAX-12',
// 'SIGRTMAX-13',
// 'SIGRTMAX-14',
// 'SIGRTMAX-15',
// 'SIGRTMAX-2',
// 'SIGRTMAX-3',
// 'SIGRTMAX-4',
// 'SIGRTMAX-5',
// 'SIGRTMAX-6',
// 'SIGRTMAX-7',
// 'SIGRTMAX-8',
// 'SIGRTMAX-9',
// 'SIGRTMIN',
// 'SIGRTMIN+1',
// 'SIGRTMIN+10',
// 'SIGRTMIN+11',
// 'SIGRTMIN+12',
// 'SIGRTMIN+13',
// 'SIGRTMIN+14',
// 'SIGRTMIN+15',
// 'SIGRTMIN+16',
// 'SIGRTMIN+2',
// 'SIGRTMIN+3',
// 'SIGRTMIN+4',
// 'SIGRTMIN+5',
// 'SIGRTMIN+6',
// 'SIGRTMIN+7',
// 'SIGRTMIN+8',
// 'SIGRTMIN+9',
// 'SIGSTKFLT',
// 'SIGUNUSED',
//# sourceMappingURL=all-signals.js.map

View File

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

View File

@@ -0,0 +1,67 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const instrumentationTedious = require('@opentelemetry/instrumentation-tedious');
const core = require('@sentry/core');
const nodeCore = require('@sentry/node-core');
const TEDIUS_INSTRUMENTED_METHODS = new Set([
'callProcedure',
'execSql',
'execSqlBatch',
'execBulkLoad',
'prepare',
'execute',
]);
const INTEGRATION_NAME = 'Tedious';
const instrumentTedious = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationTedious.TediousInstrumentation({}));
const _tediousIntegration = (() => {
let instrumentationWrappedCallback;
return {
name: INTEGRATION_NAME,
setupOnce() {
const instrumentation = instrumentTedious();
instrumentationWrappedCallback = nodeCore.instrumentWhenWrapped(instrumentation);
},
setup(client) {
instrumentationWrappedCallback?.(() =>
client.on('spanStart', span => {
const { description, data } = core.spanToJSON(span);
// Tedius integration always set a span name and `db.system` attribute to `mssql`.
if (!description || data['db.system'] !== 'mssql') {
return;
}
const operation = description.split(' ')[0] || '';
if (TEDIUS_INSTRUMENTED_METHODS.has(operation)) {
span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.tedious');
}
}),
);
},
};
}) ;
/**
* Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library.
*
* For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.tediousIntegration()],
* });
* ```
*/
const tediousIntegration = core.defineIntegration(_tediousIntegration);
exports.instrumentTedious = instrumentTedious;
exports.tediousIntegration = tediousIntegration;
//# sourceMappingURL=tedious.js.map

View File

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

View File

@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ChartColumnStacked = createLucideIcon("ChartColumnStacked", [
["path", { d: "M11 13H7", key: "t0o9gq" }],
["path", { d: "M19 9h-4", key: "rera1j" }],
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
["rect", { x: "15", y: "5", width: "4", height: "12", rx: "1", key: "q8uenq" }],
["rect", { x: "7", y: "8", width: "4", height: "9", rx: "1", key: "sr5ea" }]
]);
export { ChartColumnStacked as default };
//# sourceMappingURL=chart-column-stacked.js.map

View File

@@ -0,0 +1,111 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var common = require('./common');
var assert = require('assert');
var EventEmitter = require('../');
{
var ee = new EventEmitter();
var events_new_listener_emitted = [];
var listeners_new_listener_emitted = [];
// Sanity check
assert.strictEqual(ee.addListener, ee.on);
ee.on('newListener', function(event, listener) {
// Don't track newListener listeners.
if (event === 'newListener')
return;
events_new_listener_emitted.push(event);
listeners_new_listener_emitted.push(listener);
});
var hello = common.mustCall(function(a, b) {
assert.strictEqual('a', a);
assert.strictEqual('b', b);
});
ee.once('newListener', function(name, listener) {
assert.strictEqual(name, 'hello');
assert.strictEqual(listener, hello);
var listeners = this.listeners('hello');
assert.ok(Array.isArray(listeners));
assert.strictEqual(listeners.length, 0);
});
ee.on('hello', hello);
ee.once('foo', assert.fail);
assert.ok(Array.isArray(events_new_listener_emitted));
assert.strictEqual(events_new_listener_emitted.length, 2);
assert.strictEqual(events_new_listener_emitted[0], 'hello');
assert.strictEqual(events_new_listener_emitted[1], 'foo');
assert.ok(Array.isArray(listeners_new_listener_emitted));
assert.strictEqual(listeners_new_listener_emitted.length, 2);
assert.strictEqual(listeners_new_listener_emitted[0], hello);
assert.strictEqual(listeners_new_listener_emitted[1], assert.fail);
ee.emit('hello', 'a', 'b');
}
// just make sure that this doesn't throw:
{
var f = new EventEmitter();
f.setMaxListeners(0);
}
{
var listen1 = function() {};
var listen2 = function() {};
var ee = new EventEmitter();
ee.once('newListener', function() {
var listeners = ee.listeners('hello');
assert.ok(Array.isArray(listeners));
assert.strictEqual(listeners.length, 0);
ee.once('newListener', function() {
var listeners = ee.listeners('hello');
assert.ok(Array.isArray(listeners));
assert.strictEqual(listeners.length, 0);
});
ee.on('hello', listen2);
});
ee.on('hello', listen1);
// The order of listeners on an event is not always the order in which the
// listeners were added.
var listeners = ee.listeners('hello');
assert.ok(Array.isArray(listeners));
assert.strictEqual(listeners.length, 2);
assert.strictEqual(listeners[0], listen2);
assert.strictEqual(listeners[1], listen1);
}
// Verify that the listener must be a function
assert.throws(function() {
var ee = new EventEmitter();
ee.on('foo', null);
}, /^TypeError: The "listener" argument must be of type Function. Received type object$/);

View File

@@ -0,0 +1 @@
{"version":3,"file":"snail.js","sources":["../../../src/icons/snail.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Snail\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxM2E2IDYgMCAxIDAgMTIgMCA0IDQgMCAxIDAtOCAwIDIgMiAwIDAgMCA0IDAiIC8+CiAgPGNpcmNsZSBjeD0iMTAiIGN5PSIxMyIgcj0iOCIgLz4KICA8cGF0aCBkPSJNMiAyMWgxMmM0LjQgMCA4LTMuNiA4LThWN2EyIDIgMCAxIDAtNCAwdjYiIC8+CiAgPHBhdGggZD0iTTE4IDMgMTkuMSA1LjIiIC8+CiAgPHBhdGggZD0iTTIyIDMgMjAuOSA1LjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/snail\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 Snail = createLucideIcon('Snail', [\n ['path', { d: 'M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0', key: 'hneq2s' }],\n ['circle', { cx: '10', cy: '13', r: '8', key: '194lz3' }],\n ['path', { d: 'M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6', key: 'ixqyt7' }],\n ['path', { d: 'M18 3 19.1 5.2', key: '9tjm43' }],\n ['path', { d: 'M22 3 20.9 5.2', key: 'j3odrs' }],\n]);\n\nexport default Snail;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjF,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,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/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACjD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,390 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { DocumentInfoProvider, EditDepthProvider, HydrateAuthProvider, LivePreviewProvider } from '@payloadcms/ui';
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import { handleLivePreview, handlePreview } from '@payloadcms/ui/rsc';
import { isEditing as getIsEditing } from '@payloadcms/ui/shared';
import { buildFormState } from '@payloadcms/ui/utilities/buildFormState';
import { notFound, redirect } from 'next/navigation.js';
import { isolateObjectProperty, logError } from 'payload';
import { formatAdminURL, hasAutosaveEnabled, hasDraftsEnabled } from 'payload/shared';
import React from 'react';
import { DocumentHeader } from '../../elements/DocumentHeader/index.js';
import { getPreferences } from '../../utilities/getPreferences.js';
import { NotFoundView } from '../NotFound/index.js';
import { getDocPreferences } from './getDocPreferences.js';
import { getDocumentData } from './getDocumentData.js';
import { getDocumentPermissions } from './getDocumentPermissions.js';
import { getDocumentView } from './getDocumentView.js';
import { getIsLocked } from './getIsLocked.js';
import { getMetaBySegment } from './getMetaBySegment.js';
import { getVersions } from './getVersions.js';
import { renderDocumentSlots } from './renderDocumentSlots.js';
export const generateMetadata = async args => getMetaBySegment(args);
/**
* This function is responsible for rendering
* an Edit Document view on the server for both:
* - default document edit views
* - on-demand edit views within drawers
*/
export const renderDocument = async ({
disableActions,
documentSubViewType,
drawerSlug,
importMap,
initialData,
initPageResult,
overrideEntityVisibility,
params,
redirectAfterCreate,
redirectAfterDelete,
redirectAfterDuplicate,
redirectAfterRestore,
searchParams,
versions,
viewType
}) => {
const {
collectionConfig,
docID: idFromArgs,
globalConfig,
locale,
permissions,
req,
req: {
i18n,
payload,
payload: {
config,
config: {
routes: {
admin: adminRoute,
api: apiRoute
}
}
},
user
},
visibleEntities
} = initPageResult;
const segments = Array.isArray(params?.segments) ? params.segments : [];
const collectionSlug = collectionConfig?.slug || undefined;
const globalSlug = globalConfig?.slug || undefined;
let isEditing = getIsEditing({
id: idFromArgs,
collectionSlug,
globalSlug
});
// Fetch the doc required for the view
let doc = !idFromArgs && !globalSlug ? initialData || null : await getDocumentData({
id: idFromArgs,
collectionSlug,
globalSlug,
locale,
payload,
req,
segments,
user
});
if (isEditing && !doc) {
// If it's a collection document that doesn't exist, redirect to collection list
if (collectionSlug) {
const redirectURL = formatAdminURL({
adminRoute,
path: `/collections/${collectionSlug}?notFound=${encodeURIComponent(idFromArgs)}`
});
redirect(redirectURL);
} else {
// For globals or other cases, keep the 404 behavior
throw new Error('not-found');
}
}
const isTrashedDoc = Boolean(doc && 'deletedAt' in doc && typeof doc?.deletedAt === 'string');
// CRITICAL FIX FOR TRANSACTION RACE CONDITION:
// When running parallel operations with Promise.all, if they share the same req object
// and one operation calls initTransaction() which MUTATES req.transactionID, that mutation
// is visible to all parallel operations. This causes:
// 1. Operation A (e.g., getDocumentPermissions → docAccessOperation) calls initTransaction()
// which sets req.transactionID = Promise, then resolves it to a UUID
// 2. Operation B (e.g., getIsLocked) running in parallel receives the SAME req with the mutated transactionID
// 3. Operation A (does not even know that Operation B even exists and is stil using the transactionID) commits/ends its transaction
// 4. Operation B tries to use the now-expired session → MongoExpiredSessionError!
//
// Solution: Use isolateObjectProperty to create a Proxy that isolates the 'transactionID' property.
// This allows each operation to have its own transactionID without affecting the parent req.
// If parent req already has a transaction, preserve it (don't isolate), since this
// issue only arises when one of the operations calls initTransaction() themselves -
// because then, that operation will also try to commit/end the transaction itself.
// If the transactionID is already set, the parallel operations will not try to
// commit/end the transaction themselves, so we don't need to isolate the
// transactionID property.
const reqForPermissions = req.transactionID ? req : isolateObjectProperty(req, 'transactionID');
const reqForLockCheck = req.transactionID ? req : isolateObjectProperty(req, 'transactionID');
const [docPreferences, {
docPermissions,
hasPublishPermission,
hasSavePermission
}, {
currentEditor,
isLocked,
lastUpdateTime
}, entityPreferences] = await Promise.all([
// Get document preferences
getDocPreferences({
id: idFromArgs,
collectionSlug,
globalSlug,
payload,
user
}),
// Get permissions - isolated transactionID prevents cross-contamination
getDocumentPermissions({
id: idFromArgs,
collectionConfig,
data: doc,
globalConfig,
req: reqForPermissions
}),
// Fetch document lock state - isolated transactionID prevents cross-contamination
getIsLocked({
id: idFromArgs,
collectionConfig,
globalConfig,
isEditing,
req: reqForLockCheck
}),
// get entity preferences
getPreferences(collectionSlug ? `collection-${collectionSlug}` : `global-${globalSlug}`, payload, req.user.id, req.user.collection)]);
const operation = collectionSlug && idFromArgs || globalSlug ? 'update' : 'create';
const [{
hasPublishedDoc,
mostRecentVersionIsAutosaved,
unpublishedVersionCount,
versionCount
}, {
state: formState
}] = await Promise.all([getVersions({
id: idFromArgs,
collectionConfig,
doc,
docPermissions,
globalConfig,
locale: locale?.code,
payload,
user
}), buildFormState({
id: idFromArgs,
collectionSlug,
data: doc,
docPermissions,
docPreferences,
fallbackLocale: false,
globalSlug,
locale: locale?.code,
operation,
readOnly: isTrashedDoc || isLocked,
renderAllFields: true,
req,
schemaPath: collectionSlug || globalSlug,
skipValidation: true
})]);
const documentViewServerProps = {
doc,
hasPublishedDoc,
i18n,
initPageResult,
locale,
params,
payload,
permissions,
routeSegments: segments,
searchParams,
user,
versions
};
if (!overrideEntityVisibility && (collectionSlug && !visibleEntities?.collections?.find(visibleSlug => visibleSlug === collectionSlug) || globalSlug && !visibleEntities?.globals?.find(visibleSlug => visibleSlug === globalSlug))) {
throw new Error('not-found');
}
const formattedParams = new URLSearchParams();
if (hasDraftsEnabled(collectionConfig || globalConfig)) {
formattedParams.append('draft', 'true');
}
if (locale?.code) {
formattedParams.append('locale', locale.code);
}
const apiQueryParams = `?${formattedParams.toString()}`;
const apiURL = formatAdminURL({
apiRoute,
path: collectionSlug ? `/${collectionSlug}/${idFromArgs}${apiQueryParams}` : globalSlug ? `/${globalSlug}${apiQueryParams}` : ''
});
let View = null;
let showHeader = true;
const RootViewOverride = collectionConfig?.admin?.components?.views?.edit?.root && 'Component' in collectionConfig.admin.components.views.edit.root ? collectionConfig?.admin?.components?.views?.edit?.root?.Component : globalConfig?.admin?.components?.views?.edit?.root && 'Component' in globalConfig.admin.components.views.edit.root ? globalConfig?.admin?.components?.views?.edit?.root?.Component : null;
if (RootViewOverride) {
View = RootViewOverride;
showHeader = false;
} else {
({
View
} = getDocumentView({
collectionConfig,
config,
docPermissions,
globalConfig,
routeSegments: segments
}));
}
if (!View) {
View = NotFoundView;
}
/**
* Handle case where autoSave is enabled and the document is being created
* => create document and redirect
*/
const shouldAutosave = hasSavePermission && hasAutosaveEnabled(collectionConfig || globalConfig);
const validateDraftData = collectionConfig?.versions?.drafts && collectionConfig?.versions?.drafts?.validate;
let id = idFromArgs;
if (shouldAutosave && !validateDraftData && !idFromArgs && collectionSlug) {
doc = await payload.create({
collection: collectionSlug,
data: initialData || {},
depth: 0,
draft: true,
fallbackLocale: false,
locale: locale?.code,
req,
user
});
if (doc?.id) {
id = doc.id;
isEditing = getIsEditing({
id: doc.id,
collectionSlug,
globalSlug
});
if (!drawerSlug && redirectAfterCreate !== false) {
const redirectURL = formatAdminURL({
adminRoute,
path: `/collections/${collectionSlug}/${doc.id}`
});
redirect(redirectURL);
}
} else {
throw new Error('not-found');
}
}
const documentSlots = renderDocumentSlots({
id,
collectionConfig,
globalConfig,
hasSavePermission,
locale,
permissions,
req
});
// Extract Description from documentSlots to pass to DocumentHeader
const {
Description
} = documentSlots;
const clientProps = {
formState,
...documentSlots,
documentSubViewType,
viewType
};
const {
isLivePreviewEnabled,
livePreviewConfig,
livePreviewURL
} = await handleLivePreview({
collectionSlug,
config,
data: doc,
globalSlug,
operation,
req
});
const {
isPreviewEnabled,
previewURL
} = await handlePreview({
collectionSlug,
config,
data: doc,
globalSlug,
operation,
req
});
return {
data: doc,
Document: /*#__PURE__*/_jsx(DocumentInfoProvider, {
apiURL: apiURL,
collectionSlug: collectionConfig?.slug,
currentEditor: currentEditor,
disableActions: disableActions ?? false,
docPermissions: docPermissions,
globalSlug: globalConfig?.slug,
hasPublishedDoc: hasPublishedDoc,
hasPublishPermission: hasPublishPermission,
hasSavePermission: hasSavePermission,
id: id,
initialData: doc,
initialState: formState,
isEditing: isEditing,
isLocked: isLocked,
isTrashed: isTrashedDoc,
lastUpdateTime: lastUpdateTime,
mostRecentVersionIsAutosaved: mostRecentVersionIsAutosaved,
redirectAfterCreate: redirectAfterCreate,
redirectAfterDelete: redirectAfterDelete,
redirectAfterDuplicate: redirectAfterDuplicate,
redirectAfterRestore: redirectAfterRestore,
unpublishedVersionCount: unpublishedVersionCount,
versionCount: versionCount,
children: /*#__PURE__*/_jsxs(LivePreviewProvider, {
breakpoints: livePreviewConfig?.breakpoints,
isLivePreviewEnabled: isLivePreviewEnabled && operation !== 'create',
isLivePreviewing: Boolean(entityPreferences?.value?.editViewType === 'live-preview' && livePreviewURL),
isPreviewEnabled: Boolean(isPreviewEnabled),
previewURL: previewURL,
typeofLivePreviewURL: typeof livePreviewConfig?.url,
url: livePreviewURL,
children: [showHeader && !drawerSlug && /*#__PURE__*/_jsx(DocumentHeader, {
AfterHeader: Description,
collectionConfig: collectionConfig,
globalConfig: globalConfig,
permissions: permissions,
req: req
}), /*#__PURE__*/_jsx(HydrateAuthProvider, {
permissions: permissions
}), /*#__PURE__*/_jsx(EditDepthProvider, {
children: RenderServerComponent({
clientProps,
Component: View,
importMap,
serverProps: documentViewServerProps
})
})]
})
}, locale?.code)
};
};
export async function DocumentView(props) {
try {
const {
Document: RenderedDocument
} = await renderDocument(props);
return RenderedDocument;
} catch (error) {
if (error?.message === 'NEXT_REDIRECT') {
throw error;
}
logError({
err: error,
payload: props.initPageResult.req.payload
});
if (error.message === 'not-found') {
notFound();
}
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,215 @@
// this is just a very light wrapper around 2 arrays with an offset index
import { GLOBSTAR } from 'minimatch';
const isPatternList = (pl) => pl.length >= 1;
const isGlobList = (gl) => gl.length >= 1;
/**
* An immutable-ish view on an array of glob parts and their parsed
* results
*/
export class Pattern {
#patternList;
#globList;
#index;
length;
#platform;
#rest;
#globString;
#isDrive;
#isUNC;
#isAbsolute;
#followGlobstar = true;
constructor(patternList, globList, index, platform) {
if (!isPatternList(patternList)) {
throw new TypeError('empty pattern list');
}
if (!isGlobList(globList)) {
throw new TypeError('empty glob list');
}
if (globList.length !== patternList.length) {
throw new TypeError('mismatched pattern list and glob list lengths');
}
this.length = patternList.length;
if (index < 0 || index >= this.length) {
throw new TypeError('index out of range');
}
this.#patternList = patternList;
this.#globList = globList;
this.#index = index;
this.#platform = platform;
// normalize root entries of absolute patterns on initial creation.
if (this.#index === 0) {
// c: => ['c:/']
// C:/ => ['C:/']
// C:/x => ['C:/', 'x']
// //host/share => ['//host/share/']
// //host/share/ => ['//host/share/']
// //host/share/x => ['//host/share/', 'x']
// /etc => ['/', 'etc']
// / => ['/']
if (this.isUNC()) {
// '' / '' / 'host' / 'share'
const [p0, p1, p2, p3, ...prest] = this.#patternList;
const [g0, g1, g2, g3, ...grest] = this.#globList;
if (prest[0] === '') {
// ends in /
prest.shift();
grest.shift();
}
const p = [p0, p1, p2, p3, ''].join('/');
const g = [g0, g1, g2, g3, ''].join('/');
this.#patternList = [p, ...prest];
this.#globList = [g, ...grest];
this.length = this.#patternList.length;
}
else if (this.isDrive() || this.isAbsolute()) {
const [p1, ...prest] = this.#patternList;
const [g1, ...grest] = this.#globList;
if (prest[0] === '') {
// ends in /
prest.shift();
grest.shift();
}
const p = p1 + '/';
const g = g1 + '/';
this.#patternList = [p, ...prest];
this.#globList = [g, ...grest];
this.length = this.#patternList.length;
}
}
}
/**
* The first entry in the parsed list of patterns
*/
pattern() {
return this.#patternList[this.#index];
}
/**
* true of if pattern() returns a string
*/
isString() {
return typeof this.#patternList[this.#index] === 'string';
}
/**
* true of if pattern() returns GLOBSTAR
*/
isGlobstar() {
return this.#patternList[this.#index] === GLOBSTAR;
}
/**
* true if pattern() returns a regexp
*/
isRegExp() {
return this.#patternList[this.#index] instanceof RegExp;
}
/**
* The /-joined set of glob parts that make up this pattern
*/
globString() {
return (this.#globString =
this.#globString ||
(this.#index === 0 ?
this.isAbsolute() ?
this.#globList[0] + this.#globList.slice(1).join('/')
: this.#globList.join('/')
: this.#globList.slice(this.#index).join('/')));
}
/**
* true if there are more pattern parts after this one
*/
hasMore() {
return this.length > this.#index + 1;
}
/**
* The rest of the pattern after this part, or null if this is the end
*/
rest() {
if (this.#rest !== undefined)
return this.#rest;
if (!this.hasMore())
return (this.#rest = null);
this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
this.#rest.#isAbsolute = this.#isAbsolute;
this.#rest.#isUNC = this.#isUNC;
this.#rest.#isDrive = this.#isDrive;
return this.#rest;
}
/**
* true if the pattern represents a //unc/path/ on windows
*/
isUNC() {
const pl = this.#patternList;
return this.#isUNC !== undefined ?
this.#isUNC
: (this.#isUNC =
this.#platform === 'win32' &&
this.#index === 0 &&
pl[0] === '' &&
pl[1] === '' &&
typeof pl[2] === 'string' &&
!!pl[2] &&
typeof pl[3] === 'string' &&
!!pl[3]);
}
// pattern like C:/...
// split = ['C:', ...]
// XXX: would be nice to handle patterns like `c:*` to test the cwd
// in c: for *, but I don't know of a way to even figure out what that
// cwd is without actually chdir'ing into it?
/**
* True if the pattern starts with a drive letter on Windows
*/
isDrive() {
const pl = this.#patternList;
return this.#isDrive !== undefined ?
this.#isDrive
: (this.#isDrive =
this.#platform === 'win32' &&
this.#index === 0 &&
this.length > 1 &&
typeof pl[0] === 'string' &&
/^[a-z]:$/i.test(pl[0]));
}
// pattern = '/' or '/...' or '/x/...'
// split = ['', ''] or ['', ...] or ['', 'x', ...]
// Drive and UNC both considered absolute on windows
/**
* True if the pattern is rooted on an absolute path
*/
isAbsolute() {
const pl = this.#patternList;
return this.#isAbsolute !== undefined ?
this.#isAbsolute
: (this.#isAbsolute =
(pl[0] === '' && pl.length > 1) ||
this.isDrive() ||
this.isUNC());
}
/**
* consume the root of the pattern, and return it
*/
root() {
const p = this.#patternList[0];
return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?
p
: '';
}
/**
* Check to see if the current globstar pattern is allowed to follow
* a symbolic link.
*/
checkFollowGlobstar() {
return !(this.#index === 0 ||
!this.isGlobstar() ||
!this.#followGlobstar);
}
/**
* Mark that the current globstar pattern is following a symbolic link
*/
markFollowGlobstar() {
if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
return false;
this.#followGlobstar = false;
return true;
}
}
//# sourceMappingURL=pattern.js.map

View File

@@ -0,0 +1,172 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Alexander Akait @alexander-akait
*/
"use strict";
const { RawSource } = require("webpack-sources");
const ConcatenationScope = require("../ConcatenationScope");
const Generator = require("../Generator");
const {
CSS_TYPE,
CSS_URL_TYPE,
CSS_URL_TYPES,
JAVASCRIPT_AND_CSS_URL_TYPES,
JAVASCRIPT_TYPE,
JAVASCRIPT_TYPES,
NO_TYPES
} = require("../ModuleSourceTypeConstants");
const RuntimeGlobals = require("../RuntimeGlobals");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../Generator").GenerateContext} GenerateContext */
/** @typedef {import("../Module").ConcatenationBailoutReasonContext} ConcatenationBailoutReasonContext */
/** @typedef {import("../Module").SourceType} SourceType */
/** @typedef {import("../Module").SourceTypes} SourceTypes */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../NormalModule")} NormalModule */
class AssetSourceGenerator extends Generator {
/**
* @param {ModuleGraph} moduleGraph the module graph
*/
constructor(moduleGraph) {
super();
this._moduleGraph = moduleGraph;
}
/**
* @param {NormalModule} module module for which the code should be generated
* @param {GenerateContext} generateContext context for generate
* @returns {Source | null} generated code
*/
generate(
module,
{ type, concatenationScope, getData, runtimeTemplate, runtimeRequirements }
) {
const originalSource = module.originalSource();
const data = getData ? getData() : undefined;
switch (type) {
case JAVASCRIPT_TYPE: {
if (!originalSource) {
return new RawSource("");
}
const encodedSource = originalSource.buffer().toString("base64");
runtimeRequirements.add(RuntimeGlobals.requireScope);
runtimeRequirements.add(RuntimeGlobals.toBinary);
/** @type {string} */
let sourceContent;
if (concatenationScope) {
concatenationScope.registerNamespaceExport(
ConcatenationScope.NAMESPACE_OBJECT_EXPORT
);
sourceContent = `${runtimeTemplate.renderConst()} ${
ConcatenationScope.NAMESPACE_OBJECT_EXPORT
} = ${RuntimeGlobals.toBinary}(${JSON.stringify(encodedSource)});`;
} else {
runtimeRequirements.add(RuntimeGlobals.module);
sourceContent = `${module.moduleArgument}.exports = ${RuntimeGlobals.toBinary}(${JSON.stringify(
encodedSource
)});`;
}
return new RawSource(sourceContent);
}
case CSS_URL_TYPE: {
if (!originalSource) {
return null;
}
const encodedSource = originalSource.buffer().toString("base64");
if (data) {
data.set("url", {
[type]: `data:application/octet-stream;base64,${encodedSource}`
});
}
return null;
}
default:
return null;
}
}
/**
* @param {Error} error the error
* @param {NormalModule} module module for which the code should be generated
* @param {GenerateContext} generateContext context for generate
* @returns {Source | null} generated code
*/
generateError(error, module, generateContext) {
switch (generateContext.type) {
case JAVASCRIPT_TYPE: {
return new RawSource(
`throw new Error(${JSON.stringify(error.message)});`
);
}
default:
return null;
}
}
/**
* @param {NormalModule} module module for which the bailout reason should be determined
* @param {ConcatenationBailoutReasonContext} context context
* @returns {string | undefined} reason why this module can't be concatenated, undefined when it can be concatenated
*/
getConcatenationBailoutReason(module, context) {
return undefined;
}
/**
* @param {NormalModule} module fresh module
* @returns {SourceTypes} available types (do not mutate)
*/
getTypes(module) {
/** @type {Set<string>} */
const sourceTypes = new Set();
const connections = this._moduleGraph.getIncomingConnections(module);
for (const connection of connections) {
if (!connection.originModule) {
continue;
}
sourceTypes.add(connection.originModule.type.split("/")[0]);
}
if (sourceTypes.size > 0) {
if (sourceTypes.has(JAVASCRIPT_TYPE) && sourceTypes.has(CSS_TYPE)) {
return JAVASCRIPT_AND_CSS_URL_TYPES;
} else if (sourceTypes.has(CSS_TYPE)) {
return CSS_URL_TYPES;
}
return JAVASCRIPT_TYPES;
}
return NO_TYPES;
}
/**
* @param {NormalModule} module the module
* @param {SourceType=} type source type
* @returns {number} estimate size of the module
*/
getSize(module, type) {
const originalSource = module.originalSource();
if (!originalSource) {
return 0;
}
// Example: m.exports="abcd"
return originalSource.size() + 12;
}
}
module.exports = AssetSourceGenerator;

View File

@@ -0,0 +1 @@
{"version":3,"file":"SpanOptions.js","sourceRoot":"","sources":["../../../src/trace/SpanOptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TimeInput } from '../common/Time';\nimport { SpanAttributes } from './attributes';\nimport { Link } from './link';\nimport { SpanKind } from './span_kind';\n\n/**\n * Options needed for span creation\n */\nexport interface SpanOptions {\n /**\n * The SpanKind of a span\n * @default {@link SpanKind.INTERNAL}\n */\n kind?: SpanKind;\n\n /** A span's attributes */\n attributes?: SpanAttributes;\n\n /** {@link Link}s span to other spans */\n links?: Link[];\n\n /** A manually specified start time for the created `Span` object. */\n startTime?: TimeInput;\n\n /** The new span should be a root span. (Ignore parent from context). */\n root?: boolean;\n}\n"]}

View File

@@ -0,0 +1,21 @@
/**
* Sanitizes REST select query to SelectType
*/ export const sanitizeSelectParam = (unsanitizedSelect)=>{
if (unsanitizedSelect && typeof unsanitizedSelect === 'object') {
for(const _k in unsanitizedSelect){
const k = _k;
if (unsanitizedSelect[k] === 'true') {
;
unsanitizedSelect[k] = true;
} else if (unsanitizedSelect[k] === 'false') {
;
unsanitizedSelect[k] = false;
} else if (typeof unsanitizedSelect[k] === 'object') {
sanitizeSelectParam(unsanitizedSelect[k]);
}
}
}
return unsanitizedSelect;
};
//# sourceMappingURL=sanitizeSelectParam.js.map

View File

@@ -0,0 +1,167 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["MÖ", "MS"],
abbreviated: ["MÖ", "MS"],
wide: ["Milattan Önce", "Milattan Sonra"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1Ç", "2Ç", "3Ç", "4Ç"],
wide: ["İlk çeyrek", "İkinci Çeyrek", "Üçüncü çeyrek", "Son çeyrek"],
};
const monthValues = {
narrow: ["O", "Ş", "M", "N", "M", "H", "T", "A", "E", "E", "K", "A"],
abbreviated: [
"Oca",
"Şub",
"Mar",
"Nis",
"May",
"Haz",
"Tem",
"Ağu",
"Eyl",
"Eki",
"Kas",
"Ara",
],
wide: [
"Ocak",
"Şubat",
"Mart",
"Nisan",
"Mayıs",
"Haziran",
"Temmuz",
"Ağustos",
"Eylül",
"Ekim",
"Kasım",
"Aralık",
],
};
const dayValues = {
narrow: ["P", "P", "S", "Ç", "P", "C", "C"],
short: ["Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"],
abbreviated: ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cts"],
wide: [
"Pazar",
"Pazartesi",
"Salı",
"Çarşamba",
"Perşembe",
"Cuma",
"Cumartesi",
],
};
const dayPeriodValues = {
narrow: {
am: "öö",
pm: "ös",
midnight: "gy",
noon: "ö",
morning: "sa",
afternoon: "ös",
evening: "ak",
night: "ge",
},
abbreviated: {
am: "ÖÖ",
pm: "ÖS",
midnight: "gece yarısı",
noon: "öğle",
morning: "sabah",
afternoon: "öğleden sonra",
evening: "akşam",
night: "gece",
},
wide: {
am: "Ö.Ö.",
pm: "Ö.S.",
midnight: "gece yarısı",
noon: "öğle",
morning: "sabah",
afternoon: "öğleden sonra",
evening: "akşam",
night: "gece",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "öö",
pm: "ös",
midnight: "gy",
noon: "ö",
morning: "sa",
afternoon: "ös",
evening: "ak",
night: "ge",
},
abbreviated: {
am: "ÖÖ",
pm: "ÖS",
midnight: "gece yarısı",
noon: "öğlen",
morning: "sabahleyin",
afternoon: "öğleden sonra",
evening: "akşamleyin",
night: "geceleyin",
},
wide: {
am: "ö.ö.",
pm: "ö.s.",
midnight: "gece yarısı",
noon: "öğlen",
morning: "sabahleyin",
afternoon: "öğleden sonra",
evening: "akşamleyin",
night: "geceleyin",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => Number(quarter) - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,25 @@
export const migrationTableExists = async (adapter, db)=>{
let statement;
if (adapter.name === 'postgres') {
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : '';
statement = `SELECT to_regclass('${prependSchema}"payload_migrations"') AS exists;`;
}
if (adapter.name === 'sqlite') {
statement = `
SELECT CASE
WHEN COUNT(*) > 0 THEN 1
ELSE 0
END AS 'exists'
FROM sqlite_master
WHERE type = 'table'
AND name = 'payload_migrations';`;
}
const result = await adapter.execute({
drizzle: db ?? adapter.drizzle,
raw: statement
});
const [row] = result.rows;
return row && typeof row === 'object' && 'exists' in row && !!row.exists;
};
//# sourceMappingURL=migrationTableExists.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createFolderCollection.d.ts","sourceRoot":"","sources":["../../src/folders/createFolderCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAUtE,KAAK,0BAA0B,GAAG;IAChC,kBAAkB,EAAE,OAAO,CAAA;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wBAAwB,EAAE,gBAAgB,EAAE,CAAA;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AACD,eAAO,MAAM,sBAAsB,oFAMhC,0BAA0B,KAAG,gBAqG/B,CAAA"}

View File

@@ -0,0 +1,8 @@
export default (alg, key) => {
if (alg.startsWith('RS') || alg.startsWith('PS')) {
const { modulusLength } = key.algorithm;
if (typeof modulusLength !== 'number' || modulusLength < 2048) {
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
}
}
};

View File

@@ -0,0 +1,63 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debugBuild = require('../debug-build.js');
const debugLogger = require('../utils/debug-logger.js');
const stacktrace = require('../utils/stacktrace.js');
// We keep the handlers globally
const handlers = {};
const instrumented = {};
/** Add a handler function. */
function addHandler(type, handler) {
handlers[type] = handlers[type] || [];
handlers[type].push(handler);
}
/**
* Reset all instrumentation handlers.
* This can be used by tests to ensure we have a clean slate of instrumentation handlers.
*/
function resetInstrumentationHandlers() {
Object.keys(handlers).forEach(key => {
handlers[key ] = undefined;
});
}
/** Maybe run an instrumentation function, unless it was already called. */
function maybeInstrument(type, instrumentFn) {
if (!instrumented[type]) {
instrumented[type] = true;
try {
instrumentFn();
} catch (e) {
debugBuild.DEBUG_BUILD && debugLogger.debug.error(`Error while instrumenting ${type}`, e);
}
}
}
/** Trigger handlers for a given instrumentation type. */
function triggerHandlers(type, data) {
const typeHandlers = type && handlers[type];
if (!typeHandlers) {
return;
}
for (const handler of typeHandlers) {
try {
handler(data);
} catch (e) {
debugBuild.DEBUG_BUILD &&
debugLogger.debug.error(
`Error while triggering instrumentation handler.\nType: ${type}\nName: ${stacktrace.getFunctionName(handler)}\nError:`,
e,
);
}
}
}
exports.addHandler = addHandler;
exports.maybeInstrument = maybeInstrument;
exports.resetInstrumentationHandlers = resetInstrumentationHandlers;
exports.triggerHandlers = triggerHandlers;
//# sourceMappingURL=handlers.js.map

View File

@@ -0,0 +1,115 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DB_SYSTEM_NAME_VALUE_MONGODB = exports.ATTR_NET_PEER_PORT = exports.ATTR_NET_PEER_NAME = exports.ATTR_DB_USER = exports.ATTR_DB_SYSTEM = exports.ATTR_DB_STATEMENT = exports.ATTR_DB_OPERATION = exports.ATTR_DB_NAME = exports.ATTR_DB_MONGODB_COLLECTION = void 0;
/*
* This file contains a copy of unstable semantic convention definitions
* used by this package.
* @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
*/
/**
* Deprecated, use `db.collection.name` instead.
*
* @example "mytable"
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*
* @deprecated Replaced by `db.collection.name`.
*/
exports.ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection';
/**
* Deprecated, use `db.namespace` instead.
*
* @example customers
* @example main
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*
* @deprecated Replaced by `db.namespace`.
*/
exports.ATTR_DB_NAME = 'db.name';
/**
* Deprecated, use `db.operation.name` instead.
*
* @example findAndModify
* @example HMSET
* @example SELECT
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*
* @deprecated Replaced by `db.operation.name`.
*/
exports.ATTR_DB_OPERATION = 'db.operation';
/**
* The database statement being executed.
*
* @example SELECT * FROM wuser_table
* @example SET mykey "WuValue"
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*
* @deprecated Replaced by `db.query.text`.
*/
exports.ATTR_DB_STATEMENT = 'db.statement';
/**
* Deprecated, use `db.system.name` instead.
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*
* @deprecated Replaced by `db.system.name`.
*/
exports.ATTR_DB_SYSTEM = 'db.system';
/**
* Deprecated, no replacement at this time.
*
* @example readonly_user
* @example reporting_user
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*
* @deprecated Removed, no replacement at this time.
*/
exports.ATTR_DB_USER = 'db.user';
/**
* Deprecated, use `server.address` on client spans and `client.address` on server spans.
*
* @example example.com
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*
* @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.
*/
exports.ATTR_NET_PEER_NAME = 'net.peer.name';
/**
* Deprecated, use `server.port` on client spans and `client.port` on server spans.
*
* @example 8080
*
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*
* @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.
*/
exports.ATTR_NET_PEER_PORT = 'net.peer.port';
/**
* Enum value "mongodb" for attribute {@link ATTR_DB_SYSTEM_NAME}.
*
* [MongoDB](https://www.mongodb.com/)
*
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
*/
exports.DB_SYSTEM_NAME_VALUE_MONGODB = 'mongodb';
//# sourceMappingURL=semconv.js.map

View File

@@ -0,0 +1,47 @@
import type { AnySchemaObject, SchemaObject, JTDParser } from "./types";
import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema";
import AjvCore, { CurrentOptions } from "./core";
type JTDOptions = CurrentOptions & {
strict?: never;
allowMatchingProperties?: never;
allowUnionTypes?: never;
validateFormats?: never;
$data?: never;
verbose?: boolean;
$comment?: never;
formats?: never;
loadSchema?: never;
useDefaults?: never;
coerceTypes?: never;
next?: never;
unevaluated?: never;
dynamicRef?: never;
meta?: boolean;
defaultMeta?: never;
inlineRefs?: boolean;
loopRequired?: never;
multipleOfPrecision?: never;
};
export declare class Ajv extends AjvCore {
constructor(opts?: JTDOptions);
_addVocabularies(): void;
_addDefaultMetaSchema(): void;
defaultMeta(): string | AnySchemaObject | undefined;
compileSerializer<T = unknown>(schema: SchemaObject): (data: T) => string;
compileSerializer<T = unknown>(schema: JTDSchemaType<T>): (data: T) => string;
compileParser<T = unknown>(schema: SchemaObject): JTDParser<T>;
compileParser<T = unknown>(schema: JTDSchemaType<T>): JTDParser<T>;
private _compileSerializer;
private _compileParser;
}
export default Ajv;
export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, JTDParser, } from "./types";
export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core";
export { SchemaCxt, SchemaObjCxt } from "./compile";
export { KeywordCxt } from "./compile/validate";
export { JTDErrorObject } from "./vocabularies/jtd";
export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen";
export { JTDSchemaType, SomeJTDSchemaType, JTDDataType };
export { JTDOptions };
export { default as ValidationError } from "./runtime/validation_error";
export { default as MissingRefError } from "./compile/ref_error";

View File

@@ -0,0 +1,36 @@
var root = require('./_root');
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsFinite = root.isFinite;
/**
* Checks if `value` is a finite primitive number.
*
* **Note:** This method is based on
* [`Number.isFinite`](https://mdn.io/Number/isFinite).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
* @example
*
* _.isFinite(3);
* // => true
*
* _.isFinite(Number.MIN_VALUE);
* // => true
*
* _.isFinite(Infinity);
* // => false
*
* _.isFinite('3');
* // => false
*/
function isFinite(value) {
return typeof value == 'number' && nativeIsFinite(value);
}
module.exports = isFinite;

View File

@@ -0,0 +1 @@
{"version":3,"file":"getPrivacyOptions.d.ts","sourceRoot":"","sources":["../../../../src/util/getPrivacyOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAEhE,KAAK,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEnF,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IAEvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,iBAAiB,GAAG,gBAAgB,CAiB/G"}

View File

@@ -0,0 +1,3 @@
export { et } from '@payloadcms/translations/languages/et';
//# sourceMappingURL=et.js.map

View File

@@ -0,0 +1,17 @@
// This named export is intended for users of CommonJS. Users of ES modules
import { GraphQLScalarType } from 'graphql';
import { identity, parseLiteral } from './utils.js';
const specifiedByURL = 'http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf';
export const GraphQLJSONConfig = /*#__PURE__*/ {
name: 'JSON',
description: 'The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).',
serialize: identity,
parseValue: identity,
parseLiteral,
specifiedByURL,
specifiedByUrl: specifiedByURL,
extensions: {
codegenScalarType: 'any',
},
};
export const GraphQLJSON = /*#__PURE__*/ new GraphQLScalarType(GraphQLJSONConfig);

View File

@@ -0,0 +1,28 @@
import { formatDistance } from "./hi/_lib/formatDistance.mjs";
import { formatLong } from "./hi/_lib/formatLong.mjs";
import { formatRelative } from "./hi/_lib/formatRelative.mjs";
import { localize } from "./hi/_lib/localize.mjs";
import { match } from "./hi/_lib/match.mjs";
/**
* @category Locales
* @summary Hindi locale (India).
* @language Hindi
* @iso-639-2 hin
* @author Mukesh Mandiwal [@mukeshmandiwal](https://github.com/mukeshmandiwal)
*/
export const hi = {
code: "hi",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default hi;

View File

@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Or, please add a minimal code snippet to reproduce the issue, for example in [codesandbox](https://codesandbox.io/).
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help to explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,28 @@
/**
* @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 BookHeart = createLucideIcon("BookHeart", [
[
"path",
{
d: "M16 8.2A2.22 2.22 0 0 0 13.8 6c-.8 0-1.4.3-1.8.9-.4-.6-1-.9-1.8-.9A2.22 2.22 0 0 0 8 8.2c0 .6.3 1.2.7 1.6A226.652 226.652 0 0 0 12 13a404 404 0 0 0 3.3-3.1 2.413 2.413 0 0 0 .7-1.7",
key: "1t75a8"
}
],
[
"path",
{
d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
key: "k3hazp"
}
]
]);
export { BookHeart as default };
//# sourceMappingURL=book-heart.js.map

View File

@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert(require('../math'));

View File

@@ -0,0 +1 @@
{"version":3,"file":"list-minus.js","sources":["../../../src/icons/list-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ListMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEgMTJIMyIgLz4KICA8cGF0aCBkPSJNMTYgNkgzIiAvPgogIDxwYXRoIGQ9Ik0xNiAxOEgzIiAvPgogIDxwYXRoIGQ9Ik0yMSAxMmgtNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/list-minus\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 ListMinus = createLucideIcon('ListMinus', [\n ['path', { d: 'M11 12H3', key: '51ecnj' }],\n ['path', { d: 'M16 6H3', key: '1wxfjs' }],\n ['path', { d: 'M16 18H3', key: '12xzn7' }],\n ['path', { d: 'M21 12h-6', key: 'bt1uis' }],\n]);\n\nexport default ListMinus;\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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,17 @@
import { LRUMap } from '@sentry/core';
/**
* Cache for ISR/SSG route checks. Exported for testing purposes.
* @internal
*/
export declare const IS_ISR_SSG_ROUTE_CACHE: LRUMap<string, boolean>;
/**
* Check if the current page is an ISR/SSG route by checking the route manifest.
* @internal Exported for testing purposes.
*/
export declare function isIsrSsgRoute(pathname: string): boolean;
/**
* Remove sentry-trace and baggage meta tags from the DOM if this is an ISR/SSG page.
* This prevents the browser tracing integration from using stale/cached trace IDs.
*/
export declare function removeIsrSsgTraceMetaTags(): void;
//# sourceMappingURL=isrRoutingTracing.d.ts.map

View File

@@ -0,0 +1 @@
Prism.languages.haxe=Prism.languages.extend("clike",{string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},"class-name":[{pattern:/(\b(?:abstract|class|enum|extends|implements|interface|new|typedef)\s+)[A-Z_]\w*/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|final|for|from|function|if|implements|import|in|inline|interface|macro|new|null|operator|overload|override|package|private|public|return|static|super|switch|throw|to|try|typedef|untyped|using|var|while)(?!\.)\b/,function:{pattern:/\b[a-z_]\w*(?=\s*(?:<[^<>]*>\s*)?\()/i,greedy:!0},operator:/\.{3}|\+\+|--|&&|\|\||->|=>|(?:<<?|>{1,3}|[-+*/%!=&|^])=?|[?:~]/}),Prism.languages.insertBefore("haxe","string",{"string-interpolation":{pattern:/'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^{}]+\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:Prism.languages.haxe}}},string:/[\s\S]+/}}}),Prism.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[a-z]*/,greedy:!0,inside:{"regex-flags":/\b[a-z]+$/,"regex-source":{pattern:/^(~\/)[\s\S]+(?=\/$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^~\/|\/$/}}}),Prism.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#(?:else|elseif|end|if)\b.*/,alias:"property"},metadata:{pattern:/@:?[\w.]+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"important"}});

View File

@@ -0,0 +1,121 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.stripIgnoredCharacters = stripIgnoredCharacters;
var _blockString = require('../language/blockString.js');
var _lexer = require('../language/lexer.js');
var _source = require('../language/source.js');
var _tokenKind = require('../language/tokenKind.js');
/**
* Strips characters that are not significant to the validity or execution
* of a GraphQL document:
* - UnicodeBOM
* - WhiteSpace
* - LineTerminator
* - Comment
* - Comma
* - BlockString indentation
*
* Note: It is required to have a delimiter character between neighboring
* non-punctuator tokens and this function always uses single space as delimiter.
*
* It is guaranteed that both input and output documents if parsed would result
* in the exact same AST except for nodes location.
*
* Warning: It is guaranteed that this function will always produce stable results.
* However, it's not guaranteed that it will stay the same between different
* releases due to bugfixes or changes in the GraphQL specification.
*
* Query example:
*
* ```graphql
* query SomeQuery($foo: String!, $bar: String) {
* someField(foo: $foo, bar: $bar) {
* a
* b {
* c
* d
* }
* }
* }
* ```
*
* Becomes:
*
* ```graphql
* query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}}
* ```
*
* SDL example:
*
* ```graphql
* """
* Type description
* """
* type Foo {
* """
* Field description
* """
* bar: String
* }
* ```
*
* Becomes:
*
* ```graphql
* """Type description""" type Foo{"""Field description""" bar:String}
* ```
*/
function stripIgnoredCharacters(source) {
const sourceObj = (0, _source.isSource)(source)
? source
: new _source.Source(source);
const body = sourceObj.body;
const lexer = new _lexer.Lexer(sourceObj);
let strippedBody = '';
let wasLastAddedTokenNonPunctuator = false;
while (lexer.advance().kind !== _tokenKind.TokenKind.EOF) {
const currentToken = lexer.token;
const tokenKind = currentToken.kind;
/**
* Every two non-punctuator tokens should have space between them.
* Also prevent case of non-punctuator token following by spread resulting
* in invalid token (e.g. `1...` is invalid Float token).
*/
const isNonPunctuator = !(0, _lexer.isPunctuatorTokenKind)(
currentToken.kind,
);
if (wasLastAddedTokenNonPunctuator) {
if (
isNonPunctuator ||
currentToken.kind === _tokenKind.TokenKind.SPREAD
) {
strippedBody += ' ';
}
}
const tokenBody = body.slice(currentToken.start, currentToken.end);
if (tokenKind === _tokenKind.TokenKind.BLOCK_STRING) {
strippedBody += (0, _blockString.printBlockString)(currentToken.value, {
minimize: true,
});
} else {
strippedBody += tokenBody;
}
wasLastAddedTokenNonPunctuator = isNonPunctuator;
}
return strippedBody;
}

View File

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

View File

@@ -0,0 +1,848 @@
/**
* @license React
* react.react-server.development.js
*
* 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";
"production" !== process.env.NODE_ENV &&
(function () {
function noop() {}
function getIteratorFn(maybeIterable) {
if (null === maybeIterable || "object" !== typeof maybeIterable)
return null;
maybeIterable =
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
maybeIterable["@@iterator"];
return "function" === typeof maybeIterable ? maybeIterable : null;
}
function testStringCoercion(value) {
return "" + value;
}
function checkKeyStringCoercion(value) {
try {
testStringCoercion(value);
var JSCompiler_inline_result = !1;
} catch (e) {
JSCompiler_inline_result = !0;
}
if (JSCompiler_inline_result) {
JSCompiler_inline_result = console;
var JSCompiler_temp_const = JSCompiler_inline_result.error;
var JSCompiler_inline_result$jscomp$0 =
("function" === typeof Symbol &&
Symbol.toStringTag &&
value[Symbol.toStringTag]) ||
value.constructor.name ||
"Object";
JSCompiler_temp_const.call(
JSCompiler_inline_result,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
JSCompiler_inline_result$jscomp$0
);
return testStringCoercion(value);
}
}
function getComponentNameFromType(type) {
if (null == type) return null;
if ("function" === typeof type)
return type.$$typeof === REACT_CLIENT_REFERENCE
? null
: type.displayName || type.name || null;
if ("string" === typeof type) return type;
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
case REACT_ACTIVITY_TYPE:
return "Activity";
}
if ("object" === typeof type)
switch (
("number" === typeof type.tag &&
console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
),
type.$$typeof)
) {
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_CONTEXT_TYPE:
return type.displayName || "Context";
case REACT_CONSUMER_TYPE:
return (type._context.displayName || "Context") + ".Consumer";
case REACT_FORWARD_REF_TYPE:
var innerType = type.render;
type = type.displayName;
type ||
((type = innerType.displayName || innerType.name || ""),
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
return type;
case REACT_MEMO_TYPE:
return (
(innerType = type.displayName || null),
null !== innerType
? innerType
: getComponentNameFromType(type.type) || "Memo"
);
case REACT_LAZY_TYPE:
innerType = type._payload;
type = type._init;
try {
return getComponentNameFromType(type(innerType));
} catch (x) {}
}
return null;
}
function getTaskName(type) {
if (type === REACT_FRAGMENT_TYPE) return "<>";
if (
"object" === typeof type &&
null !== type &&
type.$$typeof === REACT_LAZY_TYPE
)
return "<...>";
try {
var name = getComponentNameFromType(type);
return name ? "<" + name + ">" : "<...>";
} catch (x) {
return "<...>";
}
}
function getOwner() {
var dispatcher = ReactSharedInternals.A;
return null === dispatcher ? null : dispatcher.getOwner();
}
function UnknownOwner() {
return Error("react-stack-top-frame");
}
function hasValidKey(config) {
if (hasOwnProperty.call(config, "key")) {
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
if (getter && getter.isReactWarning) return !1;
}
return void 0 !== config.key;
}
function defineKeyPropWarningGetter(props, displayName) {
function warnAboutAccessingKey() {
specialPropKeyWarningShown ||
((specialPropKeyWarningShown = !0),
console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
displayName
));
}
warnAboutAccessingKey.isReactWarning = !0;
Object.defineProperty(props, "key", {
get: warnAboutAccessingKey,
configurable: !0
});
}
function elementRefGetterWithDeprecationWarning() {
var componentName = getComponentNameFromType(this.type);
didWarnAboutElementRef[componentName] ||
((didWarnAboutElementRef[componentName] = !0),
console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
));
componentName = this.props.ref;
return void 0 !== componentName ? componentName : null;
}
function ReactElement(type, key, props, owner, debugStack, debugTask) {
var refProp = props.ref;
type = {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
props: props,
_owner: owner
};
null !== (void 0 !== refProp ? refProp : null)
? Object.defineProperty(type, "ref", {
enumerable: !1,
get: elementRefGetterWithDeprecationWarning
})
: Object.defineProperty(type, "ref", { enumerable: !1, value: null });
type._store = {};
Object.defineProperty(type._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
});
Object.defineProperty(type, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
});
Object.defineProperty(type, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: debugStack
});
Object.defineProperty(type, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: debugTask
});
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
return type;
}
function cloneAndReplaceKey(oldElement, newKey) {
newKey = ReactElement(
oldElement.type,
newKey,
oldElement.props,
oldElement._owner,
oldElement._debugStack,
oldElement._debugTask
);
oldElement._store &&
(newKey._store.validated = oldElement._store.validated);
return newKey;
}
function validateChildKeys(node) {
isValidElement(node)
? node._store && (node._store.validated = 1)
: "object" === typeof node &&
null !== node &&
node.$$typeof === REACT_LAZY_TYPE &&
("fulfilled" === node._payload.status
? isValidElement(node._payload.value) &&
node._payload.value._store &&
(node._payload.value._store.validated = 1)
: node._store && (node._store.validated = 1));
}
function isValidElement(object) {
return (
"object" === typeof object &&
null !== object &&
object.$$typeof === REACT_ELEMENT_TYPE
);
}
function escape(key) {
var escaperLookup = { "=": "=0", ":": "=2" };
return (
"$" +
key.replace(/[=:]/g, function (match) {
return escaperLookup[match];
})
);
}
function getElementKey(element, index) {
return "object" === typeof element &&
null !== element &&
null != element.key
? (checkKeyStringCoercion(element.key), escape("" + element.key))
: index.toString(36);
}
function resolveThenable(thenable) {
switch (thenable.status) {
case "fulfilled":
return thenable.value;
case "rejected":
throw thenable.reason;
default:
switch (
("string" === typeof thenable.status
? thenable.then(noop, noop)
: ((thenable.status = "pending"),
thenable.then(
function (fulfilledValue) {
"pending" === thenable.status &&
((thenable.status = "fulfilled"),
(thenable.value = fulfilledValue));
},
function (error) {
"pending" === thenable.status &&
((thenable.status = "rejected"),
(thenable.reason = error));
}
)),
thenable.status)
) {
case "fulfilled":
return thenable.value;
case "rejected":
throw thenable.reason;
}
}
throw thenable;
}
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
var type = typeof children;
if ("undefined" === type || "boolean" === type) children = null;
var invokeCallback = !1;
if (null === children) invokeCallback = !0;
else
switch (type) {
case "bigint":
case "string":
case "number":
invokeCallback = !0;
break;
case "object":
switch (children.$$typeof) {
case REACT_ELEMENT_TYPE:
case REACT_PORTAL_TYPE:
invokeCallback = !0;
break;
case REACT_LAZY_TYPE:
return (
(invokeCallback = children._init),
mapIntoArray(
invokeCallback(children._payload),
array,
escapedPrefix,
nameSoFar,
callback
)
);
}
}
if (invokeCallback) {
invokeCallback = children;
callback = callback(invokeCallback);
var childKey =
"" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
isArrayImpl(callback)
? ((escapedPrefix = ""),
null != childKey &&
(escapedPrefix =
childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
mapIntoArray(callback, array, escapedPrefix, "", function (c) {
return c;
}))
: null != callback &&
(isValidElement(callback) &&
(null != callback.key &&
((invokeCallback && invokeCallback.key === callback.key) ||
checkKeyStringCoercion(callback.key)),
(escapedPrefix = cloneAndReplaceKey(
callback,
escapedPrefix +
(null == callback.key ||
(invokeCallback && invokeCallback.key === callback.key)
? ""
: ("" + callback.key).replace(
userProvidedKeyEscapeRegex,
"$&/"
) + "/") +
childKey
)),
"" !== nameSoFar &&
null != invokeCallback &&
isValidElement(invokeCallback) &&
null == invokeCallback.key &&
invokeCallback._store &&
!invokeCallback._store.validated &&
(escapedPrefix._store.validated = 2),
(callback = escapedPrefix)),
array.push(callback));
return 1;
}
invokeCallback = 0;
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
if (isArrayImpl(children))
for (var i = 0; i < children.length; i++)
(nameSoFar = children[i]),
(type = childKey + getElementKey(nameSoFar, i)),
(invokeCallback += mapIntoArray(
nameSoFar,
array,
escapedPrefix,
type,
callback
));
else if (((i = getIteratorFn(children)), "function" === typeof i))
for (
i === children.entries &&
(didWarnAboutMaps ||
console.warn(
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
),
(didWarnAboutMaps = !0)),
children = i.call(children),
i = 0;
!(nameSoFar = children.next()).done;
)
(nameSoFar = nameSoFar.value),
(type = childKey + getElementKey(nameSoFar, i++)),
(invokeCallback += mapIntoArray(
nameSoFar,
array,
escapedPrefix,
type,
callback
));
else if ("object" === type) {
if ("function" === typeof children.then)
return mapIntoArray(
resolveThenable(children),
array,
escapedPrefix,
nameSoFar,
callback
);
array = String(children);
throw Error(
"Objects are not valid as a React child (found: " +
("[object Object]" === array
? "object with keys {" + Object.keys(children).join(", ") + "}"
: array) +
"). If you meant to render a collection of children, use an array instead."
);
}
return invokeCallback;
}
function mapChildren(children, func, context) {
if (null == children) return children;
var result = [],
count = 0;
mapIntoArray(children, result, "", "", function (child) {
return func.call(context, child, count++);
});
return result;
}
function resolveDispatcher() {
var dispatcher = ReactSharedInternals.H;
null === dispatcher &&
console.error(
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
);
return dispatcher;
}
function lazyInitializer(payload) {
if (-1 === payload._status) {
var ioInfo = payload._ioInfo;
null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
ioInfo = payload._result;
var thenable = ioInfo();
thenable.then(
function (moduleObject) {
if (0 === payload._status || -1 === payload._status) {
payload._status = 1;
payload._result = moduleObject;
var _ioInfo = payload._ioInfo;
null != _ioInfo && (_ioInfo.end = performance.now());
void 0 === thenable.status &&
((thenable.status = "fulfilled"),
(thenable.value = moduleObject));
}
},
function (error) {
if (0 === payload._status || -1 === payload._status) {
payload._status = 2;
payload._result = error;
var _ioInfo2 = payload._ioInfo;
null != _ioInfo2 && (_ioInfo2.end = performance.now());
void 0 === thenable.status &&
((thenable.status = "rejected"), (thenable.reason = error));
}
}
);
ioInfo = payload._ioInfo;
if (null != ioInfo) {
ioInfo.value = thenable;
var displayName = thenable.displayName;
"string" === typeof displayName && (ioInfo.name = displayName);
}
-1 === payload._status &&
((payload._status = 0), (payload._result = thenable));
}
if (1 === payload._status)
return (
(ioInfo = payload._result),
void 0 === ioInfo &&
console.error(
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
ioInfo
),
"default" in ioInfo ||
console.error(
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
ioInfo
),
ioInfo.default
);
throw payload._result;
}
function createCacheRoot() {
return new WeakMap();
}
function createCacheNode() {
return { s: 0, v: void 0, o: null, p: null };
}
var ReactSharedInternals = {
H: null,
A: null,
getCurrentStack: null,
recentlyCreatedOwnerStacks: 0
},
isArrayImpl = Array.isArray,
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
hasOwnProperty = Object.prototype.hasOwnProperty,
assign = Object.assign,
createTask = console.createTask
? console.createTask
: function () {
return null;
},
createFakeCallStack = {
react_stack_bottom_frame: function (callStackForError) {
return callStackForError();
}
},
specialPropKeyWarningShown,
didWarnAboutOldJSXRuntime;
var didWarnAboutElementRef = {};
var unknownOwnerDebugStack =
createFakeCallStack.react_stack_bottom_frame.bind(
createFakeCallStack,
UnknownOwner
)();
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
var didWarnAboutMaps = !1,
userProvidedKeyEscapeRegex = /\/+/g;
exports.Children = {
map: mapChildren,
forEach: function (children, forEachFunc, forEachContext) {
mapChildren(
children,
function () {
forEachFunc.apply(this, arguments);
},
forEachContext
);
},
count: function (children) {
var n = 0;
mapChildren(children, function () {
n++;
});
return n;
},
toArray: function (children) {
return (
mapChildren(children, function (child) {
return child;
}) || []
);
},
only: function (children) {
if (!isValidElement(children))
throw Error(
"React.Children.only expected to receive a single React element child."
);
return children;
}
};
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.Profiler = REACT_PROFILER_TYPE;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
ReactSharedInternals;
exports.cache = function (fn) {
return function () {
var dispatcher = ReactSharedInternals.A;
if (!dispatcher) return fn.apply(null, arguments);
var fnMap = dispatcher.getCacheForType(createCacheRoot);
dispatcher = fnMap.get(fn);
void 0 === dispatcher &&
((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher));
fnMap = 0;
for (var l = arguments.length; fnMap < l; fnMap++) {
var arg = arguments[fnMap];
if (
"function" === typeof arg ||
("object" === typeof arg && null !== arg)
) {
var objectCache = dispatcher.o;
null === objectCache &&
(dispatcher.o = objectCache = new WeakMap());
dispatcher = objectCache.get(arg);
void 0 === dispatcher &&
((dispatcher = createCacheNode()),
objectCache.set(arg, dispatcher));
} else
(objectCache = dispatcher.p),
null === objectCache && (dispatcher.p = objectCache = new Map()),
(dispatcher = objectCache.get(arg)),
void 0 === dispatcher &&
((dispatcher = createCacheNode()),
objectCache.set(arg, dispatcher));
}
if (1 === dispatcher.s) return dispatcher.v;
if (2 === dispatcher.s) throw dispatcher.v;
try {
var result = fn.apply(null, arguments);
fnMap = dispatcher;
fnMap.s = 1;
return (fnMap.v = result);
} catch (error) {
throw (
((result = dispatcher), (result.s = 2), (result.v = error), error)
);
}
};
};
exports.cacheSignal = function () {
var dispatcher = ReactSharedInternals.A;
return dispatcher ? dispatcher.cacheSignal() : null;
};
exports.captureOwnerStack = function () {
var getCurrentStack = ReactSharedInternals.getCurrentStack;
return null === getCurrentStack ? null : getCurrentStack();
};
exports.cloneElement = function (element, config, children) {
if (null === element || void 0 === element)
throw Error(
"The argument must be a React element, but you passed " +
element +
"."
);
var props = assign({}, element.props),
key = element.key,
owner = element._owner;
if (null != config) {
var JSCompiler_inline_result;
a: {
if (
hasOwnProperty.call(config, "ref") &&
(JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
config,
"ref"
).get) &&
JSCompiler_inline_result.isReactWarning
) {
JSCompiler_inline_result = !1;
break a;
}
JSCompiler_inline_result = void 0 !== config.ref;
}
JSCompiler_inline_result && (owner = getOwner());
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (key = "" + config.key));
for (propName in config)
!hasOwnProperty.call(config, propName) ||
"key" === propName ||
"__self" === propName ||
"__source" === propName ||
("ref" === propName && void 0 === config.ref) ||
(props[propName] = config[propName]);
}
var propName = arguments.length - 2;
if (1 === propName) props.children = children;
else if (1 < propName) {
JSCompiler_inline_result = Array(propName);
for (var i = 0; i < propName; i++)
JSCompiler_inline_result[i] = arguments[i + 2];
props.children = JSCompiler_inline_result;
}
props = ReactElement(
element.type,
key,
props,
owner,
element._debugStack,
element._debugTask
);
for (key = 2; key < arguments.length; key++)
validateChildKeys(arguments[key]);
return props;
};
exports.createElement = function (type, config, children) {
for (var i = 2; i < arguments.length; i++)
validateChildKeys(arguments[i]);
i = {};
var key = null;
if (null != config)
for (propName in (didWarnAboutOldJSXRuntime ||
!("__self" in config) ||
"key" in config ||
((didWarnAboutOldJSXRuntime = !0),
console.warn(
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
)),
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (key = "" + config.key)),
config))
hasOwnProperty.call(config, propName) &&
"key" !== propName &&
"__self" !== propName &&
"__source" !== propName &&
(i[propName] = config[propName]);
var childrenLength = arguments.length - 2;
if (1 === childrenLength) i.children = children;
else if (1 < childrenLength) {
for (
var childArray = Array(childrenLength), _i = 0;
_i < childrenLength;
_i++
)
childArray[_i] = arguments[_i + 2];
Object.freeze && Object.freeze(childArray);
i.children = childArray;
}
if (type && type.defaultProps)
for (propName in ((childrenLength = type.defaultProps), childrenLength))
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
key &&
defineKeyPropWarningGetter(
i,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type
);
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
return ReactElement(
type,
key,
i,
getOwner(),
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
);
};
exports.createRef = function () {
var refObject = { current: null };
Object.seal(refObject);
return refObject;
};
exports.forwardRef = function (render) {
null != render && render.$$typeof === REACT_MEMO_TYPE
? console.error(
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
)
: "function" !== typeof render
? console.error(
"forwardRef requires a render function but was given %s.",
null === render ? "null" : typeof render
)
: 0 !== render.length &&
2 !== render.length &&
console.error(
"forwardRef render functions accept exactly two parameters: props and ref. %s",
1 === render.length
? "Did you forget to use the ref parameter?"
: "Any additional parameter will be undefined."
);
null != render &&
null != render.defaultProps &&
console.error(
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
);
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
ownName;
Object.defineProperty(elementType, "displayName", {
enumerable: !1,
configurable: !0,
get: function () {
return ownName;
},
set: function (name) {
ownName = name;
render.name ||
render.displayName ||
(Object.defineProperty(render, "name", { value: name }),
(render.displayName = name));
}
});
return elementType;
};
exports.isValidElement = isValidElement;
exports.lazy = function (ctor) {
ctor = { _status: -1, _result: ctor };
var lazyType = {
$$typeof: REACT_LAZY_TYPE,
_payload: ctor,
_init: lazyInitializer
},
ioInfo = {
name: "lazy",
start: -1,
end: -1,
value: null,
owner: null,
debugStack: Error("react-stack-top-frame"),
debugTask: console.createTask ? console.createTask("lazy()") : null
};
ctor._ioInfo = ioInfo;
lazyType._debugInfo = [{ awaited: ioInfo }];
return lazyType;
};
exports.memo = function (type, compare) {
null == type &&
console.error(
"memo: The first argument must be a component. Instead received: %s",
null === type ? "null" : typeof type
);
compare = {
$$typeof: REACT_MEMO_TYPE,
type: type,
compare: void 0 === compare ? null : compare
};
var ownName;
Object.defineProperty(compare, "displayName", {
enumerable: !1,
configurable: !0,
get: function () {
return ownName;
},
set: function (name) {
ownName = name;
type.name ||
type.displayName ||
(Object.defineProperty(type, "name", { value: name }),
(type.displayName = name));
}
});
return compare;
};
exports.use = function (usable) {
return resolveDispatcher().use(usable);
};
exports.useCallback = function (callback, deps) {
return resolveDispatcher().useCallback(callback, deps);
};
exports.useDebugValue = function (value, formatterFn) {
return resolveDispatcher().useDebugValue(value, formatterFn);
};
exports.useId = function () {
return resolveDispatcher().useId();
};
exports.useMemo = function (create, deps) {
return resolveDispatcher().useMemo(create, deps);
};
exports.version = "19.2.4";
})();

View File

@@ -0,0 +1,131 @@
import _ = require("../index");
declare module "../index" {
// clamp
interface LoDashStatic {
/**
* Clamps `number` within the inclusive `lower` and `upper` bounds.
*
* @category Number
* @param number The number to clamp.
* @param [lower] The lower bound.
* @param upper The upper bound.
* @returns Returns the clamped number.
* @example
*
* _.clamp(-10, -5, 5);
* // => -5
*
* _.clamp(10, -5, 5);
* // => 5
* Clamps `number` within the inclusive `lower` and `upper` bounds.
*
* @category Number
* @param number The number to clamp.
* @param [lower] The lower bound.
* @param upper The upper bound.
* @returns Returns the clamped number.
* @example
*
* _.clamp(-10, -5, 5);
* // => -5
*
* _.clamp(10, -5, 5);
*/
clamp(number: number, lower: number, upper: number): number;
/**
* @see _.clamp
*/
clamp(number: number, upper: number): number;
}
interface LoDashImplicitWrapper<TValue> {
/**
* @see _.clamp
*/
clamp(lower: number, upper: number): number;
/**
* @see _.clamp
*/
clamp(upper: number): number;
}
interface LoDashExplicitWrapper<TValue> {
/**
* @see _.clamp
*/
clamp(lower: number, upper: number): PrimitiveChain<number>;
/**
* @see _.clamp
*/
clamp(upper: number): PrimitiveChain<number>;
}
// inRange
interface LoDashStatic {
/**
* Checks if n is between start and up to but not including, end. If end is not specified its set to start
* with start then set to 0.
*
* @param n The number to check.
* @param start The start of the range.
* @param end The end of the range.
* @return Returns true if n is in the range, else false.
*/
inRange(n: number, start: number, end?: number): boolean;
}
interface LoDashImplicitWrapper<TValue> {
/**
* @see _.inRange
*/
inRange(start: number, end?: number): boolean;
}
interface LoDashExplicitWrapper<TValue> {
/**
* @see _.inRange
*/
inRange(start: number, end?: number): PrimitiveChain<boolean>;
}
// random
interface LoDashStatic {
/**
* Produces a random number between min and max (inclusive). If only one argument is provided a number between
* 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point
* number is returned instead of an integer.
*
* @param min The minimum possible value.
* @param max The maximum possible value.
* @param floating Specify returning a floating-point number.
* @return Returns the random number.
*/
random(floating?: boolean): number;
/**
* @see _.random
*/
random(max: number, floating?: boolean): number;
/**
* @see _.random
*/
random(min: number, max: number, floating?: boolean): number;
/**
* @see _.random
*/
random(min: number, index: string | number, guard: object): number;
}
interface LoDashImplicitWrapper<TValue> {
/**
* @see _.random
*/
random(floating?: boolean): number;
/**
* @see _.random
*/
random(max: number, floating?: boolean): number;
}
interface LoDashExplicitWrapper<TValue> {
/**
* @see _.random
*/
random(floating?: boolean): PrimitiveChain<number>;
/**
* @see _.random
*/
random(max: number, floating?: boolean): PrimitiveChain<number>;
}
}

View File

@@ -0,0 +1,82 @@
import { Parser } from "../Parser.js";
import { parseNDigits } from "../utils.js";
export class StandAloneQuarterParser extends Parser {
priority = 120;
parse(dateString, token, match) {
switch (token) {
// 1, 2, 3, 4
case "q":
case "qq": // 01, 02, 03, 04
return parseNDigits(token.length, dateString);
// 1st, 2nd, 3rd, 4th
case "qo":
return match.ordinalNumber(dateString, { unit: "quarter" });
// Q1, Q2, Q3, Q4
case "qqq":
return (
match.quarter(dateString, {
width: "abbreviated",
context: "standalone",
}) ||
match.quarter(dateString, {
width: "narrow",
context: "standalone",
})
);
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
case "qqqqq":
return match.quarter(dateString, {
width: "narrow",
context: "standalone",
});
// 1st quarter, 2nd quarter, ...
case "qqqq":
default:
return (
match.quarter(dateString, {
width: "wide",
context: "standalone",
}) ||
match.quarter(dateString, {
width: "abbreviated",
context: "standalone",
}) ||
match.quarter(dateString, {
width: "narrow",
context: "standalone",
})
);
}
}
validate(_date, value) {
return value >= 1 && value <= 4;
}
set(date, _flags, value) {
date.setMonth((value - 1) * 3, 1);
date.setHours(0, 0, 0, 0);
return date;
}
incompatibleTokens = [
"Y",
"R",
"Q",
"M",
"L",
"w",
"I",
"d",
"D",
"i",
"e",
"c",
"t",
"T",
];
}

View File

@@ -0,0 +1 @@
import{cloneElement as e,isValidElement as t}from"react";import r from"use-intl/format-message";import{I as n,a as o,c as a,b as s}from"./formatters-CJcico0N.js";function c(...e){return e.filter(Boolean).join(".")}function i(e){return c(e.namespace,e.key)}function u(e){console.error(e)}function m(e,t,r,n){const o=c(n,r);if(!t)throw new Error(o);let a=t;return r.split(".").forEach((t=>{const r=a[t];if(null==t||null==r)throw new Error(o+` (${e})`);a=r})),a}function f(a){const s=function(e,t,r){try{if(!t)throw new Error(void 0);const n=r?m(e,t,r):t;if(!n)throw new Error(r);return n}catch(e){return new n(o.MISSING_MESSAGE,e.message)}}(a.locale,a.messages,a.namespace);return function({cache:a,formats:s,formatters:u,getMessageFallback:f=i,locale:l,messagesOrError:g,namespace:y,onError:h,timeZone:w}){const E=g instanceof n;function S(e,t,r,o){const a=new n(t,r);return h(a),o??f({error:a,key:e,namespace:y})}function d(i,d,p,M){const T=M;let R;if(E){if(!T)return h(g),f({error:g,key:i,namespace:y});R=T}else{const e=g;try{R=m(l,e,i,y)}catch(e){if(!T)return S(i,o.MISSING_MESSAGE,e.message,T);R=T}}try{const n=c(y,i);return r(n,R,d?function(r){const n={};return Object.keys(r).forEach((o=>{let a=0;const s=r[o];let c;c="function"==typeof s?r=>{const n=s(r);return t(n)?e(n,{key:o+a++}):n}:s,n[o]=c})),n}(d):d,{cache:a,formatters:u,globalFormats:s,formats:p,locale:l,timeZone:w})}catch(e){let t,r;return e instanceof n?(t=e.code,r=e.originalMessage):(t=o.FORMATTING_ERROR,r=e.message),S(i,t,r,T)}}function p(e,t,r,n){const a=d(e,t,r,n);return"string"!=typeof a?S(e,o.INVALID_MESSAGE,void 0):a}return p.rich=d,p.markup=(e,t,r,n)=>d(e,t,r,n),p.raw=e=>{if(E)return h(g),f({error:g,key:e,namespace:y});const t=g;try{return m(l,t,e,y)}catch(t){return S(e,o.MISSING_MESSAGE,t.message)}},p.has=e=>{if(E)return!1;try{return m(l,g,e,y),!0}catch{return!1}},p}({...a,messagesOrError:s})}function l(e,t){return e===t?void 0:e.slice((t+".").length)}const g=3600,y=86400,h=7*y,w=2628e3,E=7884e3,S=365*y,d={second:1,seconds:1,minute:60,minutes:60,hour:g,hours:g,day:y,days:y,week:h,weeks:h,month:w,months:w,quarter:E,quarters:E,year:S,years:S};function p(e){const{_cache:t=s(),_formatters:r=a(t),formats:c,locale:i,onError:m=u,timeZone:f}=e;function l(e){return e?.timeZone||(f?e={...e,timeZone:f}:m(new n(o.ENVIRONMENT_FALLBACK,void 0))),e}function E(e,t,r,a,s){let c;try{c=function(e,t,r){let a;if("string"==typeof t){const r=t;if(a=e?.[r],!a){const e=new n(o.MISSING_FORMAT,void 0);throw m(e),e}}else a=t;return r&&(a={...a,...r}),a}(r,e,t)}catch{return s()}try{return a(c)}catch(e){return m(new n(o.FORMATTING_ERROR,e.message)),s()}}function p(e,t,n){return E(t,n,c?.dateTime,(t=>(t=l(t),r.getDateTimeFormat(i,t).format(e))),(()=>String(e)))}function M(){return e.now?e.now:(m(new n(o.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:p,number:function(e,t,n){return E(t,n,c?.number,(t=>r.getNumberFormat(i,t).format(e)),(()=>String(e)))},relativeTime:function(e,t){try{let n,o;const a={};t instanceof Date||"number"==typeof t?n=new Date(t):t&&(n=null!=t.now?new Date(t.now):M(),o=t.unit,a.style=t.style,a.numberingSystem=t.numberingSystem),n||(n=M());const s=(new Date(e).getTime()-n.getTime())/1e3;o||(o=function(e){const t=Math.abs(e);return t<60?"second":t<g?"minute":t<y?"hour":t<h?"day":t<w?"week":t<S?"month":"year"}(s)),a.numeric="second"===o?"auto":"always";const c=function(e,t){return Math.round(e/d[t])}(s,o);return r.getRelativeTimeFormat(i,a).format(c,o)}catch(t){return m(new n(o.FORMATTING_ERROR,t.message)),String(e)}},list:function(e,t,n){const o=[],a=new Map;let s=0;for(const t of e){let e;"object"==typeof t?(e=String(s),a.set(e,t)):e=String(t),o.push(e),s++}return E(t,n,c?.list,(e=>{const t=r.getListFormat(i,e).formatToParts(o).map((e=>"literal"===e.type?e.value:a.get(e.value)||e.value));return a.size>0?t:t.join("")}),(()=>String(e)))},dateTimeRange:function(e,t,n,o){return E(n,o,c?.dateTime,(n=>(n=l(n),r.getDateTimeFormat(i,n).formatRange(e,t))),(()=>[p(e),p(t)].join("")))}}}function M({formats:e,getMessageFallback:t,messages:r,onError:n,...o}){return{...o,formats:e||void 0,messages:r||void 0,onError:n||u,getMessageFallback:t||i}}export{f as a,u as b,p as c,i as d,M as i,l as r};

View File

@@ -0,0 +1 @@
{"version":3,"file":"_error.js","sources":["../../../../src/common/pages-router-instrumentation/_error.ts"],"sourcesContent":["import { captureException, httpRequestToRequestData, withScope } from '@sentry/core';\nimport type { NextPageContext } from 'next';\nimport { flushSafelyWithTimeout, waitUntil } from '../utils/responseEnd';\n\ntype ContextOrProps = {\n req?: NextPageContext['req'];\n res?: NextPageContext['res'];\n err?: NextPageContext['err'] | string;\n pathname?: string;\n statusCode?: number;\n};\n\n/**\n * Capture the exception passed by nextjs to the `_error` page, adding context data as appropriate.\n *\n * This will not capture the exception if the status code is < 500 or if the pathname is not provided and will thus not return an event ID.\n *\n * @param contextOrProps The data passed to either `getInitialProps` or `render` by nextjs\n * @returns The Sentry event ID, or `undefined` if no event was captured\n */\nexport async function captureUnderscoreErrorException(contextOrProps: ContextOrProps): Promise<string | undefined> {\n const { req, res, err } = contextOrProps;\n\n // 404s (and other 400-y friends) can trigger `_error`, but we don't want to send them to Sentry\n const statusCode = res?.statusCode || contextOrProps.statusCode;\n if (statusCode && statusCode < 500) {\n return;\n }\n\n // In previous versions of the suggested `_error.js` page in which this function is meant to be used, there was a\n // workaround for https://github.com/vercel/next.js/issues/8592 which involved an extra call to this function, in the\n // custom error component's `render` method, just in case it hadn't been called by `getInitialProps`. Now that that\n // issue has been fixed, the second call is unnecessary, but since it lives in user code rather than our code, users\n // have to be the ones to get rid of it, and guaraneteedly, not all of them will. So, rather than capture the error\n // twice, we just bail if we sense we're in that now-extraneous second call. (We can tell which function we're in\n // because Nextjs passes `pathname` to `getInitialProps` but not to `render`.)\n if (!contextOrProps.pathname) {\n return;\n }\n\n const eventId = withScope(scope => {\n if (req) {\n const normalizedRequest = httpRequestToRequestData(req);\n scope.setSDKProcessingMetadata({ normalizedRequest });\n }\n\n // If third-party libraries (or users themselves) throw something falsy, we want to capture it as a message (which\n // is what passing a string to `captureException` will wind up doing)\n return captureException(err || `_error.js called with falsy error (${err})`, {\n mechanism: {\n type: 'auto.function.nextjs.underscore_error',\n handled: false,\n data: {\n function: '_error.getInitialProps',\n },\n },\n });\n });\n\n waitUntil(flushSafelyWithTimeout());\n\n return eventId;\n}\n"],"names":[],"mappings":";;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,+BAA+B,CAAC,cAAc,EAA+C;AACnH,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAA,EAAI,GAAI,cAAc;;AAE1C;AACA,EAAE,MAAM,aAAa,GAAG,EAAE,UAAA,IAAc,cAAc,CAAC,UAAU;AACjE,EAAE,IAAI,UAAA,IAAc,UAAA,GAAa,GAAG,EAAE;AACtC,IAAI;AACJ,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;AAChC,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,OAAA,GAAU,SAAS,CAAC,SAAS;AACrC,IAAI,IAAI,GAAG,EAAE;AACb,MAAM,MAAM,iBAAA,GAAoB,wBAAwB,CAAC,GAAG,CAAC;AAC7D,MAAM,KAAK,CAAC,wBAAwB,CAAC,EAAE,iBAAA,EAAmB,CAAC;AAC3D,IAAI;;AAEJ;AACA;AACA,IAAI,OAAO,gBAAgB,CAAC,GAAA,IAAO,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;AACjF,MAAM,SAAS,EAAE;AACjB,QAAQ,IAAI,EAAE,uCAAuC;AACrD,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,IAAI,EAAE;AACd,UAAU,QAAQ,EAAE,wBAAwB;AAC5C,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,EAAE,CAAC,CAAC;;AAEJ,EAAE,SAAS,CAAC,sBAAsB,EAAE,CAAC;;AAErC,EAAE,OAAO,OAAO;AAChB;;;;"}

View File

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

View File

@@ -0,0 +1,23 @@
var get = require('./get');
/**
* The base implementation of `_.at` without support for individual paths.
*
* @private
* @param {Object} object The object to iterate over.
* @param {string[]} paths The property paths to pick.
* @returns {Array} Returns the picked elements.
*/
function baseAt(object, paths) {
var index = -1,
length = paths.length,
result = Array(length),
skip = object == null;
while (++index < length) {
result[index] = skip ? undefined : get(object, paths[index]);
}
return result;
}
module.exports = baseAt;

View File

@@ -0,0 +1,201 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const t = require("@webassemblyjs/ast");
const { moduleContextFromModuleAST } = require("@webassemblyjs/ast");
const { decode } = require("@webassemblyjs/wasm-parser");
const Parser = require("../Parser");
const StaticExportsDependency = require("../dependencies/StaticExportsDependency");
const WebAssemblyExportImportedDependency = require("../dependencies/WebAssemblyExportImportedDependency");
const WebAssemblyImportDependency = require("../dependencies/WebAssemblyImportDependency");
/** @typedef {import("@webassemblyjs/ast").ModuleImport} ModuleImport */
/** @typedef {import("../Module").BuildInfo} BuildInfo */
/** @typedef {import("../Module").BuildMeta} BuildMeta */
/** @typedef {import("../Parser").ParserState} ParserState */
/** @typedef {import("../Parser").PreparsedAst} PreparsedAst */
const JS_COMPAT_TYPES = new Set(["i32", "i64", "f32", "f64", "externref"]);
/**
* @param {t.Signature} signature the func signature
* @returns {null | string} the type incompatible with js types
*/
const getJsIncompatibleType = (signature) => {
for (const param of signature.params) {
if (!JS_COMPAT_TYPES.has(param.valtype)) {
return `${param.valtype} as parameter`;
}
}
for (const type of signature.results) {
if (!JS_COMPAT_TYPES.has(type)) return `${type} as result`;
}
return null;
};
/**
* TODO why are there two different Signature types?
* @param {t.FuncSignature} signature the func signature
* @returns {null | string} the type incompatible with js types
*/
const getJsIncompatibleTypeOfFuncSignature = (signature) => {
for (const param of signature.args) {
if (!JS_COMPAT_TYPES.has(param)) {
return `${param} as parameter`;
}
}
for (const type of signature.result) {
if (!JS_COMPAT_TYPES.has(type)) return `${type} as result`;
}
return null;
};
const decoderOpts = {
ignoreCodeSection: true,
ignoreDataSection: true,
// this will avoid having to lookup with identifiers in the ModuleContext
ignoreCustomNameSection: true
};
class WebAssemblyParser extends Parser {
/**
* @param {string | Buffer | PreparsedAst} source the source to parse
* @param {ParserState} state the parser state
* @returns {ParserState} the parser state
*/
parse(source, state) {
if (!Buffer.isBuffer(source)) {
throw new Error("WebAssemblyParser input must be a Buffer");
}
// flag it as ESM
/** @type {BuildInfo} */
(state.module.buildInfo).strict = true;
/** @type {BuildMeta} */
(state.module.buildMeta).exportsType = "namespace";
// parse it
const program = decode(source, decoderOpts);
const module = program.body[0];
const moduleContext = moduleContextFromModuleAST(module);
// extract imports and exports
/** @type {string[]} */
const exports = [];
const buildMeta = /** @type {BuildMeta} */ (state.module.buildMeta);
/** @type {Record<string, string> | undefined} */
let jsIncompatibleExports = (buildMeta.jsIncompatibleExports = undefined);
/** @typedef {ModuleImport | null} ImportNode */
/** @type {ImportNode[]} */
const importedGlobals = [];
t.traverse(module, {
ModuleExport({ node }) {
const descriptor = node.descr;
if (descriptor.exportType === "Func") {
const funcIdx = descriptor.id.value;
/** @type {t.FuncSignature} */
const funcSignature = moduleContext.getFunction(funcIdx);
const incompatibleType =
getJsIncompatibleTypeOfFuncSignature(funcSignature);
if (incompatibleType) {
if (jsIncompatibleExports === undefined) {
jsIncompatibleExports =
/** @type {BuildMeta} */
(state.module.buildMeta).jsIncompatibleExports = {};
}
jsIncompatibleExports[node.name] = incompatibleType;
}
}
exports.push(node.name);
if (node.descr && node.descr.exportType === "Global") {
const refNode = importedGlobals[node.descr.id.value];
if (refNode) {
const dep = new WebAssemblyExportImportedDependency(
node.name,
refNode.module,
refNode.name,
/** @type {string} */
(refNode.descr.valtype)
);
state.module.addDependency(dep);
}
}
},
Global({ node }) {
const init = node.init[0];
/** @type {ImportNode} */
let importNode = null;
if (init.id === "get_global") {
const globalIdx = init.args[0].value;
if (globalIdx < importedGlobals.length) {
importNode = importedGlobals[globalIdx];
}
}
importedGlobals.push(importNode);
},
ModuleImport({ node }) {
/** @type {false | string} */
let onlyDirectImport = false;
if (t.isMemory(node.descr) === true) {
onlyDirectImport = "Memory";
} else if (t.isTable(node.descr) === true) {
onlyDirectImport = "Table";
} else if (t.isFuncImportDescr(node.descr) === true) {
const incompatibleType = getJsIncompatibleType(
/** @type {t.Signature} */
(node.descr.signature)
);
if (incompatibleType) {
onlyDirectImport = `Non-JS-compatible Func Signature (${incompatibleType})`;
}
} else if (t.isGlobalType(node.descr) === true) {
const type = /** @type {string} */ (node.descr.valtype);
if (!JS_COMPAT_TYPES.has(type)) {
onlyDirectImport = `Non-JS-compatible Global Type (${type})`;
}
}
const dep = new WebAssemblyImportDependency(
node.module,
node.name,
node.descr,
onlyDirectImport
);
state.module.addDependency(dep);
if (t.isGlobalType(node.descr)) {
importedGlobals.push(node);
}
}
});
state.module.addDependency(new StaticExportsDependency(exports, false));
return state;
}
}
module.exports = WebAssemblyParser;

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9saWIvbm9uLWVtcHR5LW9iamVjdC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQW55UmVjb3JkIH0gZnJvbSBcIi4uL2FueS1yZWNvcmRcIjtcblxuZXhwb3J0IHR5cGUgTm9uRW1wdHlPYmplY3Q8T2JqZWN0IGV4dGVuZHMgQW55UmVjb3JkPiA9IGtleW9mIE9iamVjdCBleHRlbmRzIG5ldmVyID8gbmV2ZXIgOiBPYmplY3Q7XG4iXX0=

View File

@@ -0,0 +1,3 @@
export * from "./declarations/src/index.js";
export { _default as default } from "./emotion-hash.cjs.default.js";
//# sourceMappingURL=emotion-hash.cjs.d.mts.map

View File

@@ -0,0 +1,5 @@
import type { CodeKeywordDefinition } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
declare const def: CodeKeywordDefinition;
export declare function dynamicRef(cxt: KeywordCxt, ref: string): void;
export default def;

View File

@@ -0,0 +1 @@
{"version":3,"file":"HostDetector.js","sourceRoot":"","sources":["../../../../../src/detectors/platform/node/HostDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAAgF;AAChF,2BAAoC;AAOpC,4DAAyD;AACzD,mCAAwC;AAExC;;;GAGG;AACH,MAAM,YAAY;IAChB,MAAM,CAAC,OAAiC;QACtC,MAAM,UAAU,GAA+B;YAC7C,CAAC,wBAAc,CAAC,EAAE,IAAA,aAAQ,GAAE;YAC5B,CAAC,wBAAc,CAAC,EAAE,IAAA,qBAAa,EAAC,IAAA,SAAI,GAAE,CAAC;YACvC,CAAC,sBAAY,CAAC,EAAE,IAAA,2BAAY,GAAE;SAC/B,CAAC;QAEF,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ATTR_HOST_ARCH, ATTR_HOST_ID, ATTR_HOST_NAME } from '../../../semconv';\nimport { arch, hostname } from 'os';\nimport { ResourceDetectionConfig } from '../../../config';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n ResourceDetector,\n} from '../../../types';\nimport { getMachineId } from './machine-id/getMachineId';\nimport { normalizeArch } from './utils';\n\n/**\n * HostDetector detects the resources related to the host current process is\n * running on. Currently only non-cloud-based attributes are included.\n */\nclass HostDetector implements ResourceDetector {\n detect(_config?: ResourceDetectionConfig): DetectedResource {\n const attributes: DetectedResourceAttributes = {\n [ATTR_HOST_NAME]: hostname(),\n [ATTR_HOST_ARCH]: normalizeArch(arch()),\n [ATTR_HOST_ID]: getMachineId(),\n };\n\n return { attributes };\n }\n}\n\nexport const hostDetector = new HostDetector();\n"]}

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_to_array.cjs",
"module": "../../esm/_to_array.js"
}

View File

@@ -0,0 +1,877 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const { DEFAULTS } = require("../config/defaults");
const createHash = require("../util/createHash");
const AggregateErrorSerializer = require("./AggregateErrorSerializer");
const ArraySerializer = require("./ArraySerializer");
const DateObjectSerializer = require("./DateObjectSerializer");
const ErrorObjectSerializer = require("./ErrorObjectSerializer");
const MapObjectSerializer = require("./MapObjectSerializer");
const NullPrototypeObjectSerializer = require("./NullPrototypeObjectSerializer");
const PlainObjectSerializer = require("./PlainObjectSerializer");
const RegExpObjectSerializer = require("./RegExpObjectSerializer");
const SerializerMiddleware = require("./SerializerMiddleware");
const SetObjectSerializer = require("./SetObjectSerializer");
/** @typedef {import("../logging/Logger").Logger} Logger */
/** @typedef {import("../util/Hash").HashFunction} HashFunction */
/** @typedef {import("./SerializerMiddleware").LazyOptions} LazyOptions */
/** @typedef {import("./types").ComplexSerializableType} ComplexSerializableType */
/** @typedef {import("./types").PrimitiveSerializableType} PrimitiveSerializableType */
/** @typedef {new (...params: EXPECTED_ANY[]) => EXPECTED_ANY} Constructor */
/*
Format:
File -> Section*
Section -> ObjectSection | ReferenceSection | EscapeSection | OtherSection
ObjectSection -> ESCAPE (
number:relativeOffset (number > 0) |
string:request (string|null):export
) Section:value* ESCAPE ESCAPE_END_OBJECT
ReferenceSection -> ESCAPE number:relativeOffset (number < 0)
EscapeSection -> ESCAPE ESCAPE_ESCAPE_VALUE (escaped value ESCAPE)
EscapeSection -> ESCAPE ESCAPE_UNDEFINED (escaped value ESCAPE)
OtherSection -> any (except ESCAPE)
Why using null as escape value?
Multiple null values can merged by the BinaryMiddleware, which makes it very efficient
Technically any value can be used.
*/
/**
* @typedef {object} ObjectSerializerSnapshot
* @property {number} length
* @property {number} cycleStackSize
* @property {number} referenceableSize
* @property {number} currentPos
* @property {number} objectTypeLookupSize
* @property {number} currentPosTypeLookup
*/
/** @typedef {EXPECTED_OBJECT | string} ReferenceableItem */
/**
* @typedef {object} ObjectSerializerContext
* @property {(value: EXPECTED_ANY) => void} write
* @property {(value: ReferenceableItem) => void} setCircularReference
* @property {() => ObjectSerializerSnapshot} snapshot
* @property {(snapshot: ObjectSerializerSnapshot) => void} rollback
* @property {((item: EXPECTED_ANY | (() => EXPECTED_ANY)) => void)=} writeLazy
* @property {((item: (EXPECTED_ANY | (() => EXPECTED_ANY)), obj: LazyOptions | undefined) => import("./SerializerMiddleware").LazyFunction<EXPECTED_ANY, EXPECTED_ANY, EXPECTED_ANY, LazyOptions>)=} writeSeparate
*/
/**
* @typedef {object} ObjectDeserializerContext
* @property {() => EXPECTED_ANY} read
* @property {(value: ReferenceableItem) => void} setCircularReference
*/
/**
* @typedef {object} ObjectSerializer
* @property {(value: EXPECTED_ANY, context: ObjectSerializerContext) => void} serialize
* @property {(context: ObjectDeserializerContext) => EXPECTED_ANY} deserialize
*/
/**
* @template T
* @param {Set<T>} set set
* @param {number} size count of items to keep
*/
const setSetSize = (set, size) => {
let i = 0;
for (const item of set) {
if (i++ >= size) {
set.delete(item);
}
}
};
/**
* @template K, X
* @param {Map<K, X>} map map
* @param {number} size count of items to keep
*/
const setMapSize = (map, size) => {
let i = 0;
for (const item of map.keys()) {
if (i++ >= size) {
map.delete(item);
}
}
};
/**
* @param {Buffer} buffer buffer
* @param {HashFunction} hashFunction hash function to use
* @returns {string} hash
*/
const toHash = (buffer, hashFunction) => {
const hash = createHash(hashFunction);
hash.update(buffer);
return hash.digest("latin1");
};
const ESCAPE = null;
const ESCAPE_ESCAPE_VALUE = null;
const ESCAPE_END_OBJECT = true;
const ESCAPE_UNDEFINED = false;
const CURRENT_VERSION = 2;
/** @typedef {{ request?: string, name?: string | number | null, serializer?: ObjectSerializer }} SerializerConfig */
/** @typedef {{ request?: string, name?: string | number | null, serializer: ObjectSerializer }} SerializerConfigWithSerializer */
/** @type {Map<Constructor | null, SerializerConfig>} */
const serializers = new Map();
/** @type {Map<string | number, ObjectSerializer>} */
const serializerInversed = new Map();
/** @type {Set<string>} */
const loadedRequests = new Set();
const NOT_SERIALIZABLE = {};
/** @type {Map<Constructor | null, ObjectSerializer>} */
const jsTypes = new Map();
jsTypes.set(Object, new PlainObjectSerializer());
jsTypes.set(Array, new ArraySerializer());
jsTypes.set(null, new NullPrototypeObjectSerializer());
jsTypes.set(Map, new MapObjectSerializer());
jsTypes.set(Set, new SetObjectSerializer());
jsTypes.set(Date, new DateObjectSerializer());
jsTypes.set(RegExp, new RegExpObjectSerializer());
jsTypes.set(Error, new ErrorObjectSerializer(Error));
jsTypes.set(EvalError, new ErrorObjectSerializer(EvalError));
jsTypes.set(RangeError, new ErrorObjectSerializer(RangeError));
jsTypes.set(ReferenceError, new ErrorObjectSerializer(ReferenceError));
jsTypes.set(SyntaxError, new ErrorObjectSerializer(SyntaxError));
jsTypes.set(TypeError, new ErrorObjectSerializer(TypeError));
// eslint-disable-next-line n/no-unsupported-features/es-builtins, n/no-unsupported-features/es-syntax
if (typeof AggregateError !== "undefined") {
jsTypes.set(
// eslint-disable-next-line n/no-unsupported-features/es-builtins, n/no-unsupported-features/es-syntax
AggregateError,
new AggregateErrorSerializer()
);
}
// If in a sandboxed environment (e.g. jest), this escapes the sandbox and registers
// real Object and Array types to. These types may occur in the wild too, e.g. when
// using Structured Clone in postMessage.
// eslint-disable-next-line n/exports-style
if (exports.constructor !== Object) {
// eslint-disable-next-line n/exports-style
const Obj = /** @type {ObjectConstructor} */ (exports.constructor);
const Fn = /** @type {FunctionConstructor} */ (Obj.constructor);
for (const [type, config] of jsTypes) {
if (type) {
const Type = new Fn(`return ${type.name};`)();
jsTypes.set(Type, config);
}
}
}
{
let i = 1;
for (const [type, serializer] of jsTypes) {
serializers.set(type, {
request: "",
name: i++,
serializer
});
}
}
for (const { request, name, serializer } of serializers.values()) {
serializerInversed.set(
`${request}/${name}`,
/** @type {ObjectSerializer} */ (serializer)
);
}
/** @type {Map<RegExp, (request: string) => boolean>} */
const loaders = new Map();
/** @typedef {ComplexSerializableType[]} DeserializedType */
/** @typedef {PrimitiveSerializableType[]} SerializedType */
/** @typedef {{ logger: Logger }} Context */
/** @typedef {(context: ObjectSerializerContext | ObjectDeserializerContext) => void} ExtendContext */
/**
* @extends {SerializerMiddleware<DeserializedType, SerializedType, Context>}
*/
class ObjectMiddleware extends SerializerMiddleware {
/**
* @param {ExtendContext} extendContext context extensions
* @param {HashFunction} hashFunction hash function to use
*/
constructor(extendContext, hashFunction = DEFAULTS.HASH_FUNCTION) {
super();
/** @type {ExtendContext} */
this.extendContext = extendContext;
/** @type {HashFunction} */
this._hashFunction = hashFunction;
}
/**
* @param {RegExp} regExp RegExp for which the request is tested
* @param {(request: string) => boolean} loader loader to load the request, returns true when successful
* @returns {void}
*/
static registerLoader(regExp, loader) {
loaders.set(regExp, loader);
}
/**
* @param {Constructor} Constructor the constructor
* @param {string} request the request which will be required when deserializing
* @param {string | null} name the name to make multiple serializer unique when sharing a request
* @param {ObjectSerializer} serializer the serializer
* @returns {void}
*/
static register(Constructor, request, name, serializer) {
const key = `${request}/${name}`;
if (serializers.has(Constructor)) {
throw new Error(
`ObjectMiddleware.register: serializer for ${Constructor.name} is already registered`
);
}
if (serializerInversed.has(key)) {
throw new Error(
`ObjectMiddleware.register: serializer for ${key} is already registered`
);
}
serializers.set(Constructor, {
request,
name,
serializer
});
serializerInversed.set(key, serializer);
}
/**
* @param {Constructor} Constructor the constructor
* @returns {void}
*/
static registerNotSerializable(Constructor) {
if (serializers.has(Constructor)) {
throw new Error(
`ObjectMiddleware.registerNotSerializable: serializer for ${Constructor.name} is already registered`
);
}
serializers.set(Constructor, NOT_SERIALIZABLE);
}
/**
* @param {EXPECTED_ANY} object for serialization
* @returns {SerializerConfigWithSerializer} Serializer config
*/
static getSerializerFor(object) {
const proto = Object.getPrototypeOf(object);
/** @type {null | Constructor} */
let c;
if (proto === null) {
// Object created with Object.create(null)
c = null;
} else {
c = proto.constructor;
if (!c) {
throw new Error(
"Serialization of objects with prototype without valid constructor property not possible"
);
}
}
const config = serializers.get(c);
if (!config) {
throw new Error(
`No serializer registered for ${/** @type {Constructor} */ (c).name}`
);
}
if (config === NOT_SERIALIZABLE) throw NOT_SERIALIZABLE;
return /** @type {SerializerConfigWithSerializer} */ (config);
}
/**
* @param {string} request request
* @param {string} name name
* @returns {ObjectSerializer} serializer
*/
static getDeserializerFor(request, name) {
const key = `${request}/${name}`;
const serializer = serializerInversed.get(key);
if (serializer === undefined) {
throw new Error(`No deserializer registered for ${key}`);
}
return serializer;
}
/**
* @param {string} request request
* @param {string} name name
* @returns {ObjectSerializer | undefined} serializer
*/
static _getDeserializerForWithoutError(request, name) {
const key = `${request}/${name}`;
const serializer = serializerInversed.get(key);
return serializer;
}
/**
* @param {DeserializedType} data data
* @param {Context} context context object
* @returns {SerializedType | Promise<SerializedType> | null} serialized data
*/
serialize(data, context) {
/** @type {PrimitiveSerializableType[]} */
let result = [CURRENT_VERSION];
let currentPos = 0;
/** @type {Map<ReferenceableItem, number>} */
let referenceable = new Map();
/**
* @param {ReferenceableItem} item referenceable item
*/
const addReferenceable = (item) => {
referenceable.set(item, currentPos++);
};
/** @type {Map<number, Buffer | [Buffer, Buffer] | Map<string, Buffer>>} */
let bufferDedupeMap = new Map();
/**
* @param {Buffer} buf buffer
* @returns {Buffer} deduped buffer
*/
const dedupeBuffer = (buf) => {
const len = buf.length;
const entry = bufferDedupeMap.get(len);
if (entry === undefined) {
bufferDedupeMap.set(len, buf);
return buf;
}
if (Buffer.isBuffer(entry)) {
if (len < 32) {
if (buf.equals(entry)) {
return entry;
}
bufferDedupeMap.set(len, [entry, buf]);
return buf;
}
const hash = toHash(entry, this._hashFunction);
/** @type {Map<string, Buffer>} */
const newMap = new Map();
newMap.set(hash, entry);
bufferDedupeMap.set(len, newMap);
const hashBuf = toHash(buf, this._hashFunction);
if (hash === hashBuf) {
return entry;
}
return buf;
} else if (Array.isArray(entry)) {
if (entry.length < 16) {
for (const item of entry) {
if (buf.equals(item)) {
return item;
}
}
entry.push(buf);
return buf;
}
/** @type {Map<string, Buffer>} */
const newMap = new Map();
const hash = toHash(buf, this._hashFunction);
/** @type {undefined | Buffer} */
let found;
for (const item of entry) {
const itemHash = toHash(item, this._hashFunction);
newMap.set(itemHash, item);
if (found === undefined && itemHash === hash) found = item;
}
bufferDedupeMap.set(len, newMap);
if (found === undefined) {
newMap.set(hash, buf);
return buf;
}
return found;
}
const hash = toHash(buf, this._hashFunction);
const item = entry.get(hash);
if (item !== undefined) {
return item;
}
entry.set(hash, buf);
return buf;
};
let currentPosTypeLookup = 0;
/** @type {Map<ComplexSerializableType, number>} */
let objectTypeLookup = new Map();
/** @type {Set<ComplexSerializableType>} */
const cycleStack = new Set();
/**
* @param {ComplexSerializableType} item item to stack
* @returns {string} stack
*/
const stackToString = (item) => {
const arr = [...cycleStack];
arr.push(item);
return arr
.map((item) => {
if (typeof item === "string") {
if (item.length > 100) {
return `String ${JSON.stringify(item.slice(0, 100)).slice(
0,
-1
)}..."`;
}
return `String ${JSON.stringify(item)}`;
}
try {
const { request, name } = ObjectMiddleware.getSerializerFor(item);
if (request) {
return `${request}${name ? `.${name}` : ""}`;
}
} catch (_err) {
// ignore -> fallback
}
if (typeof item === "object" && item !== null) {
if (item.constructor) {
if (item.constructor === Object) {
return `Object { ${Object.keys(item).join(", ")} }`;
}
if (item.constructor === Map) {
return `Map { ${/** @type {Map<EXPECTED_ANY, EXPECTED_ANY>} */ (item).size} items }`;
}
if (item.constructor === Array) {
return `Array { ${/** @type {EXPECTED_ANY[]} */ (item).length} items }`;
}
if (item.constructor === Set) {
return `Set { ${/** @type {Set<EXPECTED_ANY>} */ (item).size} items }`;
}
if (item.constructor === RegExp) {
return /** @type {RegExp} */ (item).toString();
}
return `${item.constructor.name}`;
}
return `Object [null prototype] { ${Object.keys(item).join(
", "
)} }`;
}
if (typeof item === "bigint") {
return `BigInt ${item}n`;
}
try {
return `${item}`;
} catch (err) {
return `(${/** @type {Error} */ (err).message})`;
}
})
.join(" -> ");
};
/** @type {undefined | WeakSet<Error>} */
let hasDebugInfoAttached;
/** @type {ObjectSerializerContext} */
let ctx = {
write(value) {
try {
process(value);
} catch (err) {
if (err !== NOT_SERIALIZABLE) {
if (hasDebugInfoAttached === undefined) {
hasDebugInfoAttached = new WeakSet();
}
if (!hasDebugInfoAttached.has(/** @type {Error} */ (err))) {
/** @type {Error} */
(err).message += `\nwhile serializing ${stackToString(value)}`;
hasDebugInfoAttached.add(/** @type {Error} */ (err));
}
}
throw err;
}
},
setCircularReference(ref) {
addReferenceable(ref);
},
snapshot() {
return {
length: result.length,
cycleStackSize: cycleStack.size,
referenceableSize: referenceable.size,
currentPos,
objectTypeLookupSize: objectTypeLookup.size,
currentPosTypeLookup
};
},
rollback(snapshot) {
result.length = snapshot.length;
setSetSize(cycleStack, snapshot.cycleStackSize);
setMapSize(referenceable, snapshot.referenceableSize);
currentPos = snapshot.currentPos;
setMapSize(objectTypeLookup, snapshot.objectTypeLookupSize);
currentPosTypeLookup = snapshot.currentPosTypeLookup;
},
...context
};
this.extendContext(ctx);
/**
* @param {ComplexSerializableType} item item to serialize
*/
const process = (item) => {
if (Buffer.isBuffer(item)) {
// check if we can emit a reference
const ref = referenceable.get(item);
if (ref !== undefined) {
result.push(ESCAPE, ref - currentPos);
return;
}
const alreadyUsedBuffer = dedupeBuffer(item);
if (alreadyUsedBuffer !== item) {
const ref = referenceable.get(alreadyUsedBuffer);
if (ref !== undefined) {
referenceable.set(item, ref);
result.push(ESCAPE, ref - currentPos);
return;
}
item = alreadyUsedBuffer;
}
addReferenceable(item);
result.push(/** @type {Buffer} */ (item));
} else if (item === ESCAPE) {
result.push(ESCAPE, ESCAPE_ESCAPE_VALUE);
} else if (
typeof item === "object"
// We don't have to check for null as ESCAPE is null and this has been checked before
) {
// check if we can emit a reference
const ref = referenceable.get(item);
if (ref !== undefined) {
result.push(ESCAPE, ref - currentPos);
return;
}
if (cycleStack.has(item)) {
throw new Error(
"This is a circular references. To serialize circular references use 'setCircularReference' somewhere in the circle during serialize and deserialize."
);
}
const { request, name, serializer } = ObjectMiddleware.getSerializerFor(
/** @type {Constructor} */
(item)
);
const key = `${request}/${name}`;
const lastIndex = objectTypeLookup.get(key);
if (lastIndex === undefined) {
objectTypeLookup.set(key, currentPosTypeLookup++);
result.push(ESCAPE, request, name);
} else {
result.push(ESCAPE, currentPosTypeLookup - lastIndex);
}
cycleStack.add(item);
try {
serializer.serialize(item, ctx);
} finally {
cycleStack.delete(item);
}
result.push(ESCAPE, ESCAPE_END_OBJECT);
addReferenceable(item);
} else if (typeof item === "string") {
if (item.length > 1) {
// short strings are shorter when not emitting a reference (this saves 1 byte per empty string)
// check if we can emit a reference
const ref = referenceable.get(item);
if (ref !== undefined) {
result.push(ESCAPE, ref - currentPos);
return;
}
addReferenceable(item);
}
if (item.length > 102400 && context.logger) {
context.logger.warn(
`Serializing big strings (${Math.round(
item.length / 1024
)}kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)`
);
}
result.push(item);
} else if (typeof item === "function") {
if (!SerializerMiddleware.isLazy(item)) {
throw new Error(`Unexpected function ${item}`);
}
/** @type {SerializedType | undefined} */
const serializedData =
SerializerMiddleware.getLazySerializedValue(item);
if (serializedData !== undefined) {
if (typeof serializedData === "function") {
result.push(serializedData);
} else {
throw new Error("Not implemented");
}
} else if (SerializerMiddleware.isLazy(item, this)) {
throw new Error("Not implemented");
} else {
const data =
/** @type {() => PrimitiveSerializableType[] | Promise<PrimitiveSerializableType[]>} */
(
SerializerMiddleware.serializeLazy(item, (data) =>
this.serialize([data], context)
)
);
SerializerMiddleware.setLazySerializedValue(item, data);
result.push(data);
}
} else if (item === undefined) {
result.push(ESCAPE, ESCAPE_UNDEFINED);
} else {
result.push(item);
}
};
try {
for (const item of data) {
process(item);
}
return result;
} catch (err) {
if (err === NOT_SERIALIZABLE) return null;
throw err;
} finally {
// Get rid of these references to avoid leaking memory
// This happens because the optimized code v8 generates
// is optimized for our "ctx.write" method so it will reference
// it from e. g. Dependency.prototype.serialize -(IC)-> ctx.write
data =
result =
referenceable =
bufferDedupeMap =
objectTypeLookup =
ctx =
/** @type {EXPECTED_ANY} */
(undefined);
}
}
/**
* @param {SerializedType} data data
* @param {Context} context context object
* @returns {DeserializedType | Promise<DeserializedType>} deserialized data
*/
deserialize(data, context) {
let currentDataPos = 0;
const read = () => {
if (currentDataPos >= data.length) {
throw new Error("Unexpected end of stream");
}
return data[currentDataPos++];
};
if (read() !== CURRENT_VERSION) {
throw new Error("Version mismatch, serializer changed");
}
let currentPos = 0;
/** @type {ReferenceableItem[]} */
let referenceable = [];
/**
* @param {ReferenceableItem} item referenceable item
*/
const addReferenceable = (item) => {
referenceable.push(item);
currentPos++;
};
let currentPosTypeLookup = 0;
/** @type {ObjectSerializer[]} */
let objectTypeLookup = [];
/** @type {ComplexSerializableType[]} */
let result = [];
/** @type {ObjectDeserializerContext} */
let ctx = {
read() {
return decodeValue();
},
setCircularReference(ref) {
addReferenceable(ref);
},
...context
};
this.extendContext(ctx);
/**
* @returns {ComplexSerializableType} deserialize value
*/
const decodeValue = () => {
const item = read();
if (item === ESCAPE) {
const nextItem = read();
if (nextItem === ESCAPE_ESCAPE_VALUE) {
return ESCAPE;
} else if (nextItem === ESCAPE_UNDEFINED) {
// Nothing
} else if (nextItem === ESCAPE_END_OBJECT) {
throw new Error(
`Unexpected end of object at position ${currentDataPos - 1}`
);
} else {
const request = nextItem;
/** @type {undefined | ObjectSerializer} */
let serializer;
if (typeof request === "number") {
if (request < 0) {
// relative reference
return referenceable[currentPos + request];
}
serializer = objectTypeLookup[currentPosTypeLookup - request];
} else {
if (typeof request !== "string") {
throw new Error(
`Unexpected type (${typeof request}) of request ` +
`at position ${currentDataPos - 1}`
);
}
const name = /** @type {string} */ (read());
serializer = ObjectMiddleware._getDeserializerForWithoutError(
request,
name
);
if (serializer === undefined) {
if (request && !loadedRequests.has(request)) {
let loaded = false;
for (const [regExp, loader] of loaders) {
if (regExp.test(request) && loader(request)) {
loaded = true;
break;
}
}
if (!loaded) {
require(request);
}
loadedRequests.add(request);
}
serializer = ObjectMiddleware.getDeserializerFor(request, name);
}
objectTypeLookup.push(serializer);
currentPosTypeLookup++;
}
try {
const item = serializer.deserialize(ctx);
const end1 = read();
if (end1 !== ESCAPE) {
throw new Error("Expected end of object");
}
const end2 = read();
if (end2 !== ESCAPE_END_OBJECT) {
throw new Error("Expected end of object");
}
addReferenceable(item);
return item;
} catch (err) {
// As this is only for error handling, we omit creating a Map for
// faster access to this information, as this would affect performance
// in the good case
/** @type {undefined | [Constructor | null, SerializerConfig]} */
let serializerEntry;
for (const entry of serializers) {
if (entry[1].serializer === serializer) {
serializerEntry = entry;
break;
}
}
const name = !serializerEntry
? "unknown"
: !serializerEntry[1].request
? /** @type {Constructor[]} */ (serializerEntry)[0].name
: serializerEntry[1].name
? `${serializerEntry[1].request} ${serializerEntry[1].name}`
: serializerEntry[1].request;
/** @type {Error} */
(err).message += `\n(during deserialization of ${name})`;
throw err;
}
}
} else if (typeof item === "string") {
if (item.length > 1) {
addReferenceable(item);
}
return item;
} else if (Buffer.isBuffer(item)) {
addReferenceable(item);
return item;
} else if (typeof item === "function") {
return SerializerMiddleware.deserializeLazy(
item,
(data) =>
/** @type {[DeserializedType]} */
(this.deserialize(data, context))[0]
);
} else {
return item;
}
};
try {
while (currentDataPos < data.length) {
result.push(decodeValue());
}
return result;
} finally {
// Get rid of these references to avoid leaking memory
// This happens because the optimized code v8 generates
// is optimized for our "ctx.read" method so it will reference
// it from e. g. Dependency.prototype.deserialize -(IC)-> ctx.read
result =
referenceable =
data =
objectTypeLookup =
ctx =
/** @type {EXPECTED_ANY} */
(undefined);
}
}
}
module.exports = ObjectMiddleware;
module.exports.NOT_SERIALIZABLE = NOT_SERIALIZABLE;

View File

@@ -0,0 +1,29 @@
import { generatePayloadCookie, isolateObjectProperty, loginOperation } from 'payload';
export function login(collection) {
async function resolver(_, args, context) {
const options = {
collection,
data: {
email: args.email,
password: args.password,
username: args.username
},
depth: 0,
req: isolateObjectProperty(context.req, 'transactionID')
};
const result = await loginOperation(options);
const cookie = generatePayloadCookie({
collectionAuthConfig: collection.config.auth,
cookiePrefix: context.req.payload.config.cookiePrefix,
token: result.token
});
context.headers['Set-Cookie'] = cookie;
if (collection.config.auth.removeTokenFromResponses) {
delete result.token;
}
return result;
}
return resolver;
}
//# sourceMappingURL=login.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"salad.js","sources":["../../../src/icons/salad.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Salad\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNyAyMWgxMCIgLz4KICA8cGF0aCBkPSJNMTIgMjFhOSA5IDAgMCAwIDktOUgzYTkgOSAwIDAgMCA5IDlaIiAvPgogIDxwYXRoIGQ9Ik0xMS4zOCAxMmEyLjQgMi40IDAgMCAxLS40LTQuNzcgMi40IDIuNCAwIDAgMSAzLjItMi43NyAyLjQgMi40IDAgMCAxIDMuNDctLjYzIDIuNCAyLjQgMCAwIDEgMy4zNyAzLjM3IDIuNCAyLjQgMCAwIDEtMS4xIDMuNyAyLjUxIDIuNTEgMCAwIDEgLjAzIDEuMSIgLz4KICA8cGF0aCBkPSJtMTMgMTIgNC00IiAvPgogIDxwYXRoIGQ9Ik0xMC45IDcuMjVBMy45OSAzLjk5IDAgMCAwIDQgMTBjMCAuNzMuMiAxLjQxLjU0IDIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/salad\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 Salad = createLucideIcon('Salad', [\n ['path', { d: 'M7 21h10', key: '1b0cd5' }],\n ['path', { d: 'M12 21a9 9 0 0 0 9-9H3a9 9 0 0 0 9 9Z', key: '4rw317' }],\n [\n 'path',\n {\n d: 'M11.38 12a2.4 2.4 0 0 1-.4-4.77 2.4 2.4 0 0 1 3.2-2.77 2.4 2.4 0 0 1 3.47-.63 2.4 2.4 0 0 1 3.37 3.37 2.4 2.4 0 0 1-1.1 3.7 2.51 2.51 0 0 1 .03 1.1',\n key: '10xrj0',\n },\n ],\n ['path', { d: 'm13 12 4-4', key: '1hckqy' }],\n ['path', { d: 'M10.9 7.25A3.99 3.99 0 0 0 4 10c0 .73.2 1.41.54 2', key: '1p4srx' }],\n]);\n\nexport default Salad;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAyC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACtE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACpF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"singleton.cjs","names":[],"sources":["../../../../src/rest/commands/read/singleton.ts"],"sourcesContent":["import type { ApplyQueryFields, CollectionType, Query, QueryItem, SingletonCollections } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfCoreCollection, throwIfEmpty } from '../../utils/index.js';\n\nexport type ReadSingletonOutput<\n\tSchema,\n\tCollection extends SingletonCollections<Schema>,\n\tTQuery extends Query<Schema, Schema[Collection]>,\n> = ApplyQueryFields<Schema, CollectionType<Schema, Collection>, TQuery['fields']>;\n\n/**\n * List the singleton item in Directus.\n *\n * @param collection The collection of the items\n * @param query The query parameters\n *\n * @returns An array of up to limit item objects. If no items are available, data will be an empty array.\n * @throws Will throw if collection is a core collection\n * @throws Will throw if collection is empty\n */\nexport const readSingleton =\n\t<Schema, Collection extends SingletonCollections<Schema>, const TQuery extends QueryItem<Schema, Schema[Collection]>>(\n\t\tcollection: Collection,\n\t\tquery?: TQuery,\n\t): RestCommand<ReadSingletonOutput<Schema, Collection, TQuery>, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(collection), 'Collection cannot be empty');\n\t\tthrowIfCoreCollection(collection, 'Cannot use readSingleton for core collections');\n\n\t\treturn {\n\t\t\tpath: `/items/${collection as string}`,\n\t\t\tparams: query ?? {},\n\t\t\tmethod: 'GET',\n\t\t};\n\t};\n"],"mappings":"qGAoBa,GAEX,EACA,SAGA,EAAA,aAAa,OAAO,EAAW,CAAE,6BAA6B,CAC9D,EAAA,sBAAsB,EAAY,gDAAgD,CAE3E,CACN,KAAM,UAAU,IAChB,OAAQ,GAAS,EAAE,CACnB,OAAQ,MACR"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/node-postgres/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { NodePgDatabase } from './driver.ts';\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: NodePgDatabase<TSchema>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":"AACA,SAAS,0BAA0B;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,aAAa,mBAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"sanitizeJoinParams.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizeJoinParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAIlD,MAAM,MAAM,UAAU,GAClB;IACE,CAAC,UAAU,EAAE,MAAM,GACf;QACE,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,OAAO,CAAA;KAChB,GACD,KAAK,CAAA;CACV,GACD,KAAK,CAAA;AAET;;;GAGG;AACH,eAAO,MAAM,kBAAkB,YAAY,UAAU,KAAQ,SAmB5D,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../src/Resource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { RawResourceAttribute } from './types';\n\n/**\n * An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are\n * collected.\n *\n * This interface is NOT user-implementable. Valid ways to obtain a {@link Resource} are by using either of these functions\n * - {@link resourceFromAttributes}\n * - {@link emptyResource}\n * - {@link defaultResource}\n * - {@link detectResources}\n */\nexport interface Resource {\n /**\n * Check if async attributes have resolved. This is useful to avoid awaiting\n * waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.\n *\n * @returns true if the resource \"attributes\" property is not yet settled to its final value\n */\n readonly asyncAttributesPending?: boolean;\n\n /**\n * @returns the Resource's attributes.\n */\n readonly attributes: Attributes;\n\n /**\n * @returns the Resource's schema URL or undefined if not set.\n */\n readonly schemaUrl?: string;\n\n /**\n * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to\n * this Resource's attributes. This is useful in exporters to block until resource detection\n * has finished.\n */\n waitForAsyncAttributes?(): Promise<void>;\n\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other: Resource | null): Resource;\n\n getRawAttributes(): RawResourceAttribute[];\n}\n"]}

View File

@@ -0,0 +1,689 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/sr-Latn/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
one: {
standalone: "manje od 1 sekunde",
withPrepositionAgo: "manje od 1 sekunde",
withPrepositionIn: "manje od 1 sekundu"
},
dual: "manje od {{count}} sekunde",
other: "manje od {{count}} sekundi"
},
xSeconds: {
one: {
standalone: "1 sekunda",
withPrepositionAgo: "1 sekunde",
withPrepositionIn: "1 sekundu"
},
dual: "{{count}} sekunde",
other: "{{count}} sekundi"
},
halfAMinute: "pola minute",
lessThanXMinutes: {
one: {
standalone: "manje od 1 minute",
withPrepositionAgo: "manje od 1 minute",
withPrepositionIn: "manje od 1 minutu"
},
dual: "manje od {{count}} minute",
other: "manje od {{count}} minuta"
},
xMinutes: {
one: {
standalone: "1 minuta",
withPrepositionAgo: "1 minute",
withPrepositionIn: "1 minutu"
},
dual: "{{count}} minute",
other: "{{count}} minuta"
},
aboutXHours: {
one: {
standalone: "oko 1 sat",
withPrepositionAgo: "oko 1 sat",
withPrepositionIn: "oko 1 sat"
},
dual: "oko {{count}} sata",
other: "oko {{count}} sati"
},
xHours: {
one: {
standalone: "1 sat",
withPrepositionAgo: "1 sat",
withPrepositionIn: "1 sat"
},
dual: "{{count}} sata",
other: "{{count}} sati"
},
xDays: {
one: {
standalone: "1 dan",
withPrepositionAgo: "1 dan",
withPrepositionIn: "1 dan"
},
dual: "{{count}} dana",
other: "{{count}} dana"
},
aboutXWeeks: {
one: {
standalone: "oko 1 nedelju",
withPrepositionAgo: "oko 1 nedelju",
withPrepositionIn: "oko 1 nedelju"
},
dual: "oko {{count}} nedelje",
other: "oko {{count}} nedelje"
},
xWeeks: {
one: {
standalone: "1 nedelju",
withPrepositionAgo: "1 nedelju",
withPrepositionIn: "1 nedelju"
},
dual: "{{count}} nedelje",
other: "{{count}} nedelje"
},
aboutXMonths: {
one: {
standalone: "oko 1 mesec",
withPrepositionAgo: "oko 1 mesec",
withPrepositionIn: "oko 1 mesec"
},
dual: "oko {{count}} meseca",
other: "oko {{count}} meseci"
},
xMonths: {
one: {
standalone: "1 mesec",
withPrepositionAgo: "1 mesec",
withPrepositionIn: "1 mesec"
},
dual: "{{count}} meseca",
other: "{{count}} meseci"
},
aboutXYears: {
one: {
standalone: "oko 1 godinu",
withPrepositionAgo: "oko 1 godinu",
withPrepositionIn: "oko 1 godinu"
},
dual: "oko {{count}} godine",
other: "oko {{count}} godina"
},
xYears: {
one: {
standalone: "1 godina",
withPrepositionAgo: "1 godine",
withPrepositionIn: "1 godinu"
},
dual: "{{count}} godine",
other: "{{count}} godina"
},
overXYears: {
one: {
standalone: "preko 1 godinu",
withPrepositionAgo: "preko 1 godinu",
withPrepositionIn: "preko 1 godinu"
},
dual: "preko {{count}} godine",
other: "preko {{count}} godina"
},
almostXYears: {
one: {
standalone: "gotovo 1 godinu",
withPrepositionAgo: "gotovo 1 godinu",
withPrepositionIn: "gotovo 1 godinu"
},
dual: "gotovo {{count}} godine",
other: "gotovo {{count}} godina"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
result = tokenValue.one.withPrepositionIn;
} else {
result = tokenValue.one.withPrepositionAgo;
}
} else {
result = tokenValue.one.standalone;
}
} else if (count % 10 > 1 && count % 10 < 5 && String(count).substr(-2, 1) !== "1") {
result = tokenValue.dual.replace("{{count}}", String(count));
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "za " + result;
} else {
return "pre " + result;
}
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/sr-Latn/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, d. MMMM yyyy.",
long: "d. MMMM yyyy.",
medium: "d. MMM yy.",
short: "dd. MM. yy."
};
var timeFormats = {
full: "HH:mm:ss (zzzz)",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} 'u' {{time}}",
long: "{{date}} 'u' {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/sr-Latn/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: function lastWeek(date) {
switch (date.getDay()) {
case 0:
return "'pro\u0161le nedelje u' p";
case 3:
return "'pro\u0161le srede u' p";
case 6:
return "'pro\u0161le subote u' p";
default:
return "'pro\u0161li' EEEE 'u' p";
}
},
yesterday: "'ju\u010De u' p",
today: "'danas u' p",
tomorrow: "'sutra u' p",
nextWeek: function nextWeek(date) {
switch (date.getDay()) {
case 0:
return "'slede\u0107e nedelje u' p";
case 3:
return "'slede\u0107u sredu u' p";
case 6:
return "'slede\u0107u subotu u' p";
default:
return "'slede\u0107i' EEEE 'u' p";
}
},
other: "P"
};
var formatRelative = function formatRelative(token, date, _baseDate, _options) {
var format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date);
}
return format;
};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/sr-Latn/_lib/localize.mjs
var eraValues = {
narrow: ["pr.n.e.", "AD"],
abbreviated: ["pr. Hr.", "po. Hr."],
wide: ["Pre Hrista", "Posle Hrista"]
};
var quarterValues = {
narrow: ["1.", "2.", "3.", "4."],
abbreviated: ["1. kv.", "2. kv.", "3. kv.", "4. kv."],
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"]
};
var monthValues = {
narrow: [
"1.",
"2.",
"3.",
"4.",
"5.",
"6.",
"7.",
"8.",
"9.",
"10.",
"11.",
"12."],
abbreviated: [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"avg",
"sep",
"okt",
"nov",
"dec"],
wide: [
"januar",
"februar",
"mart",
"april",
"maj",
"jun",
"jul",
"avgust",
"septembar",
"oktobar",
"novembar",
"decembar"]
};
var formattingMonthValues = {
narrow: [
"1.",
"2.",
"3.",
"4.",
"5.",
"6.",
"7.",
"8.",
"9.",
"10.",
"11.",
"12."],
abbreviated: [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"avg",
"sep",
"okt",
"nov",
"dec"],
wide: [
"januar",
"februar",
"mart",
"april",
"maj",
"jun",
"jul",
"avgust",
"septembar",
"oktobar",
"novembar",
"decembar"]
};
var dayValues = {
narrow: ["N", "P", "U", "S", "\u010C", "P", "S"],
short: ["ned", "pon", "uto", "sre", "\u010Det", "pet", "sub"],
abbreviated: ["ned", "pon", "uto", "sre", "\u010Det", "pet", "sub"],
wide: [
"nedelja",
"ponedeljak",
"utorak",
"sreda",
"\u010Detvrtak",
"petak",
"subota"]
};
var formattingDayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "pono\u0107",
noon: "podne",
morning: "ujutru",
afternoon: "popodne",
evening: "uve\u010De",
night: "no\u0107u"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "pono\u0107",
noon: "podne",
morning: "ujutru",
afternoon: "popodne",
evening: "uve\u010De",
night: "no\u0107u"
},
wide: {
am: "AM",
pm: "PM",
midnight: "pono\u0107",
noon: "podne",
morning: "ujutru",
afternoon: "posle podne",
evening: "uve\u010De",
night: "no\u0107u"
}
};
var dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "pono\u0107",
noon: "podne",
morning: "ujutru",
afternoon: "popodne",
evening: "uve\u010De",
night: "no\u0107u"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "pono\u0107",
noon: "podne",
morning: "ujutru",
afternoon: "popodne",
evening: "uve\u010De",
night: "no\u0107u"
},
wide: {
am: "AM",
pm: "PM",
midnight: "pono\u0107",
noon: "podne",
morning: "ujutru",
afternoon: "posle podne",
evening: "uve\u010De",
night: "no\u0107u"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
return number + ".";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/sr-Latn/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)\./i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(pr\.n\.e\.|AD)/i,
abbreviated: /^(pr\.\s?Hr\.|po\.\s?Hr\.)/i,
wide: /^(Pre Hrista|pre nove ere|Posle Hrista|nova era)/i
};
var parseEraPatterns = {
any: [/^pr/i, /^(po|nova)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]\.\s?kv\.?/i,
wide: /^[1234]\. kvartal/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^(10|11|12|[123456789])\./i,
abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|avg|sep|okt|nov|dec)/i,
wide: /^((januar|januara)|(februar|februara)|(mart|marta)|(april|aprila)|(maj|maja)|(jun|juna)|(jul|jula)|(avgust|avgusta)|(septembar|septembra)|(oktobar|oktobra)|(novembar|novembra)|(decembar|decembra))/i
};
var parseMonthPatterns = {
narrow: [
/^1/i,
/^2/i,
/^3/i,
/^4/i,
/^5/i,
/^6/i,
/^7/i,
/^8/i,
/^9/i,
/^10/i,
/^11/i,
/^12/i],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^maj/i,
/^jun/i,
/^jul/i,
/^avg/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[npusčc]/i,
short: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
abbreviated: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
wide: /^(nedelja|ponedeljak|utorak|sreda|(četvrtak|cetvrtak)|petak|subota)/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
any: /^(am|pm|ponoc|ponoć|(po)?podne|uvece|uveče|noću|posle podne|ujutru)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^pono/i,
noon: /^pod/i,
morning: /jutro/i,
afternoon: /(posle\s|po)+podne/i,
evening: /(uvece|uveče)/i,
night: /(nocu|noću)/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/sr-Latn.mjs
var srLatn = {
code: "sr-Latn",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 1
}
};
// lib/locale/sr-Latn/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
srLatn: srLatn }) });
//# debugId=45D49A036422840464756e2164756e21
})();
//# sourceMappingURL=cdn.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getTranslation.d.ts","sourceRoot":"","sources":["../../src/utilities/getTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE9D,KAAK,SAAS,GACV,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,GACnB,CAAC,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,CAAC,EAAE,SAAS,CAAA;CAAE,KAAK,MAAM,CAAC,GACtD,GAAG,CAAC,OAAO,GACX,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtB,MAAM,CAAA;AAEV,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,SAAS,SACzC,CAAC,QAIF,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,kBAAkB,GAAG,UAAU,GAAG,GAAG,CAAC,KAChE,CAAC,SAAS,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,GAAG,MA8BxC,CAAA"}

View File

@@ -0,0 +1,51 @@
# [Prism](https://prismjs.com/)
[![Build Status](https://github.com/PrismJS/prism/workflows/CI/badge.svg)](https://github.com/PrismJS/prism/actions)
[![npm](https://img.shields.io/npm/dw/prismjs.svg)](https://www.npmjs.com/package/prismjs)
Prism is a lightweight, robust, and elegant syntax highlighting library. It's a spin-off project from [Dabblet](https://dabblet.com/).
You can learn more on [prismjs.com](https://prismjs.com/).
[Why another syntax highlighter?](https://lea.verou.me/2012/07/introducing-prism-an-awesome-new-syntax-highlighter/#more-1841)
[More themes for Prism!](https://github.com/PrismJS/prism-themes)
## Contribute to Prism!
### **Important Notice**
We are currently working on [Prism v2](https://github.com/PrismJS/prism/discussions/3531) and will only accept security-relevant PRs for the time being.
Once work on Prism v2 is sufficiently advanced, we will accept PRs again. This will be announced on our [Discussion](https://github.com/PrismJS/prism/discussions) page and mentioned in the [roadmap discussion](https://github.com/PrismJS/prism/discussions/3531).
<details>
<summary>Prism v1 contributing notes</summary>
Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, consider giving back by sending a pull request. Here are a few tips:
- Read the [documentation](https://prismjs.com/extending.html). Prism was designed to be extensible.
- Do not edit `prism.js`, its just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. `prism.js` and all minified files are generated by our build system (see below).
- Use `npm ci` to install Prism's dependencies. Do not use `npm install` because it will cause non-deterministic builds.
- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. With all of Prism's dependencies installed, you just need to run the command `npm run build`.
- Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc.
- Please try to err towards more smaller PRs rather than a few huge PRs. If a PR includes changes that I want to merge and also changes that I don't, handling it becomes difficult.
- My time is very limited these days, so it might take a long time to review bigger PRs (small ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected.
- If you contribute a new language definition, you will be responsible for handling bug reports about that language definition.
- If you [add a new language definition](https://prismjs.com/extending.html#creating-a-new-language-definition) or plugin, you need to add it to `components.json` as well and rebuild Prism by running `npm run build`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder.
- Go to [prism-themes](https://github.com/PrismJS/prism-themes) if you want to add a new theme.
Thank you so much for contributing!!
### Software requirements
Prism will run on [almost any browser](https://prismjs.com/#features-full) and Node.js version but you need the following software to contribute:
- Node.js >= 10.x
- npm >= 6.x
</details>
## Translations
* [简体中文](https://www.awesomes.cn/repo/PrismJS/prism) (if unavailable, see [here](https://deepmind.t-salon.cc/article/113))

View File

@@ -0,0 +1,4 @@
export { DragOverlay } from './DragOverlay';
export type { Props } from './DragOverlay';
export { defaultDropAnimation, defaultDropAnimationSideEffects } from './hooks';
export type { DropAnimation, DropAnimationFunction, DropAnimationFunctionArguments, DropAnimationKeyframeResolver, DropAnimationSideEffects, } from './hooks';

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 SquareArrowOutDownLeft = createLucideIcon("SquareArrowOutDownLeft", [
["path", { d: "M13 21h6a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v6", key: "14qz4y" }],
["path", { d: "m3 21 9-9", key: "1jfql5" }],
["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
]);
export { SquareArrowOutDownLeft as default };
//# sourceMappingURL=square-arrow-out-down-left.js.map

View File

@@ -0,0 +1,26 @@
import { Context } from './context';
export declare class CacheStorage {
private static _link?;
private static _origin;
static getOrigin(url: string): string;
static isSameOrigin(src: string): boolean;
static setContext(window: Window): void;
}
export interface ResourceOptions {
imageTimeout: number;
useCORS: boolean;
allowTaint: boolean;
proxy?: string;
}
export declare class Cache {
private readonly context;
private readonly _options;
private readonly _cache;
constructor(context: Context, _options: ResourceOptions);
addImage(src: string): Promise<void>;
match(src: string): Promise<any>;
private loadImage;
private has;
keys(): Promise<string[]>;
private proxy;
}

View File

@@ -0,0 +1,23 @@
import * as core from "../core/index.cjs";
import { type ZodError } from "./errors.cjs";
export type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
export type ZodSafeParseSuccess<T> = {
success: true;
data: T;
error?: never;
};
export type ZodSafeParseError<T> = {
success: false;
data?: never;
error: ZodError<T>;
};
export declare const parse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {
callee?: core.util.AnyFunc;
Err?: core.$ZodErrorClass;
}) => core.output<T>;
export declare const parseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>, _params?: {
callee?: core.util.AnyFunc;
Err?: core.$ZodErrorClass;
}) => Promise<core.output<T>>;
export declare const safeParse: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => ZodSafeParseResult<core.output<T>>;
export declare const safeParseAsync: <T extends core.$ZodType>(schema: T, value: unknown, _ctx?: core.ParseContext<core.$ZodIssue>) => Promise<ZodSafeParseResult<core.output<T>>>;

View File

@@ -0,0 +1,24 @@
"use strict";
exports.getSeconds = getSeconds;
var _index = require("./toDate.cjs");
/**
* @name getSeconds
* @category Second Helpers
* @summary Get the seconds of the given date.
*
* @description
* Get the seconds of the given date.
*
* @param date - The given date
*
* @returns The seconds
*
* @example
* // Get the seconds of 29 February 2012 11:45:05.123:
* const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))
* //=> 5
*/
function getSeconds(date) {
return (0, _index.toDate)(date).getSeconds();
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"notifications.cjs","names":[],"sources":["../../../../src/rest/commands/delete/notifications.ts"],"sourcesContent":["import type { DirectusNotification } from '../../../schema/notification.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing notifications.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deleteNotifications =\n\t<Schema>(keys: DirectusNotification<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/notifications`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing notification.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deleteNotification =\n\t<Schema>(key: DirectusNotification<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(key, 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/notifications/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAUa,EACH,QAER,EAAA,aAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,iBACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAA,aAAa,EAAK,sBAAsB,CAEjC,CACN,KAAM,kBAAkB,IACxB,OAAQ,SACR"}

View File

@@ -0,0 +1,24 @@
var arraySample = require('./_arraySample'),
baseSample = require('./_baseSample'),
isArray = require('./isArray');
/**
* Gets a random element from `collection`.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to sample.
* @returns {*} Returns the random element.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*/
function sample(collection) {
var func = isArray(collection) ? arraySample : baseSample;
return func(collection);
}
module.exports = sample;

View File

@@ -0,0 +1,27 @@
"use strict";
exports.subYears = subYears;
var _index = require("./addYears.js");
/**
* @name subYears
* @category Year Helpers
* @summary Subtract the specified number of years from the given date.
*
* @description
* Subtract the specified number of years from the given 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 date to be changed
* @param amount - The amount of years to be subtracted.
*
* @returns The new date with the years subtracted
*
* @example
* // Subtract 5 years from 1 September 2014:
* const result = subYears(new Date(2014, 8, 1), 5)
* //=> Tue Sep 01 2009 00:00:00
*/
function subYears(date, amount) {
return (0, _index.addYears)(date, -amount);
}

View File

@@ -0,0 +1,261 @@
export = Watchpack;
/**
* @typedef {object} WatchpackEvents
* @property {(file: string, mtime: number, type: EventType) => void} change change event
* @property {(file: string, type: EventType) => void} remove remove event
* @property {(changes: Changes, removals: Removals) => void} aggregated aggregated event
*/
/**
* @extends {EventEmitter<{ [K in keyof WatchpackEvents]: Parameters<WatchpackEvents[K]> }>}
*/
declare class Watchpack extends EventEmitter<{
/**
* change event
*/
change: [file: string, mtime: number, type: EventType];
/**
* remove event
*/
remove: [file: string, type: EventType];
/**
* aggregated event
*/
aggregated: [changes: Changes, removals: Removals];
}> {
/**
* @param {WatchOptions=} options options
*/
constructor(options?: WatchOptions | undefined);
/** @type {WatchOptions} */
options: WatchOptions;
aggregateTimeout: number;
/** @type {NormalizedWatchOptions} */
watcherOptions: NormalizedWatchOptions;
/** @type {WatcherManager} */
watcherManager: WatcherManager;
/** @type {Map<string, WatchpackFileWatcher>} */
fileWatchers: Map<string, WatchpackFileWatcher>;
/** @type {Map<string, WatchpackDirectoryWatcher>} */
directoryWatchers: Map<string, WatchpackDirectoryWatcher>;
/** @type {Set<string>} */
_missing: Set<string>;
startTime: number | undefined;
paused: boolean;
/** @type {Changes} */
aggregatedChanges: Changes;
/** @type {Removals} */
aggregatedRemovals: Removals;
/** @type {undefined | NodeJS.Timeout} */
aggregateTimer: undefined | NodeJS.Timeout;
_onTimeout(): void;
/**
* @overload
* @param {Iterable<string>} arg1 files
* @param {Iterable<string>} arg2 directories
* @param {number=} arg3 startTime
* @returns {void}
*/
watch(
arg1: Iterable<string>,
arg2: Iterable<string>,
arg3?: number | undefined,
): void;
/**
* @overload
* @param {WatchMethodOptions} arg1 watch options
* @returns {void}
*/
watch(arg1: WatchMethodOptions): void;
close(): void;
pause(): void;
/**
* @returns {Record<string, number>} times
*/
getTimes(): Record<string, number>;
/**
* @returns {TimeInfoEntries} time info entries
*/
getTimeInfoEntries(): TimeInfoEntries;
/**
* @param {TimeInfoEntries} fileTimestamps file timestamps
* @param {TimeInfoEntries} directoryTimestamps directory timestamps
*/
collectTimeInfoEntries(
fileTimestamps: TimeInfoEntries,
directoryTimestamps: TimeInfoEntries,
): void;
/**
* @returns {Aggregated} aggregated info
*/
getAggregated(): Aggregated;
/**
* @param {string} item item
* @param {number} mtime mtime
* @param {string} file file
* @param {EventType} type type
*/
_onChange(item: string, mtime: number, file: string, type: EventType): void;
/**
* @param {string} item item
* @param {string} file file
* @param {EventType} type type
*/
_onRemove(item: string, file: string, type: EventType): void;
}
declare namespace Watchpack {
export {
WatcherManager,
DirectoryWatcher,
DirectoryWatcherEvents,
FileWatcherEvents,
EventMap,
Watcher,
IgnoredFunction,
Ignored,
WatcherOptions,
WatchOptions,
NormalizedWatchOptions,
EventType,
Entry,
OnlySafeTimeEntry,
ExistenceOnlyTimeEntry,
TimeInfoEntries,
Changes,
Removals,
Aggregated,
WatchMethodOptions,
Times,
WatchpackEvents,
};
}
import { EventEmitter } from "events";
declare class WatchpackFileWatcher {
/**
* @param {Watchpack} watchpack watchpack
* @param {Watcher<FileWatcherEvents>} watcher watcher
* @param {string | string[]} files files
*/
constructor(
watchpack: Watchpack,
watcher: Watcher<FileWatcherEvents>,
files: string | string[],
);
/** @type {string[]} */
files: string[];
watcher: import("./DirectoryWatcher").Watcher<
import("./DirectoryWatcher").FileWatcherEvents
>;
/**
* @param {string | string[]} files files
*/
update(files: string | string[]): void;
close(): void;
}
declare class WatchpackDirectoryWatcher {
/**
* @param {Watchpack} watchpack watchpack
* @param {Watcher<DirectoryWatcherEvents>} watcher watcher
* @param {string} directories directories
*/
constructor(
watchpack: Watchpack,
watcher: Watcher<DirectoryWatcherEvents>,
directories: string,
);
/** @type {string[]} */
directories: string[];
watcher: import("./DirectoryWatcher").Watcher<
import("./DirectoryWatcher").DirectoryWatcherEvents
>;
/**
* @param {string | string[]} directories directories
*/
update(directories: string | string[]): void;
close(): void;
}
type WatcherManager = import("./getWatcherManager").WatcherManager;
type DirectoryWatcher = import("./DirectoryWatcher");
type DirectoryWatcherEvents =
import("./DirectoryWatcher").DirectoryWatcherEvents;
type FileWatcherEvents = import("./DirectoryWatcher").FileWatcherEvents;
type EventMap = Record<string, (...args: any[]) => any>;
type Watcher<T extends EventMap> = import("./DirectoryWatcher").Watcher<T>;
type IgnoredFunction = (item: string) => boolean;
type Ignored = string[] | RegExp | string | IgnoredFunction;
type WatcherOptions = {
/**
* true when need to resolve symlinks and watch symlink and real file, otherwise false
*/
followSymlinks?: boolean | undefined;
/**
* ignore some files from watching (glob pattern or regexp)
*/
ignored?: Ignored | undefined;
/**
* true when need to enable polling mode for watching, otherwise false
*/
poll?: (number | boolean) | undefined;
};
type WatchOptions = WatcherOptions & {
aggregateTimeout?: number;
};
type NormalizedWatchOptions = {
/**
* true when need to resolve symlinks and watch symlink and real file, otherwise false
*/
followSymlinks: boolean;
/**
* ignore some files from watching (glob pattern or regexp)
*/
ignored: IgnoredFunction;
/**
* true when need to enable polling mode for watching, otherwise false
*/
poll?: (number | boolean) | undefined;
};
type EventType =
| `scan (${string})`
| "change"
| "rename"
| `watch ${string}`
| `directory-removed ${string}`;
type Entry = {
safeTime: number;
timestamp: number;
accuracy: number;
};
type OnlySafeTimeEntry = {
safeTime: number;
};
type ExistenceOnlyTimeEntry = {};
type TimeInfoEntries = Map<
string,
Entry | OnlySafeTimeEntry | ExistenceOnlyTimeEntry | null
>;
type Changes = Set<string>;
type Removals = Set<string>;
type Aggregated = {
changes: Changes;
removals: Removals;
};
type WatchMethodOptions = {
files?: Iterable<string>;
directories?: Iterable<string>;
missing?: Iterable<string>;
startTime?: number;
};
type Times = Record<string, number>;
type WatchpackEvents = {
/**
* change event
*/
change: (file: string, mtime: number, type: EventType) => void;
/**
* remove event
*/
remove: (file: string, type: EventType) => void;
/**
* aggregated event
*/
aggregated: (changes: Changes, removals: Removals) => void;
};

View File

@@ -0,0 +1,120 @@
'use strict'
/* eslint-disable no-prototype-builtins */
const { tspl } = require('@matteo.collina/tspl')
const http = require('node:http')
const { test } = require('node:test')
const serializers = require('../lib/res')
const { wrapResponseSerializer } = require('../')
test('res.raw is not enumerable', async (t) => {
const p = tspl(t, { plan: 1 })
const server = http.createServer(handler)
server.unref()
server.listen(0, () => {
http.get(server.address(), () => {})
})
t.after(() => server.close())
function handler (_req, res) {
const serialized = serializers.resSerializer(res)
p.strictEqual(serialized.propertyIsEnumerable('raw'), false)
res.end()
}
await p.completed
})
test('res.raw is available', async (t) => {
const p = tspl(t, { plan: 2 })
const server = http.createServer(handler)
server.unref()
server.listen(0, () => {
http.get(server.address(), () => {})
})
t.after(() => server.close())
function handler (_req, res) {
res.statusCode = 200
const serialized = serializers.resSerializer(res)
p.ok(serialized.raw)
p.strictEqual(serialized.raw.statusCode, 200)
res.end()
}
await p.completed
})
test('can wrap response serializers', async (t) => {
const p = tspl(t, { plan: 3 })
const server = http.createServer(handler)
server.unref()
server.listen(0, () => {
http.get(server.address(), () => {})
})
t.after(() => server.close())
const serializer = wrapResponseSerializer(function (res) {
p.ok(res.statusCode)
p.strictEqual(res.statusCode, 200)
delete res.statusCode
return res
})
function handler (_req, res) {
res.end()
res.statusCode = 200
const serialized = serializer(res)
p.ok(!serialized.statusCode)
}
await p.completed
})
test('res.headers is serialized', async (t) => {
const p = tspl(t, { plan: 1 })
const server = http.createServer(handler)
server.unref()
server.listen(0, () => {
http.get(server.address(), () => {})
})
t.after(() => server.close())
function handler (_req, res) {
res.setHeader('x-custom', 'y')
const serialized = serializers.resSerializer(res)
p.strictEqual(serialized.headers['x-custom'], 'y')
res.end()
}
await p.completed
})
test('req.url will be obtained from input request url when input request url is not an object', async (t) => {
const p = tspl(t, { plan: 1 })
const server = http.createServer(handler)
server.unref()
server.listen(0, () => {
http.get(server.address(), () => {})
})
t.after(() => server.close())
function handler (_req, res) {
const serialized = serializers.resSerializer(res)
p.strictEqual(serialized.statusCode, null)
res.end()
}
await p.completed
})

View File

@@ -0,0 +1,7 @@
/**
* Return true if `value` is object-like. A value is object-like if it's not
* `null` and has a `typeof` result of "object".
*/
export declare function isObjectLike(value: unknown): value is {
[key: string]: unknown;
};

View File

@@ -0,0 +1,8 @@
import { parseSemver } from '@sentry/core';
const NODE_VERSION = parseSemver(process.versions.node) ;
const NODE_MAJOR = NODE_VERSION.major;
const NODE_MINOR = NODE_VERSION.minor;
export { NODE_MAJOR, NODE_MINOR, NODE_VERSION };
//# sourceMappingURL=nodeVersion.js.map

View File

@@ -0,0 +1,26 @@
"use strict";
exports.__esModule = true;
exports.default = prepend;
/**
* Insert a given element as the first child of a parent element.
*
* @param node the element to prepend
* @param parent the parent element
*/
function prepend(node, parent) {
if (node && parent) {
if (parent.firstElementChild) {
parent.insertBefore(node, parent.firstElementChild);
} else {
parent.appendChild(node);
}
return node;
}
return null;
}
module.exports = exports["default"];

View File

@@ -0,0 +1,115 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLPostalCode = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
// We're going to start with a limited set as suggested here:
// http://www.pixelenvision.com/1708/zip-postal-code-validation-regex-php-code-for-12-countries/
// and here:
// https://stackoverflow.com/questions/578406/what-is-the-ultimate-postal-code-and-zip-regex
//
// Which gives us the following countries:
//
// US - United States
// UK - United Kingdom
// DE - Germany
// CA - Canada
// FR - France
// IT - Italy
// AU - Australia
// NL - Netherlands
// ES - Spain
// DK - Denmark
// SE - Sweden
// BE - Belgium
// IN - India
// AT - Austria
// PT - Portugal
// CH - Switzerland
// LU - Luxembourg
// IR - Iran
// JP - Japan
// UA - Ukraine
//
// This is really a practical decision of weight (of the package) vs. completeness.
//
// In the future we might expand this list and use the more comprehensive list found here:
// http://unicode.org/cldr/trac/browser/tags/release-26-0-1/common/supplemental/postalCodeData.xml
// prettier-ignore
const POSTAL_CODE_REGEXES = [
/* US */ /*#__PURE__*/ /^\d{5}([-]?\d{4})?$/,
/* UK */ /*#__PURE__*/ /^(GIR|[A-Z]\d[A-Z\d]??|[A-Z]{2}\d[A-Z\d]??)[ ]??(\d[A-Z]{2})$/,
/* DE */ /*#__PURE__*/ /\b((?:0[1-46-9]\d{3})|(?:[1-357-9]\d{4})|(?:[4][0-24-9]\d{3})|(?:[6][013-9]\d{3}))\b/,
/* CA */ /*#__PURE__*/ /^([ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]) {0,1}(\d[ABCEGHJKLMNPRSTVWXYZ]\d)$/,
/* FR */ /*#__PURE__*/ /^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$/,
/* IT */ /*#__PURE__*/ /^(V-|I-)?[0-9]{5}$/,
/* AU */ /*#__PURE__*/ /^(0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2})$/,
/* NL */ /*#__PURE__*/ /^[1-9][0-9]{3}\s?([a-zA-Z]{2})?$/,
/* ES */ /*#__PURE__*/ /^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$/,
/* DK */ /*#__PURE__*/ /^([D|d][K|k]( |-))?[1-9]{1}[0-9]{3}$/,
/* SE */ /*#__PURE__*/ /^(s-|S-){0,1}[0-9]{3}\s?[0-9]{2}$/,
/* BE */ /*#__PURE__*/ /^[1-9]{1}[0-9]{3}$/,
/* IN */ /*#__PURE__*/ /^\d{6}$/,
/* AT */ /*#__PURE__*/ /^\d{4}$/,
/* PT */ /*#__PURE__*/ /^\d{4}([\-]\d{3})?$/,
/* CH */ /*#__PURE__*/ /^\d{4}$/,
/* LU */ /*#__PURE__*/ /^\d{4}$/,
/* IR */ /*#__PURE__*/ /^[1,3-9]{10}$/,
/* JP */ /*#__PURE__*/ /^\d{3}-\d{4}$/,
/* UA */ /*#__PURE__*/ /^\d{5}$/,
];
function _testPostalCode(postalCode) {
let result = false;
// eslint-disable-next-line no-plusplus
for (let i = 0; i < POSTAL_CODE_REGEXES.length; i++) {
const regex = POSTAL_CODE_REGEXES[i];
if (regex.test(postalCode)) {
result = true;
break;
}
}
return result;
}
exports.GraphQLPostalCode = new graphql_1.GraphQLScalarType({
name: 'PostalCode',
description: 'A field whose value conforms to the standard postal code formats for United States, United Kingdom, Germany, Canada, France, Italy, Australia, Netherlands, Spain, Denmark, Sweden, Belgium, India, Austria, Portugal, Switzerland or Luxembourg.',
serialize(value) {
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Value is not string: ${value}`);
}
if (!_testPostalCode(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid postal code: ${value}`);
}
return value;
},
parseValue(value) {
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Value is not string: ${value}`);
}
if (!_testPostalCode(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid postal code: ${value}`);
}
return value;
},
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Can only validate strings as postal codes but got a: ${ast.kind}`, {
nodes: ast,
});
}
if (!_testPostalCode(ast.value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid postal code: ${ast.value}`, { nodes: ast });
}
return ast.value;
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'PostalCode',
oneOf: POSTAL_CODE_REGEXES.map(regex => ({
type: 'string',
pattern: regex.source,
})),
},
},
});

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