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,63 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { useEffect, useRef, useState } from 'react';
export const useIntersect = (t0, disable) => {
const $ = _c(8);
const {
root: t1,
rootMargin: t2,
threshold: t3
} = t0 === undefined ? {} : t0;
const root = t1 === undefined ? null : t1;
const rootMargin = t2 === undefined ? "0px" : t2;
const threshold = t3 === undefined ? 0 : t3;
const [entry, updateEntry] = useState();
const [node, setNode] = useState(null);
const observer = useRef(typeof window !== "undefined" && "IntersectionObserver" in window && !disable ? new window.IntersectionObserver(t4 => {
const [ent] = t4;
return updateEntry(ent);
}, {
root,
rootMargin,
threshold
}) : null);
let t5;
let t6;
if ($[0] !== disable || $[1] !== node) {
t5 = () => {
if (disable) {
return;
}
const {
current: currentObserver
} = observer;
currentObserver.disconnect();
if (node) {
currentObserver.observe(node);
}
return () => currentObserver.disconnect();
};
t6 = [node, disable];
$[0] = disable;
$[1] = node;
$[2] = t5;
$[3] = t6;
} else {
t5 = $[2];
t6 = $[3];
}
useEffect(t5, t6);
let t7;
if ($[4] !== entry || $[5] !== node || $[6] !== setNode) {
t7 = [setNode, entry, node];
$[4] = entry;
$[5] = node;
$[6] = setNode;
$[7] = t7;
} else {
t7 = $[7];
}
return t7;
};
//# sourceMappingURL=useIntersect.js.map

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 BaggageClaim = createLucideIcon("BaggageClaim", [
["path", { d: "M22 18H6a2 2 0 0 1-2-2V7a2 2 0 0 0-2-2", key: "4irg2o" }],
["path", { d: "M17 14V4a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v10", key: "14fcyx" }],
["rect", { width: "13", height: "8", x: "8", y: "6", rx: "1", key: "o6oiis" }],
["circle", { cx: "18", cy: "20", r: "2", key: "t9985n" }],
["circle", { cx: "9", cy: "20", r: "2", key: "e5v82j" }]
]);
export { BaggageClaim as default };
//# sourceMappingURL=baggage-claim.js.map

View File

@@ -0,0 +1,53 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var boolean_exports = {};
__export(boolean_exports, {
PgBoolean: () => PgBoolean,
PgBooleanBuilder: () => PgBooleanBuilder,
boolean: () => boolean
});
module.exports = __toCommonJS(boolean_exports);
var import_entity = require("../../entity.cjs");
var import_common = require("./common.cjs");
class PgBooleanBuilder extends import_common.PgColumnBuilder {
static [import_entity.entityKind] = "PgBooleanBuilder";
constructor(name) {
super(name, "boolean", "PgBoolean");
}
/** @internal */
build(table) {
return new PgBoolean(table, this.config);
}
}
class PgBoolean extends import_common.PgColumn {
static [import_entity.entityKind] = "PgBoolean";
getSQLType() {
return "boolean";
}
}
function boolean(name) {
return new PgBooleanBuilder(name ?? "");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PgBoolean,
PgBooleanBuilder,
boolean
});
//# sourceMappingURL=boolean.cjs.map

View File

@@ -0,0 +1,282 @@
# JSON5 JSON for Humans
[![Build Status](https://app.travis-ci.com/json5/json5.svg?branch=main)][Build
Status] [![Coverage
Status](https://coveralls.io/repos/github/json5/json5/badge.svg)][Coverage
Status]
JSON5 is an extension to the popular [JSON] file format that aims to be
easier to **write and maintain _by hand_ (e.g. for config files)**.
It is _not intended_ to be used for machine-to-machine communication.
(Keep using JSON or other file formats for that. 🙂)
JSON5 was started in 2012, and as of 2022, now gets **[>65M downloads/week](https://www.npmjs.com/package/json5)**,
ranks in the **[top 0.1%](https://gist.github.com/anvaka/8e8fa57c7ee1350e3491)** of the most depended-upon packages on npm,
and has been adopted by major projects like
**[Chromium](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5;drc=5de823b36e68fd99009a29281b17bc3a1d6b329c),
[Next.js](https://github.com/vercel/next.js/blob/b88f20c90bf4659b8ad5cb2a27956005eac2c7e8/packages/next/lib/find-config.ts#L43-L46),
[Babel](https://babeljs.io/docs/en/config-files#supported-file-extensions),
[Retool](https://community.retool.com/t/i-am-attempting-to-append-several-text-fields-to-a-google-sheet-but-receiving-a-json5-invalid-character-error/7626),
[WebStorm](https://www.jetbrains.com/help/webstorm/json.html),
and [more](https://github.com/json5/json5/wiki/In-the-Wild)**.
It's also natively supported on **[Apple platforms](https://developer.apple.com/documentation/foundation/jsondecoder/3766916-allowsjson5)**
like **MacOS** and **iOS**.
Formally, the **[JSON5 Data Interchange Format](https://spec.json5.org/)** is a superset of JSON
(so valid JSON files will always be valid JSON5 files)
that expands its syntax to include some productions from [ECMAScript 5.1] (ES5).
It's also a strict _subset_ of ES5, so valid JSON5 files will always be valid ES5.
This JavaScript library is a reference implementation for JSON5 parsing and serialization,
and is directly used in many of the popular projects mentioned above
(where e.g. extreme performance isn't necessary),
but others have created [many other libraries](https://github.com/json5/json5/wiki/In-the-Wild)
across many other platforms.
[Build Status]: https://app.travis-ci.com/json5/json5
[Coverage Status]: https://coveralls.io/github/json5/json5
[JSON]: https://tools.ietf.org/html/rfc7159
[ECMAScript 5.1]: https://www.ecma-international.org/ecma-262/5.1/
## Summary of Features
The following ECMAScript 5.1 features, which are not supported in JSON, have
been extended to JSON5.
### Objects
- Object keys may be an ECMAScript 5.1 _[IdentifierName]_.
- Objects may have a single trailing comma.
### Arrays
- Arrays may have a single trailing comma.
### Strings
- Strings may be single quoted.
- Strings may span multiple lines by escaping new line characters.
- Strings may include character escapes.
### Numbers
- Numbers may be hexadecimal.
- Numbers may have a leading or trailing decimal point.
- Numbers may be [IEEE 754] positive infinity, negative infinity, and NaN.
- Numbers may begin with an explicit plus sign.
### Comments
- Single and multi-line comments are allowed.
### White Space
- Additional white space characters are allowed.
[IdentifierName]: https://www.ecma-international.org/ecma-262/5.1/#sec-7.6
[IEEE 754]: http://ieeexplore.ieee.org/servlet/opac?punumber=4610933
## Example
Kitchen-sink example:
```js
{
// comments
unquoted: 'and you can quote me on that',
singleQuotes: 'I can use "double quotes" here',
lineBreaks: "Look, Mom! \
No \\n's!",
hexadecimal: 0xdecaf,
leadingDecimalPoint: .8675309, andTrailing: 8675309.,
positiveSign: +1,
trailingComma: 'in objects', andIn: ['arrays',],
"backwardsCompatible": "with JSON",
}
```
A more real-world example is [this config file](https://github.com/chromium/chromium/blob/feb3c9f670515edf9a88f185301cbd7794ee3e52/third_party/blink/renderer/platform/runtime_enabled_features.json5)
from the Chromium/Blink project.
## Specification
For a detailed explanation of the JSON5 format, please read the [official
specification](https://json5.github.io/json5-spec/).
## Installation and Usage
### Node.js
```sh
npm install json5
```
#### CommonJS
```js
const JSON5 = require('json5')
```
#### Modules
```js
import JSON5 from 'json5'
```
### Browsers
#### UMD
```html
<!-- This will create a global `JSON5` variable. -->
<script src="https://unpkg.com/json5@2/dist/index.min.js"></script>
```
#### Modules
```html
<script type="module">
import JSON5 from 'https://unpkg.com/json5@2/dist/index.min.mjs'
</script>
```
## API
The JSON5 API is compatible with the [JSON API].
[JSON API]:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON
### JSON5.parse()
Parses a JSON5 string, constructing the JavaScript value or object described by
the string. An optional reviver function can be provided to perform a
transformation on the resulting object before it is returned.
#### Syntax
JSON5.parse(text[, reviver])
#### Parameters
- `text`: The string to parse as JSON5.
- `reviver`: If a function, this prescribes how the value originally produced by
parsing is transformed, before being returned.
#### Return value
The object corresponding to the given JSON5 text.
### JSON5.stringify()
Converts a JavaScript value to a JSON5 string, optionally replacing values if a
replacer function is specified, or optionally including only the specified
properties if a replacer array is specified.
#### Syntax
JSON5.stringify(value[, replacer[, space]])
JSON5.stringify(value[, options])
#### Parameters
- `value`: The value to convert to a JSON5 string.
- `replacer`: A function that alters the behavior of the stringification
process, or an array of String and Number objects that serve as a whitelist
for selecting/filtering the properties of the value object to be included in
the JSON5 string. If this value is null or not provided, all properties of the
object are included in the resulting JSON5 string.
- `space`: A String or Number object that's used to insert white space into the
output JSON5 string for readability purposes. If this is a Number, it
indicates the number of space characters to use as white space; this number is
capped at 10 (if it is greater, the value is just 10). Values less than 1
indicate that no space should be used. If this is a String, the string (or the
first 10 characters of the string, if it's longer than that) is used as white
space. If this parameter is not provided (or is null), no white space is used.
If white space is used, trailing commas will be used in objects and arrays.
- `options`: An object with the following properties:
- `replacer`: Same as the `replacer` parameter.
- `space`: Same as the `space` parameter.
- `quote`: A String representing the quote character to use when serializing
strings.
#### Return value
A JSON5 string representing the value.
### Node.js `require()` JSON5 files
When using Node.js, you can `require()` JSON5 files by adding the following
statement.
```js
require('json5/lib/register')
```
Then you can load a JSON5 file with a Node.js `require()` statement. For
example:
```js
const config = require('./config.json5')
```
## CLI
Since JSON is more widely used than JSON5, this package includes a CLI for
converting JSON5 to JSON and for validating the syntax of JSON5 documents.
### Installation
```sh
npm install --global json5
```
### Usage
```sh
json5 [options] <file>
```
If `<file>` is not provided, then STDIN is used.
#### Options:
- `-s`, `--space`: The number of spaces to indent or `t` for tabs
- `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT
- `-v`, `--validate`: Validate JSON5 but do not output JSON
- `-V`, `--version`: Output the version number
- `-h`, `--help`: Output usage information
## Contributing
### Development
```sh
git clone https://github.com/json5/json5
cd json5
npm install
```
When contributing code, please write relevant tests and run `npm test` and `npm
run lint` before submitting pull requests. Please use an editor that supports
[EditorConfig](http://editorconfig.org/).
### Issues
To report bugs or request features regarding the JSON5 **data format**,
please submit an issue to the official
**[_specification_ repository](https://github.com/json5/json5-spec)**.
Note that we will never add any features that make JSON5 incompatible with ES5;
that compatibility is a fundamental premise of JSON5.
To report bugs or request features regarding this **JavaScript implementation**
of JSON5, please submit an issue to **_this_ repository**.
### Security Vulnerabilities and Disclosures
To report a security vulnerability, please follow the follow the guidelines
described in our [security policy](./SECURITY.md).
## License
MIT. See [LICENSE.md](./LICENSE.md) for details.
## Credits
[Aseem Kishore](https://github.com/aseemk) founded this project.
He wrote a [blog post](https://aseemk.substack.com/p/ignore-the-f-ing-haters-json5)
about the journey and lessons learned 10 years in.
[Michael Bolin](http://bolinfest.com/) independently arrived at and published
some of these same ideas with awesome explanations and detail. Recommended
reading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html)
[Douglas Crockford](http://www.crockford.com/) of course designed and built
JSON, but his state machine diagrams on the [JSON website](http://json.org/), as
cheesy as it may sound, gave us motivation and confidence that building a new
parser to implement these ideas was within reach! The original
implementation of JSON5 was also modeled directly off of Dougs open-source
[json_parse.js] parser. Were grateful for that clean and well-documented
code.
[json_parse.js]:
https://github.com/douglascrockford/JSON-js/blob/03157639c7a7cddd2e9f032537f346f1a87c0f6d/json_parse.js
[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific
supporter, contributing multiple patches and ideas.
[Andrew Eisenberg](https://github.com/aeisenberg) contributed the original
`stringify` method.
[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely
with ES5, wrote the official JSON5 specification, completely rewrote the
codebase from the ground up, and is actively maintaining this project.

View File

@@ -0,0 +1 @@
{"version":3,"file":"copyFile.d.ts","sourceRoot":"","sources":["../../src/utilities/copyFile.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAS3D"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"startProfileForSpan.d.ts","sourceRoot":"","sources":["../../../../src/profiling/startProfileForSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAOzC;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAgIpD"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../src/languages/zh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtE,eAAO,MAAM,cAAc,EAAE,yBAgmB5B,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,QAGhB,CAAA"}

View File

@@ -0,0 +1,15 @@
import type { NetworkMetaWarning } from '@sentry-internal/browser-utils';
type JsonObject = Record<string, unknown>;
type JsonArray = unknown[];
export type NetworkBody = JsonObject | JsonArray | string;
interface NetworkMeta {
warnings?: NetworkMetaWarning[];
}
export interface ReplayNetworkRequestOrResponse {
size?: number;
body?: NetworkBody;
headers: Record<string, string>;
_meta?: NetworkMeta;
}
export {};
//# sourceMappingURL=request.d.ts.map

View File

@@ -0,0 +1,104 @@
"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.BasicTracerProvider = exports.ForceFlushState = void 0;
const core_1 = require("@opentelemetry/core");
const resources_1 = require("@opentelemetry/resources");
const Tracer_1 = require("./Tracer");
const config_1 = require("./config");
const MultiSpanProcessor_1 = require("./MultiSpanProcessor");
const utility_1 = require("./utility");
var ForceFlushState;
(function (ForceFlushState) {
ForceFlushState[ForceFlushState["resolved"] = 0] = "resolved";
ForceFlushState[ForceFlushState["timeout"] = 1] = "timeout";
ForceFlushState[ForceFlushState["error"] = 2] = "error";
ForceFlushState[ForceFlushState["unresolved"] = 3] = "unresolved";
})(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {}));
/**
* This class represents a basic tracer provider which platform libraries can extend
*/
class BasicTracerProvider {
_config;
_tracers = new Map();
_resource;
_activeSpanProcessor;
constructor(config = {}) {
const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config));
this._resource = mergedConfig.resource ?? (0, resources_1.defaultResource)();
this._config = Object.assign({}, mergedConfig, {
resource: this._resource,
});
const spanProcessors = [];
if (config.spanProcessors?.length) {
spanProcessors.push(...config.spanProcessors);
}
this._activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(spanProcessors);
}
getTracer(name, version, options) {
const key = `${name}@${version || ''}:${options?.schemaUrl || ''}`;
if (!this._tracers.has(key)) {
this._tracers.set(key, new Tracer_1.Tracer({ name, version, schemaUrl: options?.schemaUrl }, this._config, this._resource, this._activeSpanProcessor));
}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return this._tracers.get(key);
}
forceFlush() {
const timeout = this._config.forceFlushTimeoutMillis;
const promises = this._activeSpanProcessor['_spanProcessors'].map((spanProcessor) => {
return new Promise(resolve => {
let state;
const timeoutInterval = setTimeout(() => {
resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`));
state = ForceFlushState.timeout;
}, timeout);
spanProcessor
.forceFlush()
.then(() => {
clearTimeout(timeoutInterval);
if (state !== ForceFlushState.timeout) {
state = ForceFlushState.resolved;
resolve(state);
}
})
.catch(error => {
clearTimeout(timeoutInterval);
state = ForceFlushState.error;
resolve(error);
});
});
});
return new Promise((resolve, reject) => {
Promise.all(promises)
.then(results => {
const errors = results.filter(result => result !== ForceFlushState.resolved);
if (errors.length > 0) {
reject(errors);
}
else {
resolve();
}
})
.catch(error => reject([error]));
});
}
shutdown() {
return this._activeSpanProcessor.shutdown();
}
}
exports.BasicTracerProvider = BasicTracerProvider;
//# sourceMappingURL=BasicTracerProvider.js.map

View File

@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './chart-no-axes-column-increasing.js';
//# sourceMappingURL=bar-chart.js.map

View File

@@ -0,0 +1,930 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { SyncBailHook } = require("tapable");
const { RawSource } = require("webpack-sources");
const ChunkGraph = require("./ChunkGraph");
const Compilation = require("./Compilation");
const HotUpdateChunk = require("./HotUpdateChunk");
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
JAVASCRIPT_MODULE_TYPE_ESM,
WEBPACK_MODULE_TYPE_RUNTIME
} = require("./ModuleTypeConstants");
const NormalModule = require("./NormalModule");
const RuntimeGlobals = require("./RuntimeGlobals");
const WebpackError = require("./WebpackError");
const { chunkHasCss } = require("./css/CssModulesPlugin");
const ConstDependency = require("./dependencies/ConstDependency");
const ImportMetaHotAcceptDependency = require("./dependencies/ImportMetaHotAcceptDependency");
const ImportMetaHotDeclineDependency = require("./dependencies/ImportMetaHotDeclineDependency");
const ModuleHotAcceptDependency = require("./dependencies/ModuleHotAcceptDependency");
const ModuleHotDeclineDependency = require("./dependencies/ModuleHotDeclineDependency");
const HotModuleReplacementRuntimeModule = require("./hmr/HotModuleReplacementRuntimeModule");
const JavascriptParser = require("./javascript/JavascriptParser");
const {
evaluateToIdentifier
} = require("./javascript/JavascriptParserHelpers");
const { find, isSubset } = require("./util/SetHelpers");
const TupleSet = require("./util/TupleSet");
const { compareModulesById } = require("./util/comparators");
const {
forEachRuntime,
getRuntimeKey,
intersectRuntime,
keyToRuntime,
mergeRuntimeOwned,
subtractRuntime
} = require("./util/runtime");
/** @typedef {import("estree").CallExpression} CallExpression */
/** @typedef {import("estree").Expression} Expression */
/** @typedef {import("estree").SpreadElement} SpreadElement */
/** @typedef {import("./Chunk")} Chunk */
/** @typedef {import("./Chunk").ChunkId} ChunkId */
/** @typedef {import("./ChunkGraph").ModuleId} ModuleId */
/** @typedef {import("./Compilation").AssetInfo} AssetInfo */
/** @typedef {import("./Compilation").Records} Records */
/** @typedef {import("./Compiler")} Compiler */
/** @typedef {import("./CodeGenerationResults")} CodeGenerationResults */
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
/** @typedef {import("./Module")} Module */
/** @typedef {import("./Module").BuildInfo} BuildInfo */
/** @typedef {import("./RuntimeModule")} RuntimeModule */
/** @typedef {import("./javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */
/** @typedef {import("./javascript/JavascriptParserHelpers").Range} Range */
/** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */
/** @typedef {string[]} Requests */
/**
* @typedef {object} HMRJavascriptParserHooks
* @property {SyncBailHook<[Expression | SpreadElement, Requests], void>} hotAcceptCallback
* @property {SyncBailHook<[CallExpression, Requests], void>} hotAcceptWithoutCallback
*/
/** @typedef {number} HotIndex */
/** @typedef {Record<string, string>} FullHashChunkModuleHashes */
/** @typedef {Record<string, string>} ChunkModuleHashes */
/** @typedef {Record<ChunkId, string>} ChunkHashes */
/** @typedef {Record<ChunkId, string>} ChunkRuntime */
/** @typedef {Record<ChunkId, ModuleId[]>} ChunkModuleIds */
/** @typedef {Set<ChunkId>} ChunkIds */
/** @typedef {Set<Module>} ModuleSet */
/** @typedef {{ updatedChunkIds: ChunkIds, removedChunkIds: ChunkIds, removedModules: ModuleSet, filename: string, assetInfo: AssetInfo }} HotUpdateMainContentByRuntimeItem */
/** @typedef {Map<string, HotUpdateMainContentByRuntimeItem>} HotUpdateMainContentByRuntime */
/** @type {WeakMap<JavascriptParser, HMRJavascriptParserHooks>} */
const parserHooksMap = new WeakMap();
const PLUGIN_NAME = "HotModuleReplacementPlugin";
class HotModuleReplacementPlugin {
/**
* @param {JavascriptParser} parser the parser
* @returns {HMRJavascriptParserHooks} the attached hooks
*/
static getParserHooks(parser) {
if (!(parser instanceof JavascriptParser)) {
throw new TypeError(
"The 'parser' argument must be an instance of JavascriptParser"
);
}
let hooks = parserHooksMap.get(parser);
if (hooks === undefined) {
hooks = {
hotAcceptCallback: new SyncBailHook(["expression", "requests"]),
hotAcceptWithoutCallback: new SyncBailHook(["expression", "requests"])
};
parserHooksMap.set(parser, hooks);
}
return hooks;
}
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
const { _backCompat: backCompat } = compiler;
if (compiler.options.output.strictModuleErrorHandling === undefined) {
compiler.options.output.strictModuleErrorHandling = true;
}
const runtimeRequirements = [RuntimeGlobals.module];
/**
* @param {JavascriptParser} parser the parser
* @param {typeof ModuleHotAcceptDependency} ParamDependency dependency
* @returns {(expr: CallExpression) => boolean | undefined} callback
*/
const createAcceptHandler = (parser, ParamDependency) => {
const { hotAcceptCallback, hotAcceptWithoutCallback } =
HotModuleReplacementPlugin.getParserHooks(parser);
return (expr) => {
const module = parser.state.module;
const dep = new ConstDependency(
`${module.moduleArgument}.hot.accept`,
/** @type {Range} */ (expr.callee.range),
runtimeRequirements
);
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
module.addPresentationalDependency(dep);
/** @type {BuildInfo} */
(module.buildInfo).moduleConcatenationBailout =
"Hot Module Replacement";
if (expr.arguments.length >= 1) {
const arg = parser.evaluateExpression(expr.arguments[0]);
/** @type {BasicEvaluatedExpression[]} */
let params = [];
if (arg.isString()) {
params = [arg];
} else if (arg.isArray()) {
params =
/** @type {BasicEvaluatedExpression[]} */
(arg.items).filter((param) => param.isString());
}
/** @type {Requests} */
const requests = [];
if (params.length > 0) {
for (const [idx, param] of params.entries()) {
const request = /** @type {string} */ (param.string);
const dep = new ParamDependency(
request,
/** @type {Range} */ (param.range)
);
dep.optional = true;
dep.loc = Object.create(
/** @type {DependencyLocation} */ (expr.loc)
);
dep.loc.index = idx;
module.addDependency(dep);
requests.push(request);
}
if (expr.arguments.length > 1) {
hotAcceptCallback.call(expr.arguments[1], requests);
for (let i = 1; i < expr.arguments.length; i++) {
parser.walkExpression(expr.arguments[i]);
}
return true;
}
hotAcceptWithoutCallback.call(expr, requests);
return true;
}
}
parser.walkExpressions(expr.arguments);
return true;
};
};
/**
* @param {JavascriptParser} parser the parser
* @param {typeof ModuleHotDeclineDependency} ParamDependency dependency
* @returns {(expr: CallExpression) => boolean | undefined} callback
*/
const createDeclineHandler = (parser, ParamDependency) => (expr) => {
const module = parser.state.module;
const dep = new ConstDependency(
`${module.moduleArgument}.hot.decline`,
/** @type {Range} */ (expr.callee.range),
runtimeRequirements
);
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
module.addPresentationalDependency(dep);
/** @type {BuildInfo} */
(module.buildInfo).moduleConcatenationBailout = "Hot Module Replacement";
if (expr.arguments.length === 1) {
const arg = parser.evaluateExpression(expr.arguments[0]);
/** @type {BasicEvaluatedExpression[]} */
let params = [];
if (arg.isString()) {
params = [arg];
} else if (arg.isArray()) {
params =
/** @type {BasicEvaluatedExpression[]} */
(arg.items).filter((param) => param.isString());
}
for (const [idx, param] of params.entries()) {
const dep = new ParamDependency(
/** @type {string} */ (param.string),
/** @type {Range} */ (param.range)
);
dep.optional = true;
dep.loc = Object.create(/** @type {DependencyLocation} */ (expr.loc));
dep.loc.index = idx;
module.addDependency(dep);
}
}
return true;
};
/**
* @param {JavascriptParser} parser the parser
* @returns {(expr: Expression) => boolean | undefined} callback
*/
const createHMRExpressionHandler = (parser) => (expr) => {
const module = parser.state.module;
const dep = new ConstDependency(
`${module.moduleArgument}.hot`,
/** @type {Range} */ (expr.range),
runtimeRequirements
);
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
module.addPresentationalDependency(dep);
/** @type {BuildInfo} */
(module.buildInfo).moduleConcatenationBailout = "Hot Module Replacement";
return true;
};
/**
* @param {JavascriptParser} parser the parser
* @returns {void}
*/
const applyModuleHot = (parser) => {
parser.hooks.evaluateIdentifier.for("module.hot").tap(
{
name: PLUGIN_NAME,
before: "NodeStuffPlugin"
},
(expr) =>
evaluateToIdentifier(
"module.hot",
"module",
() => ["hot"],
true
)(expr)
);
parser.hooks.call
.for("module.hot.accept")
.tap(
PLUGIN_NAME,
createAcceptHandler(parser, ModuleHotAcceptDependency)
);
parser.hooks.call
.for("module.hot.decline")
.tap(
PLUGIN_NAME,
createDeclineHandler(parser, ModuleHotDeclineDependency)
);
parser.hooks.expression
.for("module.hot")
.tap(PLUGIN_NAME, createHMRExpressionHandler(parser));
};
/**
* @param {JavascriptParser} parser the parser
* @returns {void}
*/
const applyImportMetaHot = (parser) => {
parser.hooks.evaluateIdentifier
.for("import.meta.webpackHot")
.tap(PLUGIN_NAME, (expr) =>
evaluateToIdentifier(
"import.meta.webpackHot",
"import.meta",
() => ["webpackHot"],
true
)(expr)
);
parser.hooks.call
.for("import.meta.webpackHot.accept")
.tap(
PLUGIN_NAME,
createAcceptHandler(parser, ImportMetaHotAcceptDependency)
);
parser.hooks.call
.for("import.meta.webpackHot.decline")
.tap(
PLUGIN_NAME,
createDeclineHandler(parser, ImportMetaHotDeclineDependency)
);
parser.hooks.expression
.for("import.meta.webpackHot")
.tap(PLUGIN_NAME, createHMRExpressionHandler(parser));
};
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
// This applies the HMR plugin only to the targeted compiler
// It should not affect child compilations
if (compilation.compiler !== compiler) return;
// #region module.hot.* API
compilation.dependencyFactories.set(
ModuleHotAcceptDependency,
normalModuleFactory
);
compilation.dependencyTemplates.set(
ModuleHotAcceptDependency,
new ModuleHotAcceptDependency.Template()
);
compilation.dependencyFactories.set(
ModuleHotDeclineDependency,
normalModuleFactory
);
compilation.dependencyTemplates.set(
ModuleHotDeclineDependency,
new ModuleHotDeclineDependency.Template()
);
// #endregion
// #region import.meta.webpackHot.* API
compilation.dependencyFactories.set(
ImportMetaHotAcceptDependency,
normalModuleFactory
);
compilation.dependencyTemplates.set(
ImportMetaHotAcceptDependency,
new ImportMetaHotAcceptDependency.Template()
);
compilation.dependencyFactories.set(
ImportMetaHotDeclineDependency,
normalModuleFactory
);
compilation.dependencyTemplates.set(
ImportMetaHotDeclineDependency,
new ImportMetaHotDeclineDependency.Template()
);
// #endregion
/** @type {HotIndex} */
let hotIndex = 0;
/** @type {FullHashChunkModuleHashes} */
const fullHashChunkModuleHashes = {};
/** @type {ChunkModuleHashes} */
const chunkModuleHashes = {};
compilation.hooks.record.tap(PLUGIN_NAME, (compilation, records) => {
if (records.hash === compilation.hash) return;
const chunkGraph = compilation.chunkGraph;
records.hash = compilation.hash;
records.hotIndex = hotIndex;
records.fullHashChunkModuleHashes = fullHashChunkModuleHashes;
records.chunkModuleHashes = chunkModuleHashes;
records.chunkHashes = {};
records.chunkRuntime = {};
for (const chunk of compilation.chunks) {
const chunkId = /** @type {ChunkId} */ (chunk.id);
records.chunkHashes[chunkId] = /** @type {string} */ (chunk.hash);
records.chunkRuntime[chunkId] = getRuntimeKey(chunk.runtime);
}
records.chunkModuleIds = {};
for (const chunk of compilation.chunks) {
const chunkId = /** @type {ChunkId} */ (chunk.id);
records.chunkModuleIds[chunkId] = Array.from(
chunkGraph.getOrderedChunkModulesIterable(
chunk,
compareModulesById(chunkGraph)
),
(m) => /** @type {ModuleId} */ (chunkGraph.getModuleId(m))
);
}
});
/** @type {TupleSet<Module, Chunk>} */
const updatedModules = new TupleSet();
/** @type {TupleSet<Module, Chunk>} */
const fullHashModules = new TupleSet();
/** @type {TupleSet<Module, RuntimeSpec>} */
const nonCodeGeneratedModules = new TupleSet();
compilation.hooks.fullHash.tap(PLUGIN_NAME, (hash) => {
const chunkGraph = compilation.chunkGraph;
const records = /** @type {Records} */ (compilation.records);
for (const chunk of compilation.chunks) {
/**
* @param {Module} module module
* @returns {string} module hash
*/
const getModuleHash = (module) => {
const codeGenerationResults =
/** @type {CodeGenerationResults} */
(compilation.codeGenerationResults);
if (codeGenerationResults.has(module, chunk.runtime)) {
return codeGenerationResults.getHash(module, chunk.runtime);
}
nonCodeGeneratedModules.add(module, chunk.runtime);
return chunkGraph.getModuleHash(module, chunk.runtime);
};
const fullHashModulesInThisChunk =
chunkGraph.getChunkFullHashModulesSet(chunk);
if (fullHashModulesInThisChunk !== undefined) {
for (const module of fullHashModulesInThisChunk) {
fullHashModules.add(module, chunk);
}
}
const modules = chunkGraph.getChunkModulesIterable(chunk);
if (modules !== undefined) {
if (records.chunkModuleHashes) {
if (fullHashModulesInThisChunk !== undefined) {
for (const module of modules) {
const key = `${chunk.id}|${module.identifier()}`;
const hash = getModuleHash(module);
if (
fullHashModulesInThisChunk.has(
/** @type {RuntimeModule} */
(module)
)
) {
if (
/** @type {FullHashChunkModuleHashes} */
(records.fullHashChunkModuleHashes)[key] !== hash
) {
updatedModules.add(module, chunk);
}
fullHashChunkModuleHashes[key] = hash;
} else {
if (records.chunkModuleHashes[key] !== hash) {
updatedModules.add(module, chunk);
}
chunkModuleHashes[key] = hash;
}
}
} else {
for (const module of modules) {
const key = `${chunk.id}|${module.identifier()}`;
const hash = getModuleHash(module);
if (records.chunkModuleHashes[key] !== hash) {
updatedModules.add(module, chunk);
}
chunkModuleHashes[key] = hash;
}
}
} else if (fullHashModulesInThisChunk !== undefined) {
for (const module of modules) {
const key = `${chunk.id}|${module.identifier()}`;
const hash = getModuleHash(module);
if (
fullHashModulesInThisChunk.has(
/** @type {RuntimeModule} */ (module)
)
) {
fullHashChunkModuleHashes[key] = hash;
} else {
chunkModuleHashes[key] = hash;
}
}
} else {
for (const module of modules) {
const key = `${chunk.id}|${module.identifier()}`;
const hash = getModuleHash(module);
chunkModuleHashes[key] = hash;
}
}
}
}
hotIndex = records.hotIndex || 0;
if (updatedModules.size > 0) hotIndex++;
hash.update(`${hotIndex}`);
});
compilation.hooks.processAssets.tap(
{
name: PLUGIN_NAME,
stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
},
() => {
const chunkGraph = compilation.chunkGraph;
const records = /** @type {Records} */ (compilation.records);
if (records.hash === compilation.hash) return;
if (
!records.chunkModuleHashes ||
!records.chunkHashes ||
!records.chunkModuleIds
) {
return;
}
const codeGenerationResults =
/** @type {CodeGenerationResults} */
(compilation.codeGenerationResults);
for (const [module, chunk] of fullHashModules) {
const key = `${chunk.id}|${module.identifier()}`;
const hash = nonCodeGeneratedModules.has(module, chunk.runtime)
? chunkGraph.getModuleHash(module, chunk.runtime)
: codeGenerationResults.getHash(module, chunk.runtime);
if (records.chunkModuleHashes[key] !== hash) {
updatedModules.add(module, chunk);
}
chunkModuleHashes[key] = hash;
}
/** @type {HotUpdateMainContentByRuntime} */
const hotUpdateMainContentByRuntime = new Map();
/** @type {RuntimeSpec} */
let allOldRuntime;
const chunkRuntime =
/** @type {ChunkRuntime} */
(records.chunkRuntime);
for (const key of Object.keys(chunkRuntime)) {
const runtime = keyToRuntime(chunkRuntime[key]);
allOldRuntime = mergeRuntimeOwned(allOldRuntime, runtime);
}
forEachRuntime(allOldRuntime, (runtime) => {
const { path: filename, info: assetInfo } =
compilation.getPathWithInfo(
compilation.outputOptions.hotUpdateMainFilename,
{
hash: records.hash,
runtime
}
);
hotUpdateMainContentByRuntime.set(
/** @type {string} */ (runtime),
{
/** @type {ChunkIds} */
updatedChunkIds: new Set(),
/** @type {ChunkIds} */
removedChunkIds: new Set(),
/** @type {ModuleSet} */
removedModules: new Set(),
filename,
assetInfo
}
);
});
if (hotUpdateMainContentByRuntime.size === 0) return;
// Create a list of all active modules to verify which modules are removed completely
/** @type {Map<ModuleId, Module>} */
const allModules = new Map();
for (const module of compilation.modules) {
const id =
/** @type {ModuleId} */
(chunkGraph.getModuleId(module));
allModules.set(id, module);
}
// List of completely removed modules
/** @type {Set<ModuleId>} */
const completelyRemovedModules = new Set();
for (const key of Object.keys(records.chunkHashes)) {
const oldRuntime = keyToRuntime(
/** @type {ChunkRuntime} */
(records.chunkRuntime)[key]
);
/** @type {Module[]} */
const remainingModules = [];
// Check which modules are removed
for (const id of records.chunkModuleIds[key]) {
const module = allModules.get(id);
if (module === undefined) {
completelyRemovedModules.add(id);
} else {
remainingModules.push(module);
}
}
/** @type {ChunkId | null} */
let chunkId;
/** @type {undefined | Module[]} */
let newModules;
/** @type {undefined | RuntimeModule[]} */
let newRuntimeModules;
/** @type {undefined | RuntimeModule[]} */
let newFullHashModules;
/** @type {undefined | RuntimeModule[]} */
let newDependentHashModules;
/** @type {RuntimeSpec} */
let newRuntime;
/** @type {RuntimeSpec} */
let removedFromRuntime;
const currentChunk = find(
compilation.chunks,
(chunk) => `${chunk.id}` === key
);
if (currentChunk) {
chunkId = currentChunk.id;
newRuntime = intersectRuntime(
currentChunk.runtime,
allOldRuntime
);
if (newRuntime === undefined) continue;
newModules = chunkGraph
.getChunkModules(currentChunk)
.filter((module) => updatedModules.has(module, currentChunk));
newRuntimeModules = [
...chunkGraph.getChunkRuntimeModulesIterable(currentChunk)
].filter((module) => updatedModules.has(module, currentChunk));
const fullHashModules =
chunkGraph.getChunkFullHashModulesIterable(currentChunk);
newFullHashModules =
fullHashModules &&
[...fullHashModules].filter((module) =>
updatedModules.has(module, currentChunk)
);
const dependentHashModules =
chunkGraph.getChunkDependentHashModulesIterable(currentChunk);
newDependentHashModules =
dependentHashModules &&
[...dependentHashModules].filter((module) =>
updatedModules.has(module, currentChunk)
);
removedFromRuntime = subtractRuntime(oldRuntime, newRuntime);
} else {
// chunk has completely removed
chunkId = `${Number(key)}` === key ? Number(key) : key;
removedFromRuntime = oldRuntime;
newRuntime = oldRuntime;
}
if (removedFromRuntime) {
// chunk was removed from some runtimes
forEachRuntime(removedFromRuntime, (runtime) => {
const item =
/** @type {HotUpdateMainContentByRuntimeItem} */
(
hotUpdateMainContentByRuntime.get(
/** @type {string} */ (runtime)
)
);
item.removedChunkIds.add(/** @type {ChunkId} */ (chunkId));
});
// dispose modules from the chunk in these runtimes
// where they are no longer in this runtime
for (const module of remainingModules) {
const moduleKey = `${key}|${module.identifier()}`;
const oldHash = records.chunkModuleHashes[moduleKey];
const runtimes = chunkGraph.getModuleRuntimes(module);
if (oldRuntime === newRuntime && runtimes.has(newRuntime)) {
// Module is still in the same runtime combination
const hash = nonCodeGeneratedModules.has(module, newRuntime)
? chunkGraph.getModuleHash(module, newRuntime)
: codeGenerationResults.getHash(module, newRuntime);
if (hash !== oldHash) {
if (module.type === WEBPACK_MODULE_TYPE_RUNTIME) {
newRuntimeModules = newRuntimeModules || [];
newRuntimeModules.push(
/** @type {RuntimeModule} */ (module)
);
} else {
newModules = newModules || [];
newModules.push(module);
}
}
} else {
// module is no longer in this runtime combination
// We (incorrectly) assume that it's not in an overlapping runtime combination
// and dispose it from the main runtimes the chunk was removed from
forEachRuntime(removedFromRuntime, (runtime) => {
// If the module is still used in this runtime, do not dispose it
// This could create a bad runtime state where the module is still loaded,
// but no chunk which contains it. This means we don't receive further HMR updates
// to this module and that's bad.
// TODO force load one of the chunks which contains the module
for (const moduleRuntime of runtimes) {
if (typeof moduleRuntime === "string") {
if (moduleRuntime === runtime) return;
} else if (
moduleRuntime !== undefined &&
moduleRuntime.has(/** @type {string} */ (runtime))
) {
return;
}
}
const item =
/** @type {HotUpdateMainContentByRuntimeItem} */ (
hotUpdateMainContentByRuntime.get(
/** @type {string} */ (runtime)
)
);
item.removedModules.add(module);
});
}
}
}
if (
(newModules && newModules.length > 0) ||
(newRuntimeModules && newRuntimeModules.length > 0)
) {
const hotUpdateChunk = new HotUpdateChunk();
if (backCompat) {
ChunkGraph.setChunkGraphForChunk(hotUpdateChunk, chunkGraph);
}
hotUpdateChunk.id = chunkId;
hotUpdateChunk.runtime = currentChunk
? currentChunk.runtime
: newRuntime;
if (currentChunk) {
for (const group of currentChunk.groupsIterable) {
hotUpdateChunk.addGroup(group);
}
}
chunkGraph.attachModules(hotUpdateChunk, newModules || []);
chunkGraph.attachRuntimeModules(
hotUpdateChunk,
newRuntimeModules || []
);
if (newFullHashModules) {
chunkGraph.attachFullHashModules(
hotUpdateChunk,
newFullHashModules
);
}
if (newDependentHashModules) {
chunkGraph.attachDependentHashModules(
hotUpdateChunk,
newDependentHashModules
);
}
const renderManifest = compilation.getRenderManifest({
chunk: hotUpdateChunk,
hash: /** @type {string} */ (records.hash),
fullHash: /** @type {string} */ (records.hash),
outputOptions: compilation.outputOptions,
moduleTemplates: compilation.moduleTemplates,
dependencyTemplates: compilation.dependencyTemplates,
codeGenerationResults: /** @type {CodeGenerationResults} */ (
compilation.codeGenerationResults
),
runtimeTemplate: compilation.runtimeTemplate,
moduleGraph: compilation.moduleGraph,
chunkGraph
});
for (const entry of renderManifest) {
/** @type {string} */
let filename;
/** @type {AssetInfo} */
let assetInfo;
if ("filename" in entry) {
filename = entry.filename;
assetInfo = entry.info;
} else {
({ path: filename, info: assetInfo } =
compilation.getPathWithInfo(
entry.filenameTemplate,
entry.pathOptions
));
}
const source = entry.render();
compilation.additionalChunkAssets.push(filename);
compilation.emitAsset(filename, source, {
hotModuleReplacement: true,
...assetInfo
});
if (currentChunk) {
currentChunk.files.add(filename);
compilation.hooks.chunkAsset.call(currentChunk, filename);
}
}
forEachRuntime(newRuntime, (runtime) => {
const item =
/** @type {HotUpdateMainContentByRuntimeItem} */ (
hotUpdateMainContentByRuntime.get(
/** @type {string} */ (runtime)
)
);
item.updatedChunkIds.add(/** @type {ChunkId} */ (chunkId));
});
}
}
const completelyRemovedModulesArray = [...completelyRemovedModules];
/** @type {Map<string, Omit<HotUpdateMainContentByRuntimeItem, "filename">>} */
const hotUpdateMainContentByFilename = new Map();
for (const {
removedChunkIds,
removedModules,
updatedChunkIds,
filename,
assetInfo
} of hotUpdateMainContentByRuntime.values()) {
const old = hotUpdateMainContentByFilename.get(filename);
if (
old &&
(!isSubset(old.removedChunkIds, removedChunkIds) ||
!isSubset(old.removedModules, removedModules) ||
!isSubset(old.updatedChunkIds, updatedChunkIds))
) {
compilation.warnings.push(
new WebpackError(`HotModuleReplacementPlugin
The configured output.hotUpdateMainFilename doesn't lead to unique filenames per runtime and HMR update differs between runtimes.
This might lead to incorrect runtime behavior of the applied update.
To fix this, make sure to include [runtime] in the output.hotUpdateMainFilename option, or use the default config.`)
);
for (const chunkId of removedChunkIds) {
old.removedChunkIds.add(chunkId);
}
for (const chunkId of removedModules) {
old.removedModules.add(chunkId);
}
for (const chunkId of updatedChunkIds) {
old.updatedChunkIds.add(chunkId);
}
continue;
}
hotUpdateMainContentByFilename.set(filename, {
removedChunkIds,
removedModules,
updatedChunkIds,
assetInfo
});
}
for (const [
filename,
{ removedChunkIds, removedModules, updatedChunkIds, assetInfo }
] of hotUpdateMainContentByFilename) {
/** @type {{ c: ChunkId[], r: ChunkId[], m: ModuleId[], css?: { r: ChunkId[] } }} */
const hotUpdateMainJson = {
c: [...updatedChunkIds],
r: [...removedChunkIds],
m:
removedModules.size === 0
? completelyRemovedModulesArray
: [
...completelyRemovedModulesArray,
...Array.from(
removedModules,
(m) =>
/** @type {ModuleId} */ (chunkGraph.getModuleId(m))
)
]
};
// Build CSS removed chunks list (chunks in updatedChunkIds that no longer have CSS)
/** @type {ChunkId[]} */
const cssRemovedChunkIds = [];
if (compilation.options.experiments.css) {
for (const chunkId of updatedChunkIds) {
for (const /** @type {Chunk} */ chunk of compilation.chunks) {
if (chunk.id === chunkId) {
if (!chunkHasCss(chunk, chunkGraph)) {
cssRemovedChunkIds.push(chunkId);
}
break;
}
}
}
}
if (cssRemovedChunkIds.length > 0) {
hotUpdateMainJson.css = { r: cssRemovedChunkIds };
}
const source = new RawSource(
(filename.endsWith(".json") ? "" : "export default ") +
JSON.stringify(hotUpdateMainJson)
);
compilation.emitAsset(filename, source, {
hotModuleReplacement: true,
...assetInfo
});
}
}
);
compilation.hooks.additionalTreeRuntimeRequirements.tap(
PLUGIN_NAME,
(chunk, runtimeRequirements) => {
runtimeRequirements.add(RuntimeGlobals.hmrDownloadManifest);
runtimeRequirements.add(RuntimeGlobals.hmrDownloadUpdateHandlers);
runtimeRequirements.add(RuntimeGlobals.interceptModuleExecution);
runtimeRequirements.add(RuntimeGlobals.moduleCache);
compilation.addRuntimeModule(
chunk,
new HotModuleReplacementRuntimeModule()
);
}
);
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_AUTO)
.tap(PLUGIN_NAME, (parser) => {
applyModuleHot(parser);
applyImportMetaHot(parser);
});
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_DYNAMIC)
.tap(PLUGIN_NAME, (parser) => {
applyModuleHot(parser);
});
normalModuleFactory.hooks.parser
.for(JAVASCRIPT_MODULE_TYPE_ESM)
.tap(PLUGIN_NAME, (parser) => {
applyImportMetaHot(parser);
});
normalModuleFactory.hooks.module.tap(PLUGIN_NAME, (module) => {
module.hot = true;
return module;
});
NormalModule.getCompilationHooks(compilation).loader.tap(
PLUGIN_NAME,
(context) => {
context.hot = true;
}
);
}
);
}
}
module.exports = HotModuleReplacementPlugin;

View File

@@ -0,0 +1,926 @@
import type { Maybe } from '../jsutils/Maybe';
import type { ObjMap } from '../jsutils/ObjMap';
import type { Path } from '../jsutils/Path';
import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
import type {
EnumTypeDefinitionNode,
EnumTypeExtensionNode,
EnumValueDefinitionNode,
FieldDefinitionNode,
FieldNode,
FragmentDefinitionNode,
InputObjectTypeDefinitionNode,
InputObjectTypeExtensionNode,
InputValueDefinitionNode,
InterfaceTypeDefinitionNode,
InterfaceTypeExtensionNode,
ObjectTypeDefinitionNode,
ObjectTypeExtensionNode,
OperationDefinitionNode,
ScalarTypeDefinitionNode,
ScalarTypeExtensionNode,
UnionTypeDefinitionNode,
UnionTypeExtensionNode,
ValueNode,
} from '../language/ast';
import type { GraphQLSchema } from './schema';
/**
* These are all of the possible kinds of types.
*/
export declare type GraphQLType =
| GraphQLScalarType
| GraphQLObjectType
| GraphQLInterfaceType
| GraphQLUnionType
| GraphQLEnumType
| GraphQLInputObjectType
| GraphQLList<GraphQLType>
| GraphQLNonNull<
| GraphQLScalarType
| GraphQLObjectType
| GraphQLInterfaceType
| GraphQLUnionType
| GraphQLEnumType
| GraphQLInputObjectType
| GraphQLList<GraphQLType>
>;
export declare function isType(type: unknown): type is GraphQLType;
export declare function assertType(type: unknown): GraphQLType;
/**
* There are predicates for each kind of GraphQL type.
*/
export declare function isScalarType(type: unknown): type is GraphQLScalarType;
export declare function assertScalarType(type: unknown): GraphQLScalarType;
export declare function isObjectType(type: unknown): type is GraphQLObjectType;
export declare function assertObjectType(type: unknown): GraphQLObjectType;
export declare function isInterfaceType(
type: unknown,
): type is GraphQLInterfaceType;
export declare function assertInterfaceType(
type: unknown,
): GraphQLInterfaceType;
export declare function isUnionType(type: unknown): type is GraphQLUnionType;
export declare function assertUnionType(type: unknown): GraphQLUnionType;
export declare function isEnumType(type: unknown): type is GraphQLEnumType;
export declare function assertEnumType(type: unknown): GraphQLEnumType;
export declare function isInputObjectType(
type: unknown,
): type is GraphQLInputObjectType;
export declare function assertInputObjectType(
type: unknown,
): GraphQLInputObjectType;
export declare function isListType(
type: GraphQLInputType,
): type is GraphQLList<GraphQLInputType>;
export declare function isListType(
type: GraphQLOutputType,
): type is GraphQLList<GraphQLOutputType>;
export declare function isListType(
type: unknown,
): type is GraphQLList<GraphQLType>;
export declare function assertListType(type: unknown): GraphQLList<GraphQLType>;
export declare function isNonNullType(
type: GraphQLInputType,
): type is GraphQLNonNull<GraphQLInputType>;
export declare function isNonNullType(
type: GraphQLOutputType,
): type is GraphQLNonNull<GraphQLOutputType>;
export declare function isNonNullType(
type: unknown,
): type is GraphQLNonNull<GraphQLType>;
export declare function assertNonNullType(
type: unknown,
): GraphQLNonNull<GraphQLType>;
/**
* These types may be used as input types for arguments and directives.
*/
export declare type GraphQLInputType =
| GraphQLScalarType
| GraphQLEnumType
| GraphQLInputObjectType
| GraphQLList<GraphQLInputType>
| GraphQLNonNull<
| GraphQLScalarType
| GraphQLEnumType
| GraphQLInputObjectType
| GraphQLList<GraphQLInputType>
>;
export declare function isInputType(type: unknown): type is GraphQLInputType;
export declare function assertInputType(type: unknown): GraphQLInputType;
/**
* These types may be used as output types as the result of fields.
*/
export declare type GraphQLOutputType =
| GraphQLScalarType
| GraphQLObjectType
| GraphQLInterfaceType
| GraphQLUnionType
| GraphQLEnumType
| GraphQLList<GraphQLOutputType>
| GraphQLNonNull<
| GraphQLScalarType
| GraphQLObjectType
| GraphQLInterfaceType
| GraphQLUnionType
| GraphQLEnumType
| GraphQLList<GraphQLOutputType>
>;
export declare function isOutputType(type: unknown): type is GraphQLOutputType;
export declare function assertOutputType(type: unknown): GraphQLOutputType;
/**
* These types may describe types which may be leaf values.
*/
export declare type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType;
export declare function isLeafType(type: unknown): type is GraphQLLeafType;
export declare function assertLeafType(type: unknown): GraphQLLeafType;
/**
* These types may describe the parent context of a selection set.
*/
export declare type GraphQLCompositeType =
| GraphQLObjectType
| GraphQLInterfaceType
| GraphQLUnionType;
export declare function isCompositeType(
type: unknown,
): type is GraphQLCompositeType;
export declare function assertCompositeType(
type: unknown,
): GraphQLCompositeType;
/**
* These types may describe the parent context of a selection set.
*/
export declare type GraphQLAbstractType =
| GraphQLInterfaceType
| GraphQLUnionType;
export declare function isAbstractType(
type: unknown,
): type is GraphQLAbstractType;
export declare function assertAbstractType(type: unknown): GraphQLAbstractType;
/**
* List Type Wrapper
*
* A list is a wrapping type which points to another type.
* Lists are often created within the context of defining the fields of
* an object type.
*
* Example:
*
* ```ts
* const PersonType = new GraphQLObjectType({
* name: 'Person',
* fields: () => ({
* parents: { type: new GraphQLList(PersonType) },
* children: { type: new GraphQLList(PersonType) },
* })
* })
* ```
*/
export declare class GraphQLList<T extends GraphQLType> {
readonly ofType: T;
constructor(ofType: T);
get [Symbol.toStringTag](): string;
toString(): string;
toJSON(): string;
}
/**
* Non-Null Type Wrapper
*
* A non-null is a wrapping type which points to another type.
* Non-null types enforce that their values are never null and can ensure
* an error is raised if this ever occurs during a request. It is useful for
* fields which you can make a strong guarantee on non-nullability, for example
* usually the id field of a database row will never be null.
*
* Example:
*
* ```ts
* const RowType = new GraphQLObjectType({
* name: 'Row',
* fields: () => ({
* id: { type: new GraphQLNonNull(GraphQLString) },
* })
* })
* ```
* Note: the enforcement of non-nullability occurs within the executor.
*/
export declare class GraphQLNonNull<T extends GraphQLNullableType> {
readonly ofType: T;
constructor(ofType: T);
get [Symbol.toStringTag](): string;
toString(): string;
toJSON(): string;
}
/**
* These types wrap and modify other types
*/
export declare type GraphQLWrappingType =
| GraphQLList<GraphQLType>
| GraphQLNonNull<GraphQLType>;
export declare function isWrappingType(
type: unknown,
): type is GraphQLWrappingType;
export declare function assertWrappingType(type: unknown): GraphQLWrappingType;
/**
* These types can all accept null as a value.
*/
export declare type GraphQLNullableType =
| GraphQLScalarType
| GraphQLObjectType
| GraphQLInterfaceType
| GraphQLUnionType
| GraphQLEnumType
| GraphQLInputObjectType
| GraphQLList<GraphQLType>;
export declare function isNullableType(
type: unknown,
): type is GraphQLNullableType;
export declare function assertNullableType(type: unknown): GraphQLNullableType;
export declare function getNullableType(type: undefined | null): void;
export declare function getNullableType<T extends GraphQLNullableType>(
type: T | GraphQLNonNull<T>,
): T;
export declare function getNullableType(
type: Maybe<GraphQLType>,
): GraphQLNullableType | undefined;
/**
* These named types do not include modifiers like List or NonNull.
*/
export declare type GraphQLNamedType =
| GraphQLNamedInputType
| GraphQLNamedOutputType;
export declare type GraphQLNamedInputType =
| GraphQLScalarType
| GraphQLEnumType
| GraphQLInputObjectType;
export declare type GraphQLNamedOutputType =
| GraphQLScalarType
| GraphQLObjectType
| GraphQLInterfaceType
| GraphQLUnionType
| GraphQLEnumType;
export declare function isNamedType(type: unknown): type is GraphQLNamedType;
export declare function assertNamedType(type: unknown): GraphQLNamedType;
export declare function getNamedType(type: undefined | null): void;
export declare function getNamedType(
type: GraphQLInputType,
): GraphQLNamedInputType;
export declare function getNamedType(
type: GraphQLOutputType,
): GraphQLNamedOutputType;
export declare function getNamedType(type: GraphQLType): GraphQLNamedType;
export declare function getNamedType(
type: Maybe<GraphQLType>,
): GraphQLNamedType | undefined;
/**
* Used while defining GraphQL types to allow for circular references in
* otherwise immutable type definitions.
*/
export declare type ThunkReadonlyArray<T> =
| (() => ReadonlyArray<T>)
| ReadonlyArray<T>;
export declare type ThunkObjMap<T> = (() => ObjMap<T>) | ObjMap<T>;
export declare function resolveReadonlyArrayThunk<T>(
thunk: ThunkReadonlyArray<T>,
): ReadonlyArray<T>;
export declare function resolveObjMapThunk<T>(thunk: ThunkObjMap<T>): ObjMap<T>;
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*/
export interface GraphQLScalarTypeExtensions {
[attributeName: string]: unknown;
}
/**
* Scalar Type Definition
*
* The leaf values of any request and input values to arguments are
* Scalars (or Enums) and are defined with a name and a series of functions
* used to parse input from ast or variables and to ensure validity.
*
* If a type's serialize function returns `null` or does not return a value
* (i.e. it returns `undefined`) then an error will be raised and a `null`
* value will be returned in the response. It is always better to validate
*
* Example:
*
* ```ts
* const OddType = new GraphQLScalarType({
* name: 'Odd',
* serialize(value) {
* if (!Number.isFinite(value)) {
* throw new Error(
* `Scalar "Odd" cannot represent "${value}" since it is not a finite number.`,
* );
* }
*
* if (value % 2 === 0) {
* throw new Error(`Scalar "Odd" cannot represent "${value}" since it is even.`);
* }
* return value;
* }
* });
* ```
*/
export declare class GraphQLScalarType<
TInternal = unknown,
TExternal = TInternal,
> {
name: string;
description: Maybe<string>;
specifiedByURL: Maybe<string>;
serialize: GraphQLScalarSerializer<TExternal>;
parseValue: GraphQLScalarValueParser<TInternal>;
parseLiteral: GraphQLScalarLiteralParser<TInternal>;
extensions: Readonly<GraphQLScalarTypeExtensions>;
astNode: Maybe<ScalarTypeDefinitionNode>;
extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
constructor(config: Readonly<GraphQLScalarTypeConfig<TInternal, TExternal>>);
get [Symbol.toStringTag](): string;
toConfig(): GraphQLScalarTypeNormalizedConfig<TInternal, TExternal>;
toString(): string;
toJSON(): string;
}
export declare type GraphQLScalarSerializer<TExternal> = (
outputValue: unknown,
) => TExternal;
export declare type GraphQLScalarValueParser<TInternal> = (
inputValue: unknown,
) => TInternal;
export declare type GraphQLScalarLiteralParser<TInternal> = (
valueNode: ValueNode,
variables?: Maybe<ObjMap<unknown>>,
) => TInternal;
export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
name: string;
description?: Maybe<string>;
specifiedByURL?: Maybe<string>;
/** Serializes an internal value to include in a response. */
serialize?: GraphQLScalarSerializer<TExternal>;
/** Parses an externally provided value to use as an input. */
parseValue?: GraphQLScalarValueParser<TInternal>;
/** Parses an externally provided literal value to use as an input. */
parseLiteral?: GraphQLScalarLiteralParser<TInternal>;
extensions?: Maybe<Readonly<GraphQLScalarTypeExtensions>>;
astNode?: Maybe<ScalarTypeDefinitionNode>;
extensionASTNodes?: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
}
interface GraphQLScalarTypeNormalizedConfig<TInternal, TExternal>
extends GraphQLScalarTypeConfig<TInternal, TExternal> {
serialize: GraphQLScalarSerializer<TExternal>;
parseValue: GraphQLScalarValueParser<TInternal>;
parseLiteral: GraphQLScalarLiteralParser<TInternal>;
extensions: Readonly<GraphQLScalarTypeExtensions>;
extensionASTNodes: ReadonlyArray<ScalarTypeExtensionNode>;
}
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*
* We've provided these template arguments because this is an open type and
* you may find them useful.
*/
export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> {
[attributeName: string]: unknown;
}
/**
* Object Type Definition
*
* Almost all of the GraphQL types you define will be object types. Object types
* have a name, but most importantly describe their fields.
*
* Example:
*
* ```ts
* const AddressType = new GraphQLObjectType({
* name: 'Address',
* fields: {
* street: { type: GraphQLString },
* number: { type: GraphQLInt },
* formatted: {
* type: GraphQLString,
* resolve(obj) {
* return obj.number + ' ' + obj.street
* }
* }
* }
* });
* ```
*
* When two types need to refer to each other, or a type needs to refer to
* itself in a field, you can use a function expression (aka a closure or a
* thunk) to supply the fields lazily.
*
* Example:
*
* ```ts
* const PersonType = new GraphQLObjectType({
* name: 'Person',
* fields: () => ({
* name: { type: GraphQLString },
* bestFriend: { type: PersonType },
* })
* });
* ```
*/
export declare class GraphQLObjectType<TSource = any, TContext = any> {
name: string;
description: Maybe<string>;
isTypeOf: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
extensions: Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>;
astNode: Maybe<ObjectTypeDefinitionNode>;
extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
private _fields;
private _interfaces;
constructor(config: Readonly<GraphQLObjectTypeConfig<TSource, TContext>>);
get [Symbol.toStringTag](): string;
getFields(): GraphQLFieldMap<TSource, TContext>;
getInterfaces(): ReadonlyArray<GraphQLInterfaceType>;
toConfig(): GraphQLObjectTypeNormalizedConfig<TSource, TContext>;
toString(): string;
toJSON(): string;
}
export declare function defineArguments(
config: GraphQLFieldConfigArgumentMap,
): ReadonlyArray<GraphQLArgument>;
/**
* @internal
*/
export declare function argsToArgsConfig(
args: ReadonlyArray<GraphQLArgument>,
): GraphQLFieldConfigArgumentMap;
export interface GraphQLObjectTypeConfig<TSource, TContext> {
name: string;
description?: Maybe<string>;
interfaces?: ThunkReadonlyArray<GraphQLInterfaceType>;
fields: ThunkObjMap<GraphQLFieldConfig<TSource, TContext>>;
isTypeOf?: Maybe<GraphQLIsTypeOfFn<TSource, TContext>>;
extensions?: Maybe<Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>>;
astNode?: Maybe<ObjectTypeDefinitionNode>;
extensionASTNodes?: Maybe<ReadonlyArray<ObjectTypeExtensionNode>>;
}
interface GraphQLObjectTypeNormalizedConfig<TSource, TContext>
extends GraphQLObjectTypeConfig<any, any> {
interfaces: ReadonlyArray<GraphQLInterfaceType>;
fields: GraphQLFieldConfigMap<any, any>;
extensions: Readonly<GraphQLObjectTypeExtensions<TSource, TContext>>;
extensionASTNodes: ReadonlyArray<ObjectTypeExtensionNode>;
}
export declare type GraphQLTypeResolver<TSource, TContext> = (
value: TSource,
context: TContext,
info: GraphQLResolveInfo,
abstractType: GraphQLAbstractType,
) => PromiseOrValue<string | undefined>;
export declare type GraphQLIsTypeOfFn<TSource, TContext> = (
source: TSource,
context: TContext,
info: GraphQLResolveInfo,
) => PromiseOrValue<boolean>;
export declare type GraphQLFieldResolver<
TSource,
TContext,
TArgs = any,
TResult = unknown,
> = (
source: TSource,
args: TArgs,
context: TContext,
info: GraphQLResolveInfo,
) => TResult;
export interface GraphQLResolveInfo {
readonly fieldName: string;
readonly fieldNodes: ReadonlyArray<FieldNode>;
readonly returnType: GraphQLOutputType;
readonly parentType: GraphQLObjectType;
readonly path: Path;
readonly schema: GraphQLSchema;
readonly fragments: ObjMap<FragmentDefinitionNode>;
readonly rootValue: unknown;
readonly operation: OperationDefinitionNode;
readonly variableValues: {
[variable: string]: unknown;
};
}
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*
* We've provided these template arguments because this is an open type and
* you may find them useful.
*/
export interface GraphQLFieldExtensions<_TSource, _TContext, _TArgs = any> {
[attributeName: string]: unknown;
}
export interface GraphQLFieldConfig<TSource, TContext, TArgs = any> {
description?: Maybe<string>;
type: GraphQLOutputType;
args?: GraphQLFieldConfigArgumentMap;
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
deprecationReason?: Maybe<string>;
extensions?: Maybe<
Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>
>;
astNode?: Maybe<FieldDefinitionNode>;
}
export declare type GraphQLFieldConfigArgumentMap =
ObjMap<GraphQLArgumentConfig>;
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*/
export interface GraphQLArgumentExtensions {
[attributeName: string]: unknown;
}
export interface GraphQLArgumentConfig {
description?: Maybe<string>;
type: GraphQLInputType;
defaultValue?: unknown;
deprecationReason?: Maybe<string>;
extensions?: Maybe<Readonly<GraphQLArgumentExtensions>>;
astNode?: Maybe<InputValueDefinitionNode>;
}
export declare type GraphQLFieldConfigMap<TSource, TContext> = ObjMap<
GraphQLFieldConfig<TSource, TContext>
>;
export interface GraphQLField<TSource, TContext, TArgs = any> {
name: string;
description: Maybe<string>;
type: GraphQLOutputType;
args: ReadonlyArray<GraphQLArgument>;
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
deprecationReason: Maybe<string>;
extensions: Readonly<GraphQLFieldExtensions<TSource, TContext, TArgs>>;
astNode: Maybe<FieldDefinitionNode>;
}
export interface GraphQLArgument {
name: string;
description: Maybe<string>;
type: GraphQLInputType;
defaultValue: unknown;
deprecationReason: Maybe<string>;
extensions: Readonly<GraphQLArgumentExtensions>;
astNode: Maybe<InputValueDefinitionNode>;
}
export declare function isRequiredArgument(arg: GraphQLArgument): boolean;
export declare type GraphQLFieldMap<TSource, TContext> = ObjMap<
GraphQLField<TSource, TContext>
>;
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*/
export interface GraphQLInterfaceTypeExtensions {
[attributeName: string]: unknown;
}
/**
* Interface Type Definition
*
* When a field can return one of a heterogeneous set of types, a Interface type
* is used to describe what types are possible, what fields are in common across
* all types, as well as a function to determine which type is actually used
* when the field is resolved.
*
* Example:
*
* ```ts
* const EntityType = new GraphQLInterfaceType({
* name: 'Entity',
* fields: {
* name: { type: GraphQLString }
* }
* });
* ```
*/
export declare class GraphQLInterfaceType {
name: string;
description: Maybe<string>;
resolveType: Maybe<GraphQLTypeResolver<any, any>>;
extensions: Readonly<GraphQLInterfaceTypeExtensions>;
astNode: Maybe<InterfaceTypeDefinitionNode>;
extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
private _fields;
private _interfaces;
constructor(config: Readonly<GraphQLInterfaceTypeConfig<any, any>>);
get [Symbol.toStringTag](): string;
getFields(): GraphQLFieldMap<any, any>;
getInterfaces(): ReadonlyArray<GraphQLInterfaceType>;
toConfig(): GraphQLInterfaceTypeNormalizedConfig;
toString(): string;
toJSON(): string;
}
export interface GraphQLInterfaceTypeConfig<TSource, TContext> {
name: string;
description?: Maybe<string>;
interfaces?: ThunkReadonlyArray<GraphQLInterfaceType>;
fields: ThunkObjMap<GraphQLFieldConfig<TSource, TContext>>;
/**
* Optionally provide a custom type resolver function. If one is not provided,
* the default implementation will call `isTypeOf` on each implementing
* Object type.
*/
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
extensions?: Maybe<Readonly<GraphQLInterfaceTypeExtensions>>;
astNode?: Maybe<InterfaceTypeDefinitionNode>;
extensionASTNodes?: Maybe<ReadonlyArray<InterfaceTypeExtensionNode>>;
}
export interface GraphQLInterfaceTypeNormalizedConfig
extends GraphQLInterfaceTypeConfig<any, any> {
interfaces: ReadonlyArray<GraphQLInterfaceType>;
fields: GraphQLFieldConfigMap<any, any>;
extensions: Readonly<GraphQLInterfaceTypeExtensions>;
extensionASTNodes: ReadonlyArray<InterfaceTypeExtensionNode>;
}
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*/
export interface GraphQLUnionTypeExtensions {
[attributeName: string]: unknown;
}
/**
* Union Type Definition
*
* When a field can return one of a heterogeneous set of types, a Union type
* is used to describe what types are possible as well as providing a function
* to determine which type is actually used when the field is resolved.
*
* Example:
*
* ```ts
* const PetType = new GraphQLUnionType({
* name: 'Pet',
* types: [ DogType, CatType ],
* resolveType(value) {
* if (value instanceof Dog) {
* return DogType;
* }
* if (value instanceof Cat) {
* return CatType;
* }
* }
* });
* ```
*/
export declare class GraphQLUnionType {
name: string;
description: Maybe<string>;
resolveType: Maybe<GraphQLTypeResolver<any, any>>;
extensions: Readonly<GraphQLUnionTypeExtensions>;
astNode: Maybe<UnionTypeDefinitionNode>;
extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
private _types;
constructor(config: Readonly<GraphQLUnionTypeConfig<any, any>>);
get [Symbol.toStringTag](): string;
getTypes(): ReadonlyArray<GraphQLObjectType>;
toConfig(): GraphQLUnionTypeNormalizedConfig;
toString(): string;
toJSON(): string;
}
export interface GraphQLUnionTypeConfig<TSource, TContext> {
name: string;
description?: Maybe<string>;
types: ThunkReadonlyArray<GraphQLObjectType>;
/**
* Optionally provide a custom type resolver function. If one is not provided,
* the default implementation will call `isTypeOf` on each implementing
* Object type.
*/
resolveType?: Maybe<GraphQLTypeResolver<TSource, TContext>>;
extensions?: Maybe<Readonly<GraphQLUnionTypeExtensions>>;
astNode?: Maybe<UnionTypeDefinitionNode>;
extensionASTNodes?: Maybe<ReadonlyArray<UnionTypeExtensionNode>>;
}
interface GraphQLUnionTypeNormalizedConfig
extends GraphQLUnionTypeConfig<any, any> {
types: ReadonlyArray<GraphQLObjectType>;
extensions: Readonly<GraphQLUnionTypeExtensions>;
extensionASTNodes: ReadonlyArray<UnionTypeExtensionNode>;
}
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*/
export interface GraphQLEnumTypeExtensions {
[attributeName: string]: unknown;
}
/**
* Enum Type Definition
*
* Some leaf values of requests and input values are Enums. GraphQL serializes
* Enum values as strings, however internally Enums can be represented by any
* kind of type, often integers.
*
* Example:
*
* ```ts
* const RGBType = new GraphQLEnumType({
* name: 'RGB',
* values: {
* RED: { value: 0 },
* GREEN: { value: 1 },
* BLUE: { value: 2 }
* }
* });
* ```
*
* Note: If a value is not provided in a definition, the name of the enum value
* will be used as its internal value.
*/
export declare class GraphQLEnumType {
name: string;
description: Maybe<string>;
extensions: Readonly<GraphQLEnumTypeExtensions>;
astNode: Maybe<EnumTypeDefinitionNode>;
extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
private _values;
private _valueLookup;
private _nameLookup;
constructor(config: Readonly<GraphQLEnumTypeConfig>);
get [Symbol.toStringTag](): string;
getValues(): ReadonlyArray<GraphQLEnumValue>;
getValue(name: string): Maybe<GraphQLEnumValue>;
serialize(outputValue: unknown): Maybe<string>;
parseValue(inputValue: unknown): Maybe<any>;
parseLiteral(
valueNode: ValueNode,
_variables: Maybe<ObjMap<unknown>>,
): Maybe<any>;
toConfig(): GraphQLEnumTypeNormalizedConfig;
toString(): string;
toJSON(): string;
}
export interface GraphQLEnumTypeConfig {
name: string;
description?: Maybe<string>;
values: ThunkObjMap<GraphQLEnumValueConfig>;
extensions?: Maybe<Readonly<GraphQLEnumTypeExtensions>>;
astNode?: Maybe<EnumTypeDefinitionNode>;
extensionASTNodes?: Maybe<ReadonlyArray<EnumTypeExtensionNode>>;
}
interface GraphQLEnumTypeNormalizedConfig extends GraphQLEnumTypeConfig {
values: ObjMap<GraphQLEnumValueConfig>;
extensions: Readonly<GraphQLEnumTypeExtensions>;
extensionASTNodes: ReadonlyArray<EnumTypeExtensionNode>;
}
export declare type GraphQLEnumValueConfigMap = ObjMap<GraphQLEnumValueConfig>;
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*/
export interface GraphQLEnumValueExtensions {
[attributeName: string]: unknown;
}
export interface GraphQLEnumValueConfig {
description?: Maybe<string>;
value?: any;
deprecationReason?: Maybe<string>;
extensions?: Maybe<Readonly<GraphQLEnumValueExtensions>>;
astNode?: Maybe<EnumValueDefinitionNode>;
}
export interface GraphQLEnumValue {
name: string;
description: Maybe<string>;
value: any;
deprecationReason: Maybe<string>;
extensions: Readonly<GraphQLEnumValueExtensions>;
astNode: Maybe<EnumValueDefinitionNode>;
}
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*/
export interface GraphQLInputObjectTypeExtensions {
[attributeName: string]: unknown;
}
/**
* Input Object Type Definition
*
* An input object defines a structured collection of fields which may be
* supplied to a field argument.
*
* Using `NonNull` will ensure that a value must be provided by the query
*
* Example:
*
* ```ts
* const GeoPoint = new GraphQLInputObjectType({
* name: 'GeoPoint',
* fields: {
* lat: { type: new GraphQLNonNull(GraphQLFloat) },
* lon: { type: new GraphQLNonNull(GraphQLFloat) },
* alt: { type: GraphQLFloat, defaultValue: 0 },
* }
* });
* ```
*/
export declare class GraphQLInputObjectType {
name: string;
description: Maybe<string>;
extensions: Readonly<GraphQLInputObjectTypeExtensions>;
astNode: Maybe<InputObjectTypeDefinitionNode>;
extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
isOneOf: boolean;
private _fields;
constructor(config: Readonly<GraphQLInputObjectTypeConfig>);
get [Symbol.toStringTag](): string;
getFields(): GraphQLInputFieldMap;
toConfig(): GraphQLInputObjectTypeNormalizedConfig;
toString(): string;
toJSON(): string;
}
export interface GraphQLInputObjectTypeConfig {
name: string;
description?: Maybe<string>;
fields: ThunkObjMap<GraphQLInputFieldConfig>;
extensions?: Maybe<Readonly<GraphQLInputObjectTypeExtensions>>;
astNode?: Maybe<InputObjectTypeDefinitionNode>;
extensionASTNodes?: Maybe<ReadonlyArray<InputObjectTypeExtensionNode>>;
isOneOf?: boolean;
}
interface GraphQLInputObjectTypeNormalizedConfig
extends GraphQLInputObjectTypeConfig {
fields: GraphQLInputFieldConfigMap;
extensions: Readonly<GraphQLInputObjectTypeExtensions>;
extensionASTNodes: ReadonlyArray<InputObjectTypeExtensionNode>;
}
/**
* Custom extensions
*
* @remarks
* Use a unique identifier name for your extension, for example the name of
* your library or project. Do not use a shortened identifier as this increases
* the risk of conflicts. We recommend you add at most one extension field,
* an object which can contain all the values you need.
*/
export interface GraphQLInputFieldExtensions {
[attributeName: string]: unknown;
}
export interface GraphQLInputFieldConfig {
description?: Maybe<string>;
type: GraphQLInputType;
defaultValue?: unknown;
deprecationReason?: Maybe<string>;
extensions?: Maybe<Readonly<GraphQLInputFieldExtensions>>;
astNode?: Maybe<InputValueDefinitionNode>;
}
export declare type GraphQLInputFieldConfigMap =
ObjMap<GraphQLInputFieldConfig>;
export interface GraphQLInputField {
name: string;
description: Maybe<string>;
type: GraphQLInputType;
defaultValue: unknown;
deprecationReason: Maybe<string>;
extensions: Readonly<GraphQLInputFieldExtensions>;
astNode: Maybe<InputValueDefinitionNode>;
}
export declare function isRequiredInputField(field: GraphQLInputField): boolean;
export declare type GraphQLInputFieldMap = ObjMap<GraphQLInputField>;
export {};

View File

@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_static_private_field_spec_get.js";

View File

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

View File

@@ -0,0 +1,35 @@
// Same as fr
import { formatDistance } from "./fr/_lib/formatDistance.mjs";
import { formatRelative } from "./fr/_lib/formatRelative.mjs";
import { localize } from "./fr/_lib/localize.mjs";
import { match } from "./fr/_lib/match.mjs";
// Unique for fr-CA
import { formatLong } from "./fr-CA/_lib/formatLong.mjs";
/**
* @category Locales
* @summary French locale (Canada).
* @language French
* @iso-639-2 fra
* @author Jean Dupouy [@izeau](https://github.com/izeau)
* @author François B [@fbonzon](https://github.com/fbonzon)
* @author Gabriele Petrioli [@gpetrioli](https://github.com/gpetrioli)
*/
export const frCA = {
code: "fr-CA",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
// Unique for fr-CA
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default frCA;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/singlestore-core/columns/enum.ts"],"sourcesContent":["import type {\n\tColumnBuilderBaseConfig,\n\tColumnBuilderRuntimeConfig,\n\tGeneratedColumnConfig,\n\tHasGenerated,\n\tMakeColumnConfig,\n} from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnySingleStoreTable } from '~/singlestore-core/table.ts';\nimport type { SQL } from '~/sql/index.ts';\nimport { getColumnNameAndConfig, type Writable } from '~/utils.ts';\nimport { SingleStoreColumn, SingleStoreColumnBuilder } from './common.ts';\n\nexport type SingleStoreEnumColumnBuilderInitial<TName extends string, TEnum extends [string, ...string[]]> =\n\tSingleStoreEnumColumnBuilder<{\n\t\tname: TName;\n\t\tdataType: 'string';\n\t\tcolumnType: 'SingleStoreEnumColumn';\n\t\tdata: TEnum[number];\n\t\tdriverParam: string;\n\t\tenumValues: TEnum;\n\t\tgenerated: undefined;\n\t}>;\n\nexport class SingleStoreEnumColumnBuilder<T extends ColumnBuilderBaseConfig<'string', 'SingleStoreEnumColumn'>>\n\textends SingleStoreColumnBuilder<T, { enumValues: T['enumValues'] }>\n{\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\toverride generatedAlwaysAs(\n\t\tas: SQL<unknown> | (() => SQL) | T['data'],\n\t\tconfig?: Partial<GeneratedColumnConfig<unknown>>,\n\t): HasGenerated<this, {}> {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tstatic override readonly [entityKind]: string = 'SingleStoreEnumColumnBuilder';\n\n\tconstructor(name: T['name'], values: T['enumValues']) {\n\t\tsuper(name, 'string', 'SingleStoreEnumColumn');\n\t\tthis.config.enumValues = values;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySingleStoreTable<{ name: TTableName }>,\n\t): SingleStoreEnumColumn<MakeColumnConfig<T, TTableName> & { enumValues: T['enumValues'] }> {\n\t\treturn new SingleStoreEnumColumn<MakeColumnConfig<T, TTableName> & { enumValues: T['enumValues'] }>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class SingleStoreEnumColumn<T extends ColumnBaseConfig<'string', 'SingleStoreEnumColumn'>>\n\textends SingleStoreColumn<T, { enumValues: T['enumValues'] }>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreEnumColumn';\n\n\toverride readonly enumValues = this.config.enumValues;\n\n\tgetSQLType(): string {\n\t\treturn `enum(${this.enumValues!.map((value) => `'${value}'`).join(',')})`;\n\t}\n}\n\nexport function singlestoreEnum<U extends string, T extends Readonly<[U, ...U[]]>>(\n\tvalues: T | Writable<T>,\n): SingleStoreEnumColumnBuilderInitial<'', Writable<T>>;\nexport function singlestoreEnum<TName extends string, U extends string, T extends Readonly<[U, ...U[]]>>(\n\tname: TName,\n\tvalues: T | Writable<T>,\n): SingleStoreEnumColumnBuilderInitial<TName, Writable<T>>;\nexport function singlestoreEnum(\n\ta?: string | readonly [string, ...string[]] | [string, ...string[]],\n\tb?: readonly [string, ...string[]] | [string, ...string[]],\n): any {\n\tconst { name, config: values } = getColumnNameAndConfig<readonly [string, ...string[]] | [string, ...string[]]>(a, b);\n\n\tif (values.length === 0) {\n\t\tthrow new Error(`You have an empty array for \"${name}\" enum values`);\n\t}\n\n\treturn new SingleStoreEnumColumnBuilder(name, values as any);\n}\n"],"mappings":"AAQA,SAAS,kBAAkB;AAG3B,SAAS,8BAA6C;AACtD,SAAS,mBAAmB,gCAAgC;AAarD,MAAM,qCACJ,yBACT;AAAA;AAAA,EAEU,kBACR,IACA,QACyB;AACzB,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC1C;AAAA,EACA,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAAyB;AACrD,UAAM,MAAM,UAAU,uBAAuB;AAC7C,SAAK,OAAO,aAAa;AAAA,EAC1B;AAAA;AAAA,EAGS,MACR,OAC2F;AAC3F,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,8BACJ,kBACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAE9B,aAAa,KAAK,OAAO;AAAA,EAE3C,aAAqB;AACpB,WAAO,QAAQ,KAAK,WAAY,IAAI,CAAC,UAAU,IAAI,KAAK,GAAG,EAAE,KAAK,GAAG,CAAC;AAAA,EACvE;AACD;AASO,SAAS,gBACf,GACA,GACM;AACN,QAAM,EAAE,MAAM,QAAQ,OAAO,IAAI,uBAA+E,GAAG,CAAC;AAEpH,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,IAAI,MAAM,gCAAgC,IAAI,eAAe;AAAA,EACpE;AAEA,SAAO,IAAI,6BAA6B,MAAM,MAAa;AAC5D;","names":[]}

View File

@@ -0,0 +1,32 @@
import { formatDistance } from "./es/_lib/formatDistance.js";
import { formatLong } from "./es/_lib/formatLong.js";
import { formatRelative } from "./es/_lib/formatRelative.js";
import { localize } from "./es/_lib/localize.js";
import { match } from "./es/_lib/match.js";
/**
* @category Locales
* @summary Spanish locale.
* @language Spanish
* @iso-639-2 spa
* @author Juan Angosto [@juanangosto](https://github.com/juanangosto)
* @author Guillermo Grau [@guigrpa](https://github.com/guigrpa)
* @author Fernando Agüero [@fjaguero](https://github.com/fjaguero)
* @author Gastón Haro [@harogaston](https://github.com/harogaston)
* @author Yago Carballo [@YagoCarballo](https://github.com/YagoCarballo)
*/
export const es = {
code: "es",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default es;

View File

@@ -0,0 +1,177 @@
/**
* 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';
var LexicalCollaborationContext = require('@lexical/react/LexicalCollaborationContext');
var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
var lexical = require('lexical');
var react = require('react');
var jsxRuntime = require('react/jsx-runtime');
/**
* 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.
*
*/
// Do not require this module directly! Use normal `invariant` calls.
function formatDevErrorMessage(message) {
throw new Error(message);
}
/**
* 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.
*
*/
/*@__INLINE__*/
function warnOnlyOnce(message) {
{
let run = false;
return () => {
if (!run) {
console.warn(message);
}
run = true;
};
}
}
function getTransformSetFromKlass(klass) {
const transforms = new Set();
const {
ownNodeConfig
} = lexical.getStaticNodeConfig(klass);
const transform = klass.transform();
if (ownNodeConfig) {
const $transform = ownNodeConfig.$transform;
if ($transform) {
transforms.add($transform);
}
}
if (transform) {
transforms.add(transform);
}
return transforms;
}
const initialNodesWarning = warnOnlyOnce(`LexicalNestedComposer initialNodes is deprecated and will be removed in v0.32.0, it has never worked correctly.\nYou can configure your editor's nodes with createEditor({nodes: [], parentEditor: $getEditor()})`);
const explicitNamespaceWarning = warnOnlyOnce(`LexicalNestedComposer initialEditor should explicitly initialize its namespace when the node configuration differs from the parentEditor. For backwards compatibility, the namespace will be initialized from parentEditor until v0.32.0, but this has always had incorrect copy/paste behavior when the configuration differed.\nYou can configure your editor's namespace with createEditor({namespace: 'nested-editor-namespace', nodes: [], parentEditor: $getEditor()}).`);
function LexicalNestedComposer({
initialEditor,
children,
initialNodes,
initialTheme,
skipCollabChecks,
skipEditableListener
}) {
const wasCollabPreviouslyReadyRef = react.useRef(false);
const parentContext = react.useContext(LexicalComposerContext.LexicalComposerContext);
if (parentContext == null) {
{
formatDevErrorMessage(`Unexpected parent context null on a nested composer`);
}
}
const [parentEditor, {
getTheme: getParentTheme
}] = parentContext;
const composerContext = react.useMemo(() => {
const composerTheme = initialTheme || getParentTheme() || undefined;
const context = LexicalComposerContext.createLexicalComposerContext(parentContext, composerTheme);
if (composerTheme !== undefined) {
initialEditor._config.theme = composerTheme;
}
initialEditor._parentEditor = initialEditor._parentEditor || parentEditor;
const createEditorArgs = initialEditor._createEditorArgs;
const explicitNamespace = createEditorArgs && createEditorArgs.namespace;
if (!initialNodes) {
if (!(createEditorArgs && createEditorArgs.nodes)) {
const parentNodes = initialEditor._nodes = new Map(parentEditor._nodes);
if (!explicitNamespace) {
// This is the only safe situation to inherit the parent's namespace
initialEditor._config.namespace = parentEditor._config.namespace;
}
for (const [type, entry] of parentNodes) {
initialEditor._nodes.set(type, {
exportDOM: entry.exportDOM,
klass: entry.klass,
replace: entry.replace,
replaceWithKlass: entry.replaceWithKlass,
sharedNodeState: lexical.createSharedNodeState(entry.klass),
transforms: getTransformSetFromKlass(entry.klass)
});
}
} else if (!explicitNamespace) {
explicitNamespaceWarning();
initialEditor._config.namespace = parentEditor._config.namespace;
}
} else {
initialNodesWarning();
if (!explicitNamespace) {
explicitNamespaceWarning();
initialEditor._config.namespace = parentEditor._config.namespace;
}
for (let klass of initialNodes) {
let replace = null;
let replaceWithKlass = null;
if (typeof klass !== 'function') {
const options = klass;
klass = options.replace;
replace = options.with;
replaceWithKlass = options.withKlass || null;
}
const registeredKlass = lexical.getRegisteredNode(initialEditor, klass.getType());
initialEditor._nodes.set(klass.getType(), {
exportDOM: registeredKlass ? registeredKlass.exportDOM : undefined,
klass,
replace,
replaceWithKlass,
sharedNodeState: lexical.createSharedNodeState(klass),
transforms: getTransformSetFromKlass(klass)
});
}
}
return [initialEditor, context];
},
// We only do this for init
// eslint-disable-next-line react-hooks/exhaustive-deps
[]);
// If collaboration is enabled, make sure we don't render the children until the collaboration subdocument is ready.
const {
isCollabActive,
yjsDocMap
} = LexicalCollaborationContext.useCollaborationContext();
const isCollabReady = skipCollabChecks || wasCollabPreviouslyReadyRef.current || yjsDocMap.has(initialEditor.getKey());
react.useEffect(() => {
if (isCollabReady) {
wasCollabPreviouslyReadyRef.current = true;
}
}, [isCollabReady]);
// Update `isEditable` state of nested editor in response to the same change on parent editor.
react.useEffect(() => {
if (!skipEditableListener) {
const editableListener = editable => initialEditor.setEditable(editable);
editableListener(parentEditor.isEditable());
return parentEditor.registerEditableListener(editableListener);
}
}, [initialEditor, parentEditor, skipEditableListener]);
return /*#__PURE__*/jsxRuntime.jsx(LexicalComposerContext.LexicalComposerContext.Provider, {
value: composerContext,
children: !isCollabActive || isCollabReady ? children : null
});
}
exports.LexicalNestedComposer = LexicalNestedComposer;

View File

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

View File

@@ -0,0 +1,22 @@
Prism.languages.solidity = Prism.languages.extend('clike', {
'class-name': {
pattern: /(\b(?:contract|enum|interface|library|new|struct|using)\s+)(?!\d)[\w$]+/,
lookbehind: true
},
'keyword': /\b(?:_|anonymous|as|assembly|assert|break|calldata|case|constant|constructor|continue|contract|default|delete|do|else|emit|enum|event|external|for|from|function|if|import|indexed|inherited|interface|internal|is|let|library|mapping|memory|modifier|new|payable|pragma|private|public|pure|require|returns?|revert|selfdestruct|solidity|storage|struct|suicide|switch|this|throw|using|var|view|while)\b/,
'operator': /=>|->|:=|=:|\*\*|\+\+|--|\|\||&&|<<=?|>>=?|[-+*/%^&|<>!=]=?|[~?]/
});
Prism.languages.insertBefore('solidity', 'keyword', {
'builtin': /\b(?:address|bool|byte|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?|string|bytes(?:[1-9]|[12]\d|3[0-2])?)\b/
});
Prism.languages.insertBefore('solidity', 'number', {
'version': {
pattern: /([<>]=?|\^)\d+\.\d+\.\d+\b/,
lookbehind: true,
alias: 'number',
}
});
Prism.languages.sol = Prism.languages.solidity;

View File

@@ -0,0 +1,9 @@
import { ISizeCalculationResult } from './types/interface.mjs';
declare const setConcurrency: (c: number) => void;
/**
* @param {string} filePath - relative/absolute path of the image file
*/
declare const imageSizeFromFile: (filePath: string) => Promise<ISizeCalculationResult>;
export { imageSizeFromFile, setConcurrency };

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2020-12/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,uDAAsD;AACtD,+CAA8C;AAC9C,yCAAwC;AACxC,wDAAuD;AACvD,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,WAAW;QACX,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAhBD,oCAgBC"}

View File

@@ -0,0 +1,67 @@
/*
* 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.
*/
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
import { ROOT_CONTEXT } from './context';
var NoopContextManager = /** @class */ (function () {
function NoopContextManager() {
}
NoopContextManager.prototype.active = function () {
return ROOT_CONTEXT;
};
NoopContextManager.prototype.with = function (_context, fn, thisArg) {
var args = [];
for (var _i = 3; _i < arguments.length; _i++) {
args[_i - 3] = arguments[_i];
}
return fn.call.apply(fn, __spreadArray([thisArg], __read(args), false));
};
NoopContextManager.prototype.bind = function (_context, target) {
return target;
};
NoopContextManager.prototype.enable = function () {
return this;
};
NoopContextManager.prototype.disable = function () {
return this;
};
return NoopContextManager;
}());
export { NoopContextManager };
//# sourceMappingURL=NoopContextManager.js.map

View File

@@ -0,0 +1,429 @@
export = Long;
export as namespace Long;
declare namespace Long { }
declare class Long {
/**
* Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs.
*/
constructor(low: number, high?: number, unsigned?: boolean);
/**
* Maximum unsigned value.
*/
static MAX_UNSIGNED_VALUE: Long;
/**
* Maximum signed value.
*/
static MAX_VALUE: Long;
/**
* Minimum signed value.
*/
static MIN_VALUE: Long;
/**
* Signed negative one.
*/
static NEG_ONE: Long;
/**
* Signed one.
*/
static ONE: Long;
/**
* Unsigned one.
*/
static UONE: Long;
/**
* Unsigned zero.
*/
static UZERO: Long;
/**
* Signed zero
*/
static ZERO: Long;
/**
* The high 32 bits as a signed value.
*/
high: number;
/**
* The low 32 bits as a signed value.
*/
low: number;
/**
* Whether unsigned or not.
*/
unsigned: boolean;
/**
* Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits.
*/
static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long;
/**
* Returns a Long representing the given 32 bit integer value.
*/
static fromInt(value: number, unsigned?: boolean): Long;
/**
* Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
*/
static fromNumber(value: number, unsigned?: boolean): Long;
/**
* Returns a Long representation of the given string, written using the specified radix.
*/
static fromString(str: string, unsigned?: boolean | number, radix?: number): Long;
/**
* Creates a Long from its byte representation.
*/
static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long;
/**
* Creates a Long from its little endian byte representation.
*/
static fromBytesLE(bytes: number[], unsigned?: boolean): Long;
/**
* Creates a Long from its big endian byte representation.
*/
static fromBytesBE(bytes: number[], unsigned?: boolean): Long;
/**
* Tests if the specified object is a Long.
*/
static isLong(obj: any): obj is Long;
/**
* Converts the specified value to a Long.
*/
static fromValue(val: Long | number | string | {low: number, high: number, unsigned: boolean}, unsigned?: boolean): Long;
/**
* Returns the sum of this and the specified Long.
*/
add(addend: number | Long | string): Long;
/**
* Returns the bitwise AND of this Long and the specified.
*/
and(other: Long | number | string): Long;
/**
* Compares this Long's value with the specified's.
*/
compare(other: Long | number | string): number;
/**
* Compares this Long's value with the specified's.
*/
comp(other: Long | number | string): number;
/**
* Returns this Long divided by the specified.
*/
divide(divisor: Long | number | string): Long;
/**
* Returns this Long divided by the specified.
*/
div(divisor: Long | number | string): Long;
/**
* Tests if this Long's value equals the specified's.
*/
equals(other: Long | number | string): boolean;
/**
* Tests if this Long's value equals the specified's.
*/
eq(other: Long | number | string): boolean;
/**
* Gets the high 32 bits as a signed integer.
*/
getHighBits(): number;
/**
* Gets the high 32 bits as an unsigned integer.
*/
getHighBitsUnsigned(): number;
/**
* Gets the low 32 bits as a signed integer.
*/
getLowBits(): number;
/**
* Gets the low 32 bits as an unsigned integer.
*/
getLowBitsUnsigned(): number;
/**
* Gets the number of bits needed to represent the absolute value of this Long.
*/
getNumBitsAbs(): number;
/**
* Tests if this Long's value is greater than the specified's.
*/
greaterThan(other: Long | number | string): boolean;
/**
* Tests if this Long's value is greater than the specified's.
*/
gt(other: Long | number | string): boolean;
/**
* Tests if this Long's value is greater than or equal the specified's.
*/
greaterThanOrEqual(other: Long | number | string): boolean;
/**
* Tests if this Long's value is greater than or equal the specified's.
*/
gte(other: Long | number | string): boolean;
/**
* Tests if this Long's value is greater than or equal the specified's.
*/
ge(other: Long | number | string): boolean;
/**
* Tests if this Long's value is even.
*/
isEven(): boolean;
/**
* Tests if this Long's value is negative.
*/
isNegative(): boolean;
/**
* Tests if this Long's value is odd.
*/
isOdd(): boolean;
/**
* Tests if this Long's value is positive.
*/
isPositive(): boolean;
/**
* Tests if this Long's value equals zero.
*/
isZero(): boolean;
/**
* Tests if this Long's value equals zero.
*/
eqz(): boolean;
/**
* Tests if this Long's value is less than the specified's.
*/
lessThan(other: Long | number | string): boolean;
/**
* Tests if this Long's value is less than the specified's.
*/
lt(other: Long | number | string): boolean;
/**
* Tests if this Long's value is less than or equal the specified's.
*/
lessThanOrEqual(other: Long | number | string): boolean;
/**
* Tests if this Long's value is less than or equal the specified's.
*/
lte(other: Long | number | string): boolean;
/**
* Tests if this Long's value is less than or equal the specified's.
*/
le(other: Long | number | string): boolean;
/**
* Returns this Long modulo the specified.
*/
modulo(other: Long | number | string): Long;
/**
* Returns this Long modulo the specified.
*/
mod(other: Long | number | string): Long;
/**
* Returns this Long modulo the specified.
*/
rem(other: Long | number | string): Long;
/**
* Returns the product of this and the specified Long.
*/
multiply(multiplier: Long | number | string): Long;
/**
* Returns the product of this and the specified Long.
*/
mul(multiplier: Long | number | string): Long;
/**
* Negates this Long's value.
*/
negate(): Long;
/**
* Negates this Long's value.
*/
neg(): Long;
/**
* Returns the bitwise NOT of this Long.
*/
not(): Long;
/**
* Tests if this Long's value differs from the specified's.
*/
notEquals(other: Long | number | string): boolean;
/**
* Tests if this Long's value differs from the specified's.
*/
neq(other: Long | number | string): boolean;
/**
* Tests if this Long's value differs from the specified's.
*/
ne(other: Long | number | string): boolean;
/**
* Returns the bitwise OR of this Long and the specified.
*/
or(other: Long | number | string): Long;
/**
* Returns this Long with bits shifted to the left by the given amount.
*/
shiftLeft(numBits: number | Long): Long;
/**
* Returns this Long with bits shifted to the left by the given amount.
*/
shl(numBits: number | Long): Long;
/**
* Returns this Long with bits arithmetically shifted to the right by the given amount.
*/
shiftRight(numBits: number | Long): Long;
/**
* Returns this Long with bits arithmetically shifted to the right by the given amount.
*/
shr(numBits: number | Long): Long;
/**
* Returns this Long with bits logically shifted to the right by the given amount.
*/
shiftRightUnsigned(numBits: number | Long): Long;
/**
* Returns this Long with bits logically shifted to the right by the given amount.
*/
shru(numBits: number | Long): Long;
/**
* Returns this Long with bits logically shifted to the right by the given amount.
*/
shr_u(numBits: number | Long): Long;
/**
* Returns this Long with bits rotated to the left by the given amount.
*/
rotateLeft(numBits: number | Long): Long;
/**
* Returns this Long with bits rotated to the left by the given amount.
*/
rotl(numBits: number | Long): Long;
/**
* Returns this Long with bits rotated to the right by the given amount.
*/
rotateRight(numBits: number | Long): Long;
/**
* Returns this Long with bits rotated to the right by the given amount.
*/
rotr(numBits: number | Long): Long;
/**
* Returns the difference of this and the specified Long.
*/
subtract(subtrahend: number | Long | string): Long;
/**
* Returns the difference of this and the specified Long.
*/
sub(subtrahend: number | Long |string): Long;
/**
* Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.
*/
toInt(): number;
/**
* Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).
*/
toNumber(): number;
/**
* Converts this Long to its byte representation.
*/
toBytes(le?: boolean): number[];
/**
* Converts this Long to its little endian byte representation.
*/
toBytesLE(): number[];
/**
* Converts this Long to its big endian byte representation.
*/
toBytesBE(): number[];
/**
* Converts this Long to signed.
*/
toSigned(): Long;
/**
* Converts the Long to a string written in the specified radix.
*/
toString(radix?: number): string;
/**
* Converts this Long to unsigned.
*/
toUnsigned(): Long;
/**
* Returns the bitwise XOR of this Long and the given one.
*/
xor(other: Long | number | string): Long;
}

View File

@@ -0,0 +1,13 @@
import { DirectusExtension } from "../../../schema/extension.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/read/extensions.d.ts
/**
* List the available extensions in the project.
* @returns An array of extensions.
*/
declare const readExtensions: <Schema>() => RestCommand<DirectusExtension<Schema>[], Schema>;
//#endregion
export { readExtensions };
//# sourceMappingURL=extensions.d.ts.map

View File

@@ -0,0 +1,2 @@
const e=(e,t)=>()=>({path:`/permissions`,params:t??{},body:JSON.stringify(e),method:`POST`}),t=(e,t)=>()=>({path:`/permissions`,params:t??{},body:JSON.stringify(e),method:`POST`});export{t as createPermission,e as createPermissions};
//# sourceMappingURL=permissions.js.map

View File

@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Luggage = createLucideIcon("Luggage", [
[
"path",
{ d: "M6 20a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2", key: "1m57jg" }
],
["path", { d: "M8 18V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v14", key: "1l99gc" }],
["path", { d: "M10 20h4", key: "ni2waw" }],
["circle", { cx: "16", cy: "20", r: "2", key: "1vifvg" }],
["circle", { cx: "8", cy: "20", r: "2", key: "ckkr5m" }]
]);
export { Luggage as default };
//# sourceMappingURL=luggage.js.map

View File

@@ -0,0 +1,82 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLByte = exports.GraphQLByteConfig = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const base64Validator = /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/;
function hexValidator(value) {
// Ensure that any leading 0 is removed from the hex string to avoid false negatives.
const sanitizedValue = value.charAt(0) === '0' ? value.slice(1) : value;
// For larger strings, we run into issues with MAX_SAFE_INTEGER, so split the string
// into smaller pieces to avoid this issue.
if (value.length > 8) {
let parsedString = '';
for (let startIndex = 0, endIndex = 8; startIndex < value.length; startIndex += 8, endIndex += 8) {
parsedString += parseInt(value.slice(startIndex, endIndex), 16).toString(16);
}
return parsedString === sanitizedValue;
}
return parseInt(value, 16).toString(16) === sanitizedValue;
}
function validate(value, ast) {
if (typeof value !== 'string' && !(value instanceof global.Buffer)) {
throw (0, error_js_1.createGraphQLError)(`Value is not an instance of Buffer: ${JSON.stringify(value)}`, ast
? {
nodes: ast,
}
: undefined);
}
if (typeof value === 'string') {
const isBase64 = base64Validator.test(value);
const isHex = hexValidator(value);
if (!isBase64 && !isHex) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid base64 or hex encoded string: ${JSON.stringify(value)}`, ast
? {
nodes: ast,
}
: undefined);
}
return global.Buffer.from(value, isHex ? 'hex' : 'base64');
}
return value;
}
function parseObject(ast) {
const key = ast.fields[0].value;
const value = ast.fields[1].value;
if (ast.fields.length === 2 &&
key.kind === graphql_1.Kind.STRING &&
key.value === 'Buffer' &&
value.kind === graphql_1.Kind.LIST) {
return global.Buffer.from(value.values.map((astValue) => parseInt(astValue.value)));
}
throw (0, error_js_1.createGraphQLError)(`Value is not a JSON representation of Buffer: ${(0, graphql_1.print)(ast)}`, {
nodes: [ast],
});
}
exports.GraphQLByteConfig =
/*#__PURE__*/ {
name: 'Byte',
description: 'The `Byte` scalar type represents byte value as a Buffer',
serialize: validate,
parseValue: validate,
parseLiteral(ast) {
switch (ast.kind) {
case graphql_1.Kind.STRING:
return validate(ast.value, ast);
case graphql_1.Kind.OBJECT:
return parseObject(ast);
default:
throw (0, error_js_1.createGraphQLError)(`Can only parse base64 or hex encoded strings as Byte, but got a: ${ast.kind}`, {
nodes: [ast],
});
}
},
extensions: {
codegenScalarType: 'Buffer | string',
jsonSchema: {
type: 'string',
format: 'byte',
},
},
};
exports.GraphQLByte = new graphql_1.GraphQLScalarType(exports.GraphQLByteConfig);

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/columns/json.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyPgTable } from '~/pg-core/table.ts';\nimport { PgColumn, PgColumnBuilder } from './common.ts';\n\nexport type PgJsonBuilderInitial<TName extends string> = PgJsonBuilder<{\n\tname: TName;\n\tdataType: 'json';\n\tcolumnType: 'PgJson';\n\tdata: unknown;\n\tdriverParam: unknown;\n\tenumValues: undefined;\n}>;\n\nexport class PgJsonBuilder<T extends ColumnBuilderBaseConfig<'json', 'PgJson'>> extends PgColumnBuilder<\n\tT\n> {\n\tstatic override readonly [entityKind]: string = 'PgJsonBuilder';\n\n\tconstructor(name: T['name']) {\n\t\tsuper(name, 'json', 'PgJson');\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyPgTable<{ name: TTableName }>,\n\t): PgJson<MakeColumnConfig<T, TTableName>> {\n\t\treturn new PgJson<MakeColumnConfig<T, TTableName>>(table, this.config as ColumnBuilderRuntimeConfig<any, any>);\n\t}\n}\n\nexport class PgJson<T extends ColumnBaseConfig<'json', 'PgJson'>> extends PgColumn<T> {\n\tstatic override readonly [entityKind]: string = 'PgJson';\n\n\tconstructor(table: AnyPgTable<{ name: T['tableName'] }>, config: PgJsonBuilder<T>['config']) {\n\t\tsuper(table, config);\n\t}\n\n\tgetSQLType(): string {\n\t\treturn 'json';\n\t}\n\n\toverride mapToDriverValue(value: T['data']): string {\n\t\treturn JSON.stringify(value);\n\t}\n\n\toverride mapFromDriverValue(value: T['data'] | string): T['data'] {\n\t\tif (typeof value === 'string') {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(value);\n\t\t\t} catch {\n\t\t\t\treturn value as T['data'];\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}\n}\n\nexport function json(): PgJsonBuilderInitial<''>;\nexport function json<TName extends string>(name: TName): PgJsonBuilderInitial<TName>;\nexport function json(name?: string) {\n\treturn new PgJsonBuilder(name ?? '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAE3B,oBAA0C;AAWnC,MAAM,sBAA2E,8BAEtF;AAAA,EACD,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB;AAC5B,UAAM,MAAM,QAAQ,QAAQ;AAAA,EAC7B;AAAA;AAAA,EAGS,MACR,OAC0C;AAC1C,WAAO,IAAI,OAAwC,OAAO,KAAK,MAA8C;AAAA,EAC9G;AACD;AAEO,MAAM,eAA6D,uBAAY;AAAA,EACrF,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,OAA6C,QAAoC;AAC5F,UAAM,OAAO,MAAM;AAAA,EACpB;AAAA,EAEA,aAAqB;AACpB,WAAO;AAAA,EACR;AAAA,EAES,iBAAiB,OAA0B;AACnD,WAAO,KAAK,UAAU,KAAK;AAAA,EAC5B;AAAA,EAES,mBAAmB,OAAsC;AACjE,QAAI,OAAO,UAAU,UAAU;AAC9B,UAAI;AACH,eAAO,KAAK,MAAM,KAAK;AAAA,MACxB,QAAQ;AACP,eAAO;AAAA,MACR;AAAA,IACD;AACA,WAAO;AAAA,EACR;AACD;AAIO,SAAS,KAAK,MAAe;AACnC,SAAO,IAAI,cAAc,QAAQ,EAAE;AACpC;","names":[]}

View File

@@ -0,0 +1,64 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var driver_exports = {};
__export(driver_exports, {
DrizzleSqliteDODatabase: () => DrizzleSqliteDODatabase,
drizzle: () => drizzle
});
module.exports = __toCommonJS(driver_exports);
var import_entity = require("../entity.cjs");
var import_logger = require("../logger.cjs");
var import_relations = require("../relations.cjs");
var import_db = require("../sqlite-core/db.cjs");
var import_dialect = require("../sqlite-core/dialect.cjs");
var import_session = require("./session.cjs");
class DrizzleSqliteDODatabase extends import_db.BaseSQLiteDatabase {
static [import_entity.entityKind] = "DrizzleSqliteDODatabase";
}
function drizzle(client, config = {}) {
const dialect = new import_dialect.SQLiteSyncDialect({ casing: config.casing });
let logger;
if (config.logger === true) {
logger = new import_logger.DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
let schema;
if (config.schema) {
const tablesConfig = (0, import_relations.extractTablesRelationalConfig)(
config.schema,
import_relations.createTableRelationsHelpers
);
schema = {
fullSchema: config.schema,
schema: tablesConfig.tables,
tableNamesMap: tablesConfig.tableNamesMap
};
}
const session = new import_session.SQLiteDOSession(client, dialect, schema, { logger });
const db = new DrizzleSqliteDODatabase("sync", dialect, session, schema);
db.$client = client;
return db;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
DrizzleSqliteDODatabase,
drizzle
});
//# sourceMappingURL=driver.cjs.map

View File

@@ -0,0 +1,19 @@
# @babel/types
> Babel Types is a Lodash-esque utility library for AST nodes
See our website [@babel/types](https://babeljs.io/docs/babel-types) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/types
```
or using yarn:
```sh
yarn add @babel/types --dev
```

View File

@@ -0,0 +1,22 @@
import {Except} from './except';
/**
Merge two types into a new type. Keys of the second type overrides keys of the first type.
@example
```
import {Merge} from 'type-fest';
type Foo = {
a: number;
b: string;
};
type Bar = {
b: number;
};
const ab: Merge<Foo, Bar> = {a: 1, b: 2};
```
*/
export type Merge<FirstType, SecondType> = Except<FirstType, Extract<keyof FirstType, keyof SecondType>> & SecondType;

View File

@@ -0,0 +1,22 @@
import { DirectusPreset } from "../../../schema/preset.cjs";
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/delete/presets.d.ts
/**
* Delete multiple existing presets.
* @param keys
* @returns
* @throws Will throw if keys is empty
*/
declare const deletePresets: <Schema>(keys: DirectusPreset<Schema>["id"][]) => RestCommand<void, Schema>;
/**
* Delete an existing preset.
* @param key
* @returns
* @throws Will throw if key is empty
*/
declare const deletePreset: <Schema>(key: DirectusPreset<Schema>["id"]) => RestCommand<void, Schema>;
//#endregion
export { deletePreset, deletePresets };
//# sourceMappingURL=presets.d.cts.map

View File

@@ -0,0 +1,60 @@
{
"name": "mime-db",
"description": "Media Type Database",
"version": "1.52.0",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
"Robert Kieffer <robert@broofa.com> (http://github.com/broofa)"
],
"license": "MIT",
"keywords": [
"mime",
"db",
"type",
"types",
"database",
"charset",
"charsets"
],
"repository": "jshttp/mime-db",
"devDependencies": {
"bluebird": "3.7.2",
"co": "4.6.0",
"cogent": "1.0.1",
"csv-parse": "4.16.3",
"eslint": "7.32.0",
"eslint-config-standard": "15.0.1",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-markdown": "2.2.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.1.1",
"eslint-plugin-standard": "4.1.0",
"gnode": "0.1.2",
"media-typer": "1.1.0",
"mocha": "9.2.1",
"nyc": "15.1.0",
"raw-body": "2.5.0",
"stream-to-array": "2.3.0"
},
"files": [
"HISTORY.md",
"LICENSE",
"README.md",
"db.json",
"index.js"
],
"engines": {
"node": ">= 0.6"
},
"scripts": {
"build": "node scripts/build",
"fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx",
"lint": "eslint .",
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"update": "npm run fetch && npm run build",
"version": "node scripts/version-history.js && git add HISTORY.md"
}
}

View File

@@ -0,0 +1,11 @@
"use strict";
exports.buildFormatLongFn = buildFormatLongFn;
function buildFormatLongFn(args) {
return (options = {}) => {
// TODO: Remove String()
const width = options.width ? String(options.width) : args.defaultWidth;
const format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}

View File

@@ -0,0 +1,176 @@
var path = require('path');
var fs = require('fs');
var test = require('tape');
var map = require('array.prototype.map');
var resolve = require('../');
var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink');
var packageDir = path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'package');
var modADir = path.join(__dirname, 'symlinks', 'source', 'node_modules', 'mod-a');
var symlinkModADir = path.join(__dirname, 'symlinks', 'dest', 'node_modules', 'mod-a');
try {
fs.unlinkSync(symlinkDir);
} catch (err) {}
try {
fs.unlinkSync(packageDir);
} catch (err) {}
try {
fs.unlinkSync(modADir);
} catch (err) {}
try {
fs.unlinkSync(symlinkModADir);
} catch (err) {}
try {
fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir');
} catch (err) {
// if fails then it is probably on Windows and lets try to create a junction
fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction');
}
try {
fs.symlinkSync('../../package', packageDir, 'dir');
} catch (err) {
// if fails then it is probably on Windows and lets try to create a junction
fs.symlinkSync(path.join(__dirname, '..', '..', 'package') + '\\', packageDir, 'junction');
}
try {
fs.symlinkSync('../../source/node_modules/mod-a', symlinkModADir, 'dir');
} catch (err) {
// if fails then it is probably on Windows and lets try to create a junction
fs.symlinkSync(path.join(__dirname, '..', '..', 'source', 'node_modules', 'mod-a') + '\\', symlinkModADir, 'junction');
}
test('symlink', function (t) {
t.plan(2);
resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) {
t.error(err);
t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js'));
});
});
test('sync symlink when preserveSymlinks = true', function (t) {
t.plan(4);
resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) {
t.ok(err, 'there is an error');
t.notOk(res, 'no result');
t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve');
t.equal(
err && err.message,
'Cannot find module \'foo\' from \'' + symlinkDir + '\'',
'can not find nonexistent module'
);
});
});
test('sync symlink', function (t) {
var start = new Date();
t.doesNotThrow(function () {
t.equal(
resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }),
path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')
);
});
t.ok(new Date() - start < 50, 'resolve.sync timedout');
t.end();
});
test('sync symlink when preserveSymlinks = true', function (t) {
t.throws(function () {
resolve.sync('foo', { basedir: symlinkDir });
}, /Cannot find module 'foo'/);
t.end();
});
test('sync symlink from node_modules to other dir when preserveSymlinks = false', function (t) {
var basedir = path.join(__dirname, 'resolver', 'symlinked', '_');
var fn = resolve.sync('package', { basedir: basedir, preserveSymlinks: false });
t.equal(fn, path.resolve(__dirname, 'resolver/symlinked/package/bar.js'));
t.end();
});
test('async symlink from node_modules to other dir when preserveSymlinks = false', function (t) {
t.plan(2);
var basedir = path.join(__dirname, 'resolver', 'symlinked', '_');
resolve('package', { basedir: basedir, preserveSymlinks: false }, function (err, result) {
t.notOk(err, 'no error');
t.equal(result, path.resolve(__dirname, 'resolver/symlinked/package/bar.js'));
});
});
test('packageFilter', function (t) {
function relative(x) {
return path.relative(__dirname, x);
}
function testPackageFilter(preserveSymlinks) {
return function (st) {
st.plan('is 1.x' ? 3 : 5); // eslint-disable-line no-constant-condition
var destMain = 'symlinks/dest/node_modules/mod-a/index.js';
var destPkg = 'symlinks/dest/node_modules/mod-a/package.json';
var sourceMain = 'symlinks/source/node_modules/mod-a/index.js';
var sourcePkg = 'symlinks/source/node_modules/mod-a/package.json';
var destDir = path.join(__dirname, 'symlinks', 'dest');
/* eslint multiline-comment-style: 0 */
/* v2.x will restore these tests
var packageFilterPath = [];
var actualPath = resolve.sync('mod-a', {
basedir: destDir,
preserveSymlinks: preserveSymlinks,
packageFilter: function (pkg, pkgfile, dir) {
packageFilterPath.push(pkgfile);
}
});
st.equal(
relative(actualPath),
path.normalize(preserveSymlinks ? destMain : sourceMain),
'sync: actual path is correct'
);
st.deepEqual(
map(packageFilterPath, relative),
map(preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg], path.normalize),
'sync: packageFilter pkgfile arg is correct'
);
*/
var asyncPackageFilterPath = [];
resolve(
'mod-a',
{
basedir: destDir,
preserveSymlinks: preserveSymlinks,
packageFilter: function (pkg, pkgfile) {
asyncPackageFilterPath.push(pkgfile);
}
},
function (err, actualPath) {
st.error(err, 'no error');
st.equal(
relative(actualPath),
path.normalize(preserveSymlinks ? destMain : sourceMain),
'async: actual path is correct'
);
st.deepEqual(
map(asyncPackageFilterPath, relative),
map(
preserveSymlinks ? [destPkg, destPkg, destPkg] : [sourcePkg, sourcePkg, sourcePkg],
path.normalize
),
'async: packageFilter pkgfile arg is correct'
);
}
);
};
}
t.test('preserveSymlinks: false', testPackageFilter(false));
t.test('preserveSymlinks: true', testPackageFilter(true));
t.end();
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"dropMiddlewareTunnelRequests.js","sources":["../../../../src/common/utils/dropMiddlewareTunnelRequests.ts"],"sourcesContent":["import { SEMATTRS_HTTP_TARGET } from '@opentelemetry/semantic-conventions';\nimport { GLOBAL_OBJ, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, type Span, type SpanAttributes } from '@sentry/core';\nimport { isSentryRequestSpan } from '@sentry/opentelemetry';\nimport { ATTR_NEXT_SPAN_TYPE } from '../nextSpanAttributes';\nimport { TRANSACTION_ATTR_SHOULD_DROP_TRANSACTION } from '../span-attributes-with-logic-attached';\n\nconst globalWithInjectedValues = GLOBAL_OBJ as typeof GLOBAL_OBJ & {\n _sentryRewritesTunnelPath?: string;\n};\n\n/**\n * Drops spans for tunnel requests from middleware or fetch instrumentation.\n * This catches both:\n * 1. Requests to the local tunnel route (before rewrite)\n * 2. Requests to Sentry ingest (after rewrite)\n */\nexport function dropMiddlewareTunnelRequests(span: Span, attrs: SpanAttributes | undefined): void {\n // Only filter middleware spans or HTTP fetch spans\n const isMiddleware = attrs?.[ATTR_NEXT_SPAN_TYPE] === 'Middleware.execute';\n // The fetch span could be originating from rewrites re-writing a tunnel request\n // So we want to filter it out\n const isFetchSpan = attrs?.[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] === 'auto.http.otel.node_fetch';\n\n // If the span is not a middleware span or a fetch span, return\n if (!isMiddleware && !isFetchSpan) {\n return;\n }\n\n // Check if this is either a tunnel route request or a Sentry ingest request\n const isTunnel = isTunnelRouteSpan(attrs || {});\n const isSentry = isSentryRequestSpan(span);\n\n if (isTunnel || isSentry) {\n // Mark the span to be dropped\n span.setAttribute(TRANSACTION_ATTR_SHOULD_DROP_TRANSACTION, true);\n }\n}\n\n/**\n * Checks if a span's HTTP target matches the tunnel route.\n */\nfunction isTunnelRouteSpan(spanAttributes: Record<string, unknown>): boolean {\n const tunnelPath = globalWithInjectedValues._sentryRewritesTunnelPath || process.env._sentryRewritesTunnelPath;\n if (!tunnelPath) {\n return false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const httpTarget = spanAttributes[SEMATTRS_HTTP_TARGET];\n\n if (typeof httpTarget === 'string') {\n // Extract pathname from the target (e.g., \"/tunnel?o=123&p=456\" -> \"/tunnel\")\n const pathname = httpTarget.split('?')[0] || '';\n\n return pathname.startsWith(tunnelPath);\n }\n\n return false;\n}\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,wBAAA,GAA2B;;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,4BAA4B,CAAC,IAAI,EAAQ,KAAK,EAAoC;AAClG;AACA,EAAE,MAAM,eAAe,KAAK,GAAG,mBAAmB,CAAA,KAAM,oBAAoB;AAC5E;AACA;AACA,EAAE,MAAM,cAAc,KAAK,GAAG,gCAAgC,CAAA,KAAM,2BAA2B;;AAE/F;AACA,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE;AACrC,IAAI;AACJ,EAAE;;AAEF;AACA,EAAE,MAAM,WAAW,iBAAiB,CAAC,KAAA,IAAS,EAAE,CAAC;AACjD,EAAE,MAAM,QAAA,GAAW,mBAAmB,CAAC,IAAI,CAAC;;AAE5C,EAAE,IAAI,QAAA,IAAY,QAAQ,EAAE;AAC5B;AACA,IAAI,IAAI,CAAC,YAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC;AACrE,EAAE;AACF;;AAEA;AACA;AACA;AACA,SAAS,iBAAiB,CAAC,cAAc,EAAoC;AAC7E,EAAE,MAAM,UAAA,GAAa,wBAAwB,CAAC,yBAAA,IAA6B,OAAO,CAAC,GAAG,CAAC,yBAAyB;AAChH,EAAE,IAAI,CAAC,UAAU,EAAE;AACnB,IAAI,OAAO,KAAK;AAChB,EAAE;;AAEF;AACA,EAAE,MAAM,UAAA,GAAa,cAAc,CAAC,oBAAoB,CAAC;;AAEzD,EAAE,IAAI,OAAO,UAAA,KAAe,QAAQ,EAAE;AACtC;AACA,IAAI,MAAM,QAAA,GAAW,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA,IAAK,EAAE;;AAEnD,IAAI,OAAO,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;AAC1C,EAAE;;AAEF,EAAE,OAAO,KAAK;AACd;;;;"}

View File

@@ -0,0 +1,25 @@
import type { ClientRect } from '../../types';
interface Options {
ignoreTransform?: boolean;
}
/**
* Returns the bounding client rect of an element relative to the viewport.
*/
export declare function getClientRect(element: Element, options?: Options): {
top: number;
left: number;
width: number;
height: number;
bottom: number;
right: number;
};
/**
* Returns the bounding client rect of an element relative to the viewport.
*
* @remarks
* The ClientRect returned by this method does not take into account transforms
* applied to the element it measures.
*
*/
export declare function getTransformAgnosticClientRect(element: Element): ClientRect;
export {};

View File

@@ -0,0 +1,215 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ValidationError", {
enumerable: true,
get: function () {
return _ValidationError.default;
}
});
exports.disableValidation = disableValidation;
exports.enableValidation = enableValidation;
exports.needValidate = needValidate;
exports.validate = validate;
var _ValidationError = _interopRequireDefault(require("./ValidationError"));
var _memorize = _interopRequireDefault(require("./util/memorize"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const getAjv = (0, _memorize.default)(() => {
// Use CommonJS require for ajv libs so TypeScript consumers aren't locked into esModuleInterop (see #110).
const Ajv = require("ajv").default;
const ajvKeywords = require("ajv-keywords").default;
const addFormats = require("ajv-formats").default;
/**
* @type {Ajv}
*/
const ajv = new Ajv({
strict: false,
allErrors: true,
verbose: true,
$data: true
});
ajvKeywords(ajv, ["instanceof", "patternRequired"]);
// TODO set `{ keywords: true }` for the next major release and remove `keywords/limit.js`
addFormats(ajv, {
keywords: false
});
// Custom keywords
const addAbsolutePathKeyword = require("./keywords/absolutePath").default;
addAbsolutePathKeyword(ajv);
const addLimitKeyword = require("./keywords/limit").default;
addLimitKeyword(ajv);
const addUndefinedAsNullKeyword = require("./keywords/undefinedAsNull").default;
addUndefinedAsNullKeyword(ajv);
return ajv;
});
/** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */
/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */
/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */
/** @typedef {import("ajv").ErrorObject} ErrorObject */
/**
* @typedef {object} ExtendedSchema
* @property {(string | number)=} formatMinimum format minimum
* @property {(string | number)=} formatMaximum format maximum
* @property {(string | boolean)=} formatExclusiveMinimum format exclusive minimum
* @property {(string | boolean)=} formatExclusiveMaximum format exclusive maximum
* @property {string=} link link
* @property {boolean=} undefinedAsNull undefined will be resolved as null
*/
// TODO remove me in the next major release
/** @typedef {ExtendedSchema} Extend */
/** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & ExtendedSchema} Schema */
/** @typedef {ErrorObject & { children?: Array<ErrorObject> }} SchemaUtilErrorObject */
/**
* @callback PostFormatter
* @param {string} formattedError
* @param {SchemaUtilErrorObject} error
* @returns {string}
*/
/**
* @typedef {object} ValidationErrorConfiguration
* @property {string=} name name
* @property {string=} baseDataPath base data path
* @property {PostFormatter=} postFormatter post formatter
*/
/**
* @param {SchemaUtilErrorObject} error error
* @param {number} idx idx
* @returns {SchemaUtilErrorObject} error object with idx
*/
function applyPrefix(error, idx) {
error.instancePath = `[${idx}]${error.instancePath}`;
if (error.children) {
for (const err of error.children) applyPrefix(err, idx);
}
return error;
}
let skipValidation = false;
// We use `process.env.SKIP_VALIDATION` because you can have multiple `schema-utils` with different version,
// so we want to disable it globally, `process.env` doesn't supported by browsers, so we have the local `skipValidation` variables
// Enable validation
/**
* @returns {void}
*/
function enableValidation() {
skipValidation = false;
// Disable validation for any versions
if (process && process.env) {
process.env.SKIP_VALIDATION = "n";
}
}
// Disable validation
/**
* @returns {void}
*/
function disableValidation() {
skipValidation = true;
if (process && process.env) {
process.env.SKIP_VALIDATION = "y";
}
}
// Check if we need to confirm
/**
* @returns {boolean} true when need validate, otherwise false
*/
function needValidate() {
if (skipValidation) {
return false;
}
if (process && process.env && process.env.SKIP_VALIDATION) {
const value = process.env.SKIP_VALIDATION.trim();
if (/^(?:y|yes|true|1|on)$/i.test(value)) {
return false;
}
if (/^(?:n|no|false|0|off)$/i.test(value)) {
return true;
}
}
return true;
}
/**
* @param {Array<ErrorObject>} errors array of error objects
* @returns {Array<SchemaUtilErrorObject>} filtered array of objects
*/
function filterErrors(errors) {
/** @type {Array<SchemaUtilErrorObject>} */
let newErrors = [];
for (const error of (/** @type {Array<SchemaUtilErrorObject>} */errors)) {
const {
instancePath
} = error;
/** @type {Array<SchemaUtilErrorObject>} */
let children = [];
newErrors = newErrors.filter(oldError => {
if (oldError.instancePath.includes(instancePath)) {
if (oldError.children) {
children = [...children, ...oldError.children];
}
oldError.children = undefined;
children.push(oldError);
return false;
}
return true;
});
if (children.length) {
error.children = children;
}
newErrors.push(error);
}
return newErrors;
}
/**
* @param {Schema} schema schema
* @param {Array<object> | object} options options
* @returns {Array<SchemaUtilErrorObject>} array of error objects
*/
function validateObject(schema, options) {
// Not need to cache, because `ajv@8` has built-in cache
const compiledSchema = getAjv().compile(schema);
const valid = compiledSchema(options);
if (valid) return [];
return compiledSchema.errors ? filterErrors(compiledSchema.errors) : [];
}
/**
* @param {Schema} schema schema
* @param {Array<object> | object} options options
* @param {ValidationErrorConfiguration=} configuration configuration
* @returns {void}
*/
function validate(schema, options, configuration) {
if (!needValidate()) {
return;
}
let errors = [];
if (Array.isArray(options)) {
for (let i = 0; i <= options.length - 1; i++) {
errors.push(...validateObject(schema, options[i]).map(err => applyPrefix(err, i)));
}
} else {
errors = validateObject(schema, options);
}
if (errors.length > 0) {
throw new _ValidationError.default(errors, schema, configuration);
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"get-loading-markup.js","sourceRoot":"","sources":["../src/get-loading-markup.ts"],"names":[],"mappings":";;AAAA,IAAM,gBAAgB,GAAG,cAAM,OAAA,CAAC;IAC9B,MAAM,EAAE,kKAKL;IACH,SAAS,EAAE,wofA4cZ;CACA,CAAC,EApd6B,CAod7B,CAAA;AAEF,kBAAe,gBAAgB,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"train-front-tunnel.js","sources":["../../../src/icons/train-front-tunnel.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TrainFrontTunnel\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMlYxMmExMCAxMCAwIDEgMSAyMCAwdjEwIiAvPgogIDxwYXRoIGQ9Ik0xNSA2Ljh2MS40YTMgMi44IDAgMSAxLTYgMFY2LjgiIC8+CiAgPHBhdGggZD0iTTEwIDE1aC4wMSIgLz4KICA8cGF0aCBkPSJNMTQgMTVoLjAxIiAvPgogIDxwYXRoIGQ9Ik0xMCAxOWE0IDQgMCAwIDEtNC00di0zYTYgNiAwIDEgMSAxMiAwdjNhNCA0IDAgMCAxLTQgNFoiIC8+CiAgPHBhdGggZD0ibTkgMTktMiAzIiAvPgogIDxwYXRoIGQ9Im0xNSAxOSAyIDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/train-front-tunnel\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 TrainFrontTunnel = createLucideIcon('TrainFrontTunnel', [\n ['path', { d: 'M2 22V12a10 10 0 1 1 20 0v10', key: 'o0fyp0' }],\n ['path', { d: 'M15 6.8v1.4a3 2.8 0 1 1-6 0V6.8', key: 'm8q3n9' }],\n ['path', { d: 'M10 15h.01', key: '44in9x' }],\n ['path', { d: 'M14 15h.01', key: '5mohn5' }],\n ['path', { d: 'M10 19a4 4 0 0 1-4-4v-3a6 6 0 1 1 12 0v3a4 4 0 0 1-4 4Z', key: 'hckbmu' }],\n ['path', { d: 'm9 19-2 3', key: 'iij7hm' }],\n ['path', { d: 'm15 19 2 3', key: 'npx8sa' }],\n]);\n\nexport default TrainFrontTunnel;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB,iBAAiB,kBAAoB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAChE,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,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,CAA2D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,72 @@
(function (Prism) {
Prism.languages.tremor = {
'comment': {
pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
lookbehind: true
},
'interpolated-string': null, // see below
'extractor': {
pattern: /\b[a-z_]\w*\|(?:[^\r\n\\|]|\\(?:\r\n|[\s\S]))*\|/i,
greedy: true,
inside: {
'regex': {
pattern: /(^re)\|[\s\S]+/,
lookbehind: true
},
'function': /^\w+/,
'value': /\|[\s\S]+/
}
},
'identifier': {
pattern: /`[^`]*`/,
greedy: true
},
'function': /\b[a-z_]\w*(?=\s*(?:::\s*<|\())\b/,
'keyword': /\b(?:args|as|by|case|config|connect|connector|const|copy|create|default|define|deploy|drop|each|emit|end|erase|event|flow|fn|for|from|group|having|insert|into|intrinsic|let|links|match|merge|mod|move|of|operator|patch|pipeline|recur|script|select|set|sliding|state|stream|to|tumbling|update|use|when|where|window|with)\b/,
'boolean': /\b(?:false|null|true)\b/i,
'number': /\b(?:0b[01_]*|0x[0-9a-fA-F_]*|\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee][+-]?[\d_]+)?)\b/,
'pattern-punctuation': {
pattern: /%(?=[({[])/,
alias: 'punctuation'
},
'operator': /[-+*\/%~!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?>?=?|(?:absent|and|not|or|present|xor)\b/,
'punctuation': /::|[;\[\]()\{\},.:]/,
};
var interpolationPattern = /#\{(?:[^"{}]|\{[^{}]*\}|"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*")*\}/.source;
Prism.languages.tremor['interpolated-string'] = {
pattern: RegExp(
/(^|[^\\])/.source +
'(?:' +
'"""(?:' + /[^"\\#]|\\[\s\S]|"(?!"")|#(?!\{)/.source + '|' + interpolationPattern + ')*"""' +
'|' +
'"(?:' + /[^"\\\r\n#]|\\(?:\r\n|[\s\S])|#(?!\{)/.source + '|' + interpolationPattern + ')*"' +
')'
),
lookbehind: true,
greedy: true,
inside: {
'interpolation': {
pattern: RegExp(interpolationPattern),
inside: {
'punctuation': /^#\{|\}$/,
'expression': {
pattern: /[\s\S]+/,
inside: Prism.languages.tremor
}
}
},
'string': /[\s\S]+/
}
};
Prism.languages.troy = Prism.languages['tremor'];
Prism.languages.trickle = Prism.languages['tremor'];
}(Prism));

View File

@@ -0,0 +1 @@
{"version":3,"file":"thumbs-up.js","sources":["../../../src/icons/thumbs-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ThumbsUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNyAxMHYxMiIgLz4KICA8cGF0aCBkPSJNMTUgNS44OCAxNCAxMGg1LjgzYTIgMiAwIDAgMSAxLjkyIDIuNTZsLTIuMzMgOEEyIDIgMCAwIDEgMTcuNSAyMkg0YTIgMiAwIDAgMS0yLTJ2LThhMiAyIDAgMCAxIDItMmgyLjc2YTIgMiAwIDAgMCAxLjc5LTEuMTFMMTIgMmEzLjEzIDMuMTMgMCAwIDEgMyAzLjg4WiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/thumbs-up\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 ThumbsUp = createLucideIcon('ThumbsUp', [\n ['path', { d: 'M7 10v12', key: '1qc93n' }],\n [\n 'path',\n {\n d: 'M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z',\n key: 'emmmcr',\n },\n ],\n]);\n\nexport default ThumbsUp;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,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,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,4 @@
import type { AccessResult } from '../config/types.js';
import type { Permission } from './index.js';
export declare const extractAccessFromPermission: (hasPermission: boolean | Permission) => AccessResult;
//# sourceMappingURL=extractAccessFromPermission.d.ts.map

View File

@@ -0,0 +1,10 @@
import type { ASTVisitor } from '../../language/visitor';
import type { SDLValidationContext } from '../ValidationContext';
/**
* Unique field definition names
*
* A GraphQL complex type is only valid if all its fields are uniquely named.
*/
export declare function UniqueFieldDefinitionNamesRule(
context: SDLValidationContext,
): ASTVisitor;

View File

@@ -0,0 +1,42 @@
import { entityKind } from "../entity.js";
import { PgTable } from "./table.js";
function primaryKey(...config) {
if (config[0].columns) {
return new PrimaryKeyBuilder(config[0].columns, config[0].name);
}
return new PrimaryKeyBuilder(config);
}
class PrimaryKeyBuilder {
static [entityKind] = "PgPrimaryKeyBuilder";
/** @internal */
columns;
/** @internal */
name;
constructor(columns, name) {
this.columns = columns;
this.name = name;
}
/** @internal */
build(table) {
return new PrimaryKey(table, this.columns, this.name);
}
}
class PrimaryKey {
constructor(table, columns, name) {
this.table = table;
this.columns = columns;
this.name = name;
}
static [entityKind] = "PgPrimaryKey";
columns;
name;
getName() {
return this.name ?? `${this.table[PgTable.Symbol.Name]}_${this.columns.map((column) => column.name).join("_")}_pk`;
}
}
export {
PrimaryKey,
PrimaryKeyBuilder,
primaryKey
};
//# sourceMappingURL=primary-keys.js.map

View File

@@ -0,0 +1,16 @@
/**
* @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 StickyNote = createLucideIcon("StickyNote", [
["path", { d: "M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z", key: "qazsjp" }],
["path", { d: "M15 3v4a2 2 0 0 0 2 2h4", key: "40519r" }]
]);
export { StickyNote as default };
//# sourceMappingURL=sticky-note.js.map

View File

@@ -0,0 +1,84 @@
"use strict";
exports.formatRFC3339 = formatRFC3339;
var _index = require("./_lib/addLeadingZeros.cjs");
var _index2 = require("./isValid.cjs");
var _index3 = require("./toDate.cjs");
/**
* The {@link formatRFC3339} function options.
*/
/**
* @name formatRFC3339
* @category Common Helpers
* @summary Format the date according to the RFC 3339 standard (https://tools.ietf.org/html/rfc3339#section-5.6).
*
* @description
* Return the formatted date string in RFC 3339 format. Options may be passed to control the parts and notations of the date.
*
* @param date - The original date
* @param options - An object with options.
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 18 September 2019 in RFC 3339 format:
* formatRFC3339(new Date(2019, 8, 18, 19, 0, 52))
* //=> '2019-09-18T19:00:52Z'
*
* @example
* // Represent 18 September 2019 in RFC 3339 format, 3 digits of second fraction
* formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), {
* fractionDigits: 3
* })
* //=> '2019-09-18T19:00:52.234Z'
*/
function formatRFC3339(date, options) {
const date_ = (0, _index3.toDate)(date, options?.in);
if (!(0, _index2.isValid)(date_)) {
throw new RangeError("Invalid time value");
}
const fractionDigits = options?.fractionDigits ?? 0;
const day = (0, _index.addLeadingZeros)(date_.getDate(), 2);
const month = (0, _index.addLeadingZeros)(date_.getMonth() + 1, 2);
const year = date_.getFullYear();
const hour = (0, _index.addLeadingZeros)(date_.getHours(), 2);
const minute = (0, _index.addLeadingZeros)(date_.getMinutes(), 2);
const second = (0, _index.addLeadingZeros)(date_.getSeconds(), 2);
let fractionalSecond = "";
if (fractionDigits > 0) {
const milliseconds = date_.getMilliseconds();
const fractionalSeconds = Math.trunc(
milliseconds * Math.pow(10, fractionDigits - 3),
);
fractionalSecond =
"." + (0, _index.addLeadingZeros)(fractionalSeconds, fractionDigits);
}
let offset = "";
const tzOffset = date_.getTimezoneOffset();
if (tzOffset !== 0) {
const absoluteOffset = Math.abs(tzOffset);
const hourOffset = (0, _index.addLeadingZeros)(
Math.trunc(absoluteOffset / 60),
2,
);
const minuteOffset = (0, _index.addLeadingZeros)(absoluteOffset % 60, 2);
// If less than 0, the sign is +, because it is ahead of time.
const sign = tzOffset < 0 ? "+" : "-";
offset = `${sign}${hourOffset}:${minuteOffset}`;
} else {
offset = "Z";
}
return `${year}-${month}-${day}T${hour}:${minute}:${second}${fractionalSecond}${offset}`;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"antenna.js","sources":["../../../src/icons/antenna.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Antenna\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxMiA3IDIiIC8+CiAgPHBhdGggZD0ibTcgMTIgNS0xMCIgLz4KICA8cGF0aCBkPSJtMTIgMTIgNS0xMCIgLz4KICA8cGF0aCBkPSJtMTcgMTIgNS0xMCIgLz4KICA8cGF0aCBkPSJNNC41IDdoMTUiIC8+CiAgPHBhdGggZD0iTTEyIDE2djYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/antenna\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 Antenna = createLucideIcon('Antenna', [\n ['path', { d: 'M2 12 7 2', key: '117k30' }],\n ['path', { d: 'm7 12 5-10', key: '1tvx22' }],\n ['path', { d: 'm12 12 5-10', key: 'ev1o1a' }],\n ['path', { d: 'm17 12 5-10', key: '1e4ti3' }],\n ['path', { d: 'M4.5 7h15', key: 'vlsxkz' }],\n ['path', { d: 'M12 16v6', key: 'c8a4gj' }],\n]);\n\nexport default Antenna;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
import{headers as t}from"next/headers";import{cache as e}from"react";import{HEADER_LOCALE_NAME as n}from"../../shared/constants.js";import{isPromise as r}from"../../shared/utils.js";import{getCachedRequestLocale as o}from"./RequestLocaleCache.js";const s=e((async function(){const e=t();return r(e)?await e:e}));const i=e((async function(){let t;try{t=(await s()).get(n)||void 0}catch(t){if(t instanceof Error&&"DYNAMIC_SERVER_USAGE"===t.digest){const e=new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl.dev/docs/routing/setup#static-rendering",{cause:t});throw e.digest=t.digest,e}throw t}return t}));async function a(){return o()||await i()}export{a as getRequestLocale};

View File

@@ -0,0 +1,53 @@
/** @typedef { import('estree').BaseNode} BaseNode */
/** @typedef { import('./walker').WalkerContext} WalkerContext */
/** @typedef {(
* this: WalkerContext,
* node: BaseNode,
* parent: BaseNode,
* key: string,
* index: number
* ) => Promise<void>} AsyncHandler */
export class AsyncWalker extends WalkerBase {
/**
*
* @param {AsyncHandler} enter
* @param {AsyncHandler} leave
*/
constructor(enter: (this: {
skip: () => void;
remove: () => void;
replace: (node: import("estree").BaseNode) => void;
}, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>, leave: (this: {
skip: () => void;
remove: () => void;
replace: (node: import("estree").BaseNode) => void;
}, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>);
/** @type {AsyncHandler} */
enter: AsyncHandler;
/** @type {AsyncHandler} */
leave: AsyncHandler;
/**
*
* @param {BaseNode} node
* @param {BaseNode} parent
* @param {string} [prop]
* @param {number} [index]
* @returns {Promise<BaseNode>}
*/
visit(node: import("estree").BaseNode, parent: import("estree").BaseNode, prop?: string, index?: number): Promise<import("estree").BaseNode>;
should_skip: any;
should_remove: any;
replacement: any;
}
export type BaseNode = import("estree").BaseNode;
export type WalkerContext = {
skip: () => void;
remove: () => void;
replace: (node: import("estree").BaseNode) => void;
};
export type AsyncHandler = (this: {
skip: () => void;
remove: () => void;
replace: (node: import("estree").BaseNode) => void;
}, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => Promise<void>;
import { WalkerBase } from "./walker.js";

View File

@@ -0,0 +1,64 @@
import 'react';
import { Interpolation } from '@emotion/serialize';
import { Theme } from "./theming.js";
type IsPreReact19 = 2 extends Parameters<React.FunctionComponent<any>>['length'] ? true : false;
type WithConditionalCSSProp<P> = 'className' extends keyof P ? string extends P['className' & keyof P] ? {
css?: Interpolation<Theme>;
} : {} : {};
/** @ts-ignore */
type ReactJSXElement = true extends IsPreReact19 ? JSX.Element : React.JSX.Element;
/** @ts-ignore */
type ReactJSXElementClass = true extends IsPreReact19 ? JSX.ElementClass : React.JSX.ElementClass;
/** @ts-ignore */
type ReactJSXElementAttributesProperty = true extends IsPreReact19 ? JSX.ElementAttributesProperty : React.JSX.ElementAttributesProperty;
/** @ts-ignore */
type ReactJSXElementChildrenAttribute = true extends IsPreReact19 ? JSX.ElementChildrenAttribute : React.JSX.ElementChildrenAttribute;
/** @ts-ignore */
type ReactJSXLibraryManagedAttributes<C, P> = true extends IsPreReact19 ? JSX.LibraryManagedAttributes<C, P> : React.JSX.LibraryManagedAttributes<C, P>;
/** @ts-ignore */
type ReactJSXIntrinsicAttributes = true extends IsPreReact19 ? JSX.IntrinsicAttributes : React.JSX.IntrinsicAttributes;
/** @ts-ignore */
type ReactJSXIntrinsicClassAttributes<T> = true extends IsPreReact19 ? JSX.IntrinsicClassAttributes<T> : React.JSX.IntrinsicClassAttributes<T>;
/** @ts-ignore */
type ReactJSXIntrinsicElements = true extends IsPreReact19 ? JSX.IntrinsicElements : React.JSX.IntrinsicElements;
/** @ts-ignore */
type ReactJSXElementType = true extends IsPreReact19 ? string | React.JSXElementConstructor<any> : React.JSX.ElementType;
export declare namespace ReactJSX {
type ElementType = ReactJSXElementType;
interface Element extends ReactJSXElement {
}
interface ElementClass extends ReactJSXElementClass {
}
interface ElementAttributesProperty extends ReactJSXElementAttributesProperty {
}
interface ElementChildrenAttribute extends ReactJSXElementChildrenAttribute {
}
type LibraryManagedAttributes<C, P> = ReactJSXLibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends ReactJSXIntrinsicAttributes {
}
interface IntrinsicClassAttributes<T> extends ReactJSXIntrinsicClassAttributes<T> {
}
type IntrinsicElements = ReactJSXIntrinsicElements;
}
export declare namespace EmotionJSX {
type ElementType = ReactJSXElementType;
interface Element extends ReactJSXElement {
}
interface ElementClass extends ReactJSXElementClass {
}
interface ElementAttributesProperty extends ReactJSXElementAttributesProperty {
}
interface ElementChildrenAttribute extends ReactJSXElementChildrenAttribute {
}
type LibraryManagedAttributes<C, P> = P extends unknown ? WithConditionalCSSProp<P> & ReactJSXLibraryManagedAttributes<C, P> : never;
interface IntrinsicAttributes extends ReactJSXIntrinsicAttributes {
}
interface IntrinsicClassAttributes<T> extends ReactJSXIntrinsicClassAttributes<T> {
}
type IntrinsicElements = {
[K in keyof ReactJSXIntrinsicElements]: ReactJSXIntrinsicElements[K] & {
css?: Interpolation<Theme>;
};
};
}
export {};

View File

@@ -0,0 +1,52 @@
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
import { TransactionEvent } from '@sentry/core';
/**
* A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions.
*/
export declare class SentrySpanExporter {
private _finishedSpanBuckets;
private _finishedSpanBucketSize;
private _spansToBucketEntry;
private _lastCleanupTimestampInS;
private _sentSpans;
private _debouncedFlush;
constructor(options?: {
/** Lower bound of time in seconds until spans that are buffered but have not been sent as part of a transaction get cleared from memory. */
timeout?: number;
});
/**
* Export a single span.
* This is called by the span processor whenever a span is ended.
*/
export(span: ReadableSpan): void;
/**
* Try to flush any pending spans immediately.
* This is called internally by the exporter (via _debouncedFlush),
* but can also be triggered externally if we force-flush.
*/
flush(): void;
/**
* Clear the exporter.
* This is called when the span processor is shut down.
*/
clear(): void;
/**
* Send the given spans, but only if they are part of a finished transaction.
*
* Returns the sent spans.
* Spans remain unsent when their parent span is not yet finished.
* This will happen regularly, as child spans are generally finished before their parents.
* But it _could_ also happen because, for whatever reason, a parent span was lost.
* In this case, we'll eventually need to clean this up.
*/
private _maybeSend;
/** Remove "expired" span id entries from the _sentSpans cache. */
private _flushSentSpanCache;
/** Check if a node is a completed root node or a node whose parent has already been sent */
private _nodeIsCompletedRootNodeOrHasSentParent;
/** Get all completed root nodes from a list of nodes */
private _getCompletedRootNodes;
}
/** Exported only for tests. */
export declare function createTransactionForOtelSpan(span: ReadableSpan): TransactionEvent;
//# sourceMappingURL=spanExporter.d.ts.map

View File

@@ -0,0 +1,38 @@
"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._globalThis = void 0;
// Updates to this file should also be replicated to @opentelemetry/core too.
/**
* - globalThis (New standard)
* - self (Will return the current window instance for supported browsers)
* - window (fallback for older browser implementations)
* - global (NodeJS implementation)
* - <object> (When all else fails)
*/
/** only globals that common to node and browsers are allowed */
// eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef
exports._globalThis = typeof globalThis === 'object'
? globalThis
: typeof self === 'object'
? self
: typeof window === 'object'
? window
: typeof global === 'object'
? global
: {};
//# sourceMappingURL=globalThis.js.map

View File

@@ -0,0 +1,22 @@
import { type Client, type Config } from '@libsql/client/sqlite3';
import { type DrizzleConfig } from "../../utils.js";
import { type LibSQLDatabase } from "../driver-core.js";
export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>, TClient extends Client = Client>(...params: [
TClient | string
] | [
TClient | string,
DrizzleConfig<TSchema>
] | [
(DrizzleConfig<TSchema> & ({
connection: string | Config;
} | {
client: TClient;
}))
]): LibSQLDatabase<TSchema> & {
$client: TClient;
};
export declare namespace drizzle {
function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): LibSQLDatabase<TSchema> & {
$client: '$client is not available on drizzle.mock()';
};
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"fullscreen.js","sources":["../../../src/icons/fullscreen.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Fullscreen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA3VjVhMiAyIDAgMCAxIDItMmgyIiAvPgogIDxwYXRoIGQ9Ik0xNyAzaDJhMiAyIDAgMCAxIDIgMnYyIiAvPgogIDxwYXRoIGQ9Ik0yMSAxN3YyYTIgMiAwIDAgMS0yIDJoLTIiIC8+CiAgPHBhdGggZD0iTTcgMjFINWEyIDIgMCAwIDEtMi0ydi0yIiAvPgogIDxyZWN0IHdpZHRoPSIxMCIgaGVpZ2h0PSI4IiB4PSI3IiB5PSI4IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/fullscreen\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 Fullscreen = createLucideIcon('Fullscreen', [\n ['path', { d: 'M3 7V5a2 2 0 0 1 2-2h2', key: 'aa7l1z' }],\n ['path', { d: 'M17 3h2a2 2 0 0 1 2 2v2', key: '4qcy5o' }],\n ['path', { d: 'M21 17v2a2 2 0 0 1-2 2h-2', key: '6vwrx8' }],\n ['path', { d: 'M7 21H5a2 2 0 0 1-2-2v-2', key: 'ioqczr' }],\n ['rect', { width: '10', height: '8', x: '7', y: '8', rx: '1', key: 'vys8me' }],\n]);\n\nexport default Fullscreen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,91 @@
# wrap-ansi [![Build Status](https://travis-ci.com/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.com/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master)
> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
## Install
```
$ npm install wrap-ansi
```
## Usage
```js
const chalk = require('chalk');
const wrapAnsi = require('wrap-ansi');
const input = 'The quick brown ' + chalk.red('fox jumped over ') +
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
console.log(wrapAnsi(input, 20));
```
<img width="331" src="screenshot.png">
## API
### wrapAnsi(string, columns, options?)
Wrap words to the specified column width.
#### string
Type: `string`
String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`.
#### columns
Type: `number`
Number of columns to wrap the text to.
#### options
Type: `object`
##### hard
Type: `boolean`\
Default: `false`
By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width.
##### wordWrap
Type: `boolean`\
Default: `true`
By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary.
##### trim
Type: `boolean`\
Default: `true`
Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim.
## Related
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures.
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
- [Benjamin Coe](https://github.com/bcoe)
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-wrap_ansi?utm_source=npm-wrap-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/sqlite-core/view-common.ts"],"sourcesContent":["export const SQLiteViewConfig = Symbol.for('drizzle:SQLiteViewConfig');\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,mBAAmB,OAAO,IAAI,0BAA0B;","names":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getMachineId-unsupported.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAEnC,KAAK,UAAU,YAAY;IAChC,UAAI,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAHD,oCAGC","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 { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"]}

View File

@@ -0,0 +1,16 @@
/**
* @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 PanelLeft = createLucideIcon("PanelLeft", [
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
["path", { d: "M9 3v18", key: "fh3hqa" }]
]);
export { PanelLeft as default };
//# sourceMappingURL=panel-left.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"move-down.js","sources":["../../../src/icons/move-down.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MoveDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAxOEwxMiAyMkwxNiAxOCIgLz4KICA8cGF0aCBkPSJNMTIgMlYyMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/move-down\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 MoveDown = createLucideIcon('MoveDown', [\n ['path', { d: 'M8 18L12 22L16 18', key: 'cskvfv' }],\n ['path', { d: 'M12 2V22', key: 'r89rzk' }],\n]);\n\nexport default MoveDown;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,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,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,33 @@
@import '../../scss/styles.scss';
@layer payload-default {
.field-type.number {
position: relative;
&:not(.has-many) {
input {
@include formInput;
}
}
}
html[data-theme='light'] {
.field-type.number {
&.error {
input {
@include lightInputError;
}
}
}
}
html[data-theme='dark'] {
.field-type.number {
&.error {
input {
@include darkInputError;
}
}
}
}
}

View File

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

View File

@@ -0,0 +1,30 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import './index.scss';
const baseClass = 'error-pill';
export const ErrorPill = props => {
const {
className,
count,
i18n,
withMessage
} = props;
const lessThan3Chars = !withMessage && count < 99;
const classes = [baseClass, lessThan3Chars && `${baseClass}--fixed-width`, className && className].filter(Boolean).join(' ');
if (count === 0) {
return null;
}
return /*#__PURE__*/_jsx("div", {
className: classes,
children: /*#__PURE__*/_jsxs("div", {
className: `${baseClass}__content`,
children: [/*#__PURE__*/_jsx("span", {
className: `${baseClass}__count`,
children: count
}), withMessage && ` ${count > 1 ? i18n.t('general:errors') : i18n.t('general:error')}`]
})
});
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _extends;
function _extends() {
exports.default = _extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(null, arguments);
}
//# sourceMappingURL=extends.js.map

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

View File

@@ -0,0 +1,27 @@
/*
* 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.
*/
/* eslint-disable no-restricted-syntax --
* These re-exports are only of constants, only two-levels deep, and
* should not cause problems for tree-shakers.
*/
// Deprecated. These are kept around for compatibility purposes
export * from './trace';
export * from './resource';
// Use these instead
export * from './stable_attributes';
export * from './stable_metrics';
export * from './stable_events';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,122 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.getCodePoint = exports.xmlReplacer = void 0;
exports.xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
var xmlCodeMap = new Map([
[34, "&quot;"],
[38, "&amp;"],
[39, "&apos;"],
[60, "&lt;"],
[62, "&gt;"],
]);
// For compatibility with node < 4, we wrap `codePointAt`
exports.getCodePoint =
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
String.prototype.codePointAt != null
? function (str, index) { return str.codePointAt(index); }
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
function (c, index) {
return (c.charCodeAt(index) & 0xfc00) === 0xd800
? (c.charCodeAt(index) - 0xd800) * 0x400 +
c.charCodeAt(index + 1) -
0xdc00 +
0x10000
: c.charCodeAt(index);
};
/**
* Encodes all non-ASCII characters, as well as characters not valid in XML
* documents using XML entities.
*
* If a character has no equivalent entity, a
* numeric hexadecimal reference (eg. `&#xfc;`) will be used.
*/
function encodeXML(str) {
var ret = "";
var lastIdx = 0;
var match;
while ((match = exports.xmlReplacer.exec(str)) !== null) {
var i = match.index;
var char = str.charCodeAt(i);
var next = xmlCodeMap.get(char);
if (next !== undefined) {
ret += str.substring(lastIdx, i) + next;
lastIdx = i + 1;
}
else {
ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports.getCodePoint)(str, i).toString(16), ";");
// Increase by 1 if we have a surrogate pair
lastIdx = exports.xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800);
}
}
return ret + str.substr(lastIdx);
}
exports.encodeXML = encodeXML;
/**
* Encodes all non-ASCII characters, as well as characters not valid in XML
* documents using numeric hexadecimal reference (eg. `&#xfc;`).
*
* Have a look at `escapeUTF8` if you want a more concise output at the expense
* of reduced transportability.
*
* @param data String to escape.
*/
exports.escape = encodeXML;
/**
* Creates a function that escapes all characters matched by the given regular
* expression using the given map of characters to escape to their entities.
*
* @param regex Regular expression to match characters to escape.
* @param map Map of characters to escape to their entities.
*
* @returns Function that escapes all characters matched by the given regular
* expression using the given map of characters to escape to their entities.
*/
function getEscaper(regex, map) {
return function escape(data) {
var match;
var lastIdx = 0;
var result = "";
while ((match = regex.exec(data))) {
if (lastIdx !== match.index) {
result += data.substring(lastIdx, match.index);
}
// We know that this character will be in the map.
result += map.get(match[0].charCodeAt(0));
// Every match will be of length 1
lastIdx = match.index + 1;
}
return result + data.substring(lastIdx);
};
}
/**
* Encodes all characters not valid in XML documents using XML entities.
*
* Note that the output will be character-set dependent.
*
* @param data String to escape.
*/
exports.escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap);
/**
* Encodes all characters that have to be escaped in HTML attributes,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*
* @param data String to escape.
*/
exports.escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([
[34, "&quot;"],
[38, "&amp;"],
[160, "&nbsp;"],
]));
/**
* Encodes all characters that have to be escaped in HTML text,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*
* @param data String to escape.
*/
exports.escapeText = getEscaper(/[&<>\u00A0]/g, new Map([
[38, "&amp;"],
[60, "&lt;"],
[62, "&gt;"],
[160, "&nbsp;"],
]));
//# sourceMappingURL=escape.js.map

View File

@@ -0,0 +1,20 @@
Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
Copyright (c) 2013 Arnout Kazemier and contributors
Copyright (c) 2016 Luigi Pinca and 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.

View File

@@ -0,0 +1 @@
{"version":3,"file":"feedbackAsync.d.ts","sourceRoot":"","sources":["../../../src/feedbackAsync.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;EAEnC,CAAC"}

View File

@@ -0,0 +1,104 @@
import type { TraceContext } from '../types-hoist/context';
import type { SpanLink, SpanLinkJSON } from '../types-hoist/link';
import type { Span, SpanAttributes, SpanJSON, SpanTimeInput } from '../types-hoist/span';
import type { SpanStatus } from '../types-hoist/spanStatus';
export declare const TRACE_FLAG_NONE = 0;
export declare const TRACE_FLAG_SAMPLED = 1;
/**
* Convert a span to a trace context, which can be sent as the `trace` context in an event.
* By default, this will only include trace_id, span_id & parent_span_id.
* If `includeAllData` is true, it will also include data, op, status & origin.
*/
export declare function spanToTransactionTraceContext(span: Span): TraceContext;
/**
* Convert a span to a trace context, which can be sent as the `trace` context in a non-transaction event.
*/
export declare function spanToTraceContext(span: Span): TraceContext;
/**
* Convert a Span to a Sentry trace header.
*/
export declare function spanToTraceHeader(span: Span): string;
/**
* Convert a Span to a W3C traceparent header.
*/
export declare function spanToTraceparentHeader(span: Span): string;
/**
* Converts the span links array to a flattened version to be sent within an envelope.
*
* If the links array is empty, it returns `undefined` so the empty value can be dropped before it's sent.
*/
export declare function convertSpanLinksForEnvelope(links?: SpanLink[]): SpanLinkJSON[] | undefined;
/**
* Convert a span time input into a timestamp in seconds.
*/
export declare function spanTimeInputToSeconds(input: SpanTimeInput | undefined): number;
/**
* Convert a span to a JSON representation.
*/
export declare function spanToJSON(span: Span): SpanJSON;
/** Exported only for tests. */
export interface OpenTelemetrySdkTraceBaseSpan extends Span {
attributes: SpanAttributes;
startTime: SpanTimeInput;
name: string;
status: SpanStatus;
endTime: SpanTimeInput;
parentSpanId?: string;
links?: SpanLink[];
}
/**
* Returns true if a span is sampled.
* In most cases, you should just use `span.isRecording()` instead.
* However, this has a slightly different semantic, as it also returns false if the span is finished.
* So in the case where this distinction is important, use this method.
*/
export declare function spanIsSampled(span: Span): boolean;
/** Get the status message to use for a JSON representation of a span. */
export declare function getStatusMessage(status: SpanStatus | undefined): string | undefined;
declare const CHILD_SPANS_FIELD = "_sentryChildSpans";
declare const ROOT_SPAN_FIELD = "_sentryRootSpan";
type SpanWithPotentialChildren = Span & {
[CHILD_SPANS_FIELD]?: Set<Span>;
[ROOT_SPAN_FIELD]?: Span;
};
/**
* Adds an opaque child span reference to a span.
*/
export declare function addChildSpanToSpan(span: SpanWithPotentialChildren, childSpan: Span): void;
/** This is only used internally by Idle Spans. */
export declare function removeChildSpanFromSpan(span: SpanWithPotentialChildren, childSpan: Span): void;
/**
* Returns an array of the given span and all of its descendants.
*/
export declare function getSpanDescendants(span: SpanWithPotentialChildren): Span[];
/**
* Returns the root span of a given span.
*/
export declare function getRootSpan(span: SpanWithPotentialChildren): Span;
/**
* Returns the currently active span.
*/
export declare function getActiveSpan(): Span | undefined;
/**
* Logs a warning once if `beforeSendSpan` is used to drop spans.
*/
export declare function showSpanDropWarning(): void;
/**
* Updates the name of the given span and ensures that the span name is not
* overwritten by the Sentry SDK.
*
* Use this function instead of `span.updateName()` if you want to make sure that
* your name is kept. For some spans, for example root `http.server` spans the
* Sentry SDK would otherwise overwrite the span name with a high-quality name
* it infers when the span ends.
*
* Use this function in server code or when your span is started on the server
* and on the client (browser). If you only update a span name on the client,
* you can also use `span.updateName()` the SDK does not overwrite the name.
*
* @param span - The span to update the name of.
* @param name - The name to set on the span.
*/
export declare function updateSpanName(span: Span, name: string): void;
export {};
//# sourceMappingURL=spanUtils.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"preload.js","sources":["../../src/preload.ts"],"sourcesContent":["import { envToBool } from '@sentry/node-core';\nimport { preloadOpenTelemetry } from './sdk/initOtel';\n\nconst debug = envToBool(process.env.SENTRY_DEBUG);\nconst integrationsStr = process.env.SENTRY_PRELOAD_INTEGRATIONS;\n\nconst integrations = integrationsStr ? integrationsStr.split(',').map(integration => integration.trim()) : undefined;\n\n/**\n * The @sentry/node/preload export can be used with the node --import and --require args to preload the OTEL\n * instrumentation, without initializing the Sentry SDK.\n *\n * This is useful if you cannot initialize the SDK immediately, but still want to preload the instrumentation,\n * e.g. if you have to load the DSN from somewhere else.\n *\n * You can configure this in two ways via environment variables:\n * - `SENTRY_DEBUG` to enable debug logging\n * - `SENTRY_PRELOAD_INTEGRATIONS` to preload specific integrations - e.g. `SENTRY_PRELOAD_INTEGRATIONS=\"Http,Express\"`\n */\npreloadOpenTelemetry({ debug, integrations });\n"],"names":["envToBool","preloadOpenTelemetry"],"mappings":";;;AAGA,MAAM,KAAA,GAAQA,kBAAS,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AACjD,MAAM,kBAAkB,OAAO,CAAC,GAAG,CAAC,2BAA2B;;AAE/D,MAAM,YAAA,GAAe,eAAA,GAAkB,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,WAAA,IAAe,WAAW,CAAC,IAAI,EAAE,CAAA,GAAI,SAAS;;AAEpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,6BAAoB,CAAC,EAAE,KAAK,EAAE,YAAA,EAAc,CAAC;;"}

View File

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

View File

@@ -0,0 +1,357 @@
import { deepMergeSimple } from '@payloadcms/translations/utilities';
import { DuplicateFieldName, InvalidConfiguration, InvalidFieldName, InvalidFieldRelationship, MissingEditorProp, MissingFieldType } from '../../errors/index.js';
import { ReservedFieldName } from '../../errors/ReservedFieldName.js';
import { flattenAllFields } from '../../utilities/flattenAllFields.js';
import { formatLabels, toWords } from '../../utilities/formatLabels.js';
import { validateTimezones } from '../../utilities/validateTimezones.js';
import { baseBlockFields } from '../baseFields/baseBlockFields.js';
import { baseIDField } from '../baseFields/baseIDField.js';
import { baseTimezoneField } from '../baseFields/timezone/baseField.js';
import { defaultTimezones } from '../baseFields/timezone/defaultTimezones.js';
import { getFieldPaths } from '../getFieldPaths.js';
import { setDefaultBeforeDuplicate } from '../setDefaultBeforeDuplicate.js';
import { validations } from '../validations.js';
import { reservedAPIKeyFieldNames, reservedBaseAuthFieldNames, reservedBaseUploadFieldNames, reservedVerifyFieldNames } from './reservedFieldNames.js';
import { sanitizeJoinField } from './sanitizeJoinField.js';
import { fieldAffectsData as _fieldAffectsData, fieldIsLocalized, tabHasName } from './types.js';
export const sanitizeFields = async ({ collectionConfig, config, existingFieldNames = new Set(), fields, globalConfig, isTopLevelField = true, joinPath = '', joins, parentIndexPath = '', parentIsLocalized, parentSchemaPath = '', polymorphicJoins, requireFieldLevelRichTextEditor = false, richTextSanitizationPromises, validRelationships })=>{
if (!fields) {
return [];
}
for(let i = 0; i < fields.length; i++){
const field = fields[i];
if ('_sanitized' in field && field._sanitized === true) {
continue;
}
if ('_sanitized' in field) {
field._sanitized = true;
}
if (!field.type) {
throw new MissingFieldType(field);
}
const fieldAffectsData = _fieldAffectsData(field);
const { indexPath, schemaPath } = getFieldPaths({
field,
index: i,
parentIndexPath,
parentSchemaPath
});
if (isTopLevelField && fieldAffectsData && field.name) {
if (collectionConfig && collectionConfig.upload) {
if (reservedBaseUploadFieldNames.includes(field.name)) {
throw new ReservedFieldName(field, field.name);
}
}
if (collectionConfig && collectionConfig.auth && typeof collectionConfig.auth === 'object' && !collectionConfig.auth.disableLocalStrategy) {
if (reservedBaseAuthFieldNames.includes(field.name)) {
throw new ReservedFieldName(field, field.name);
}
if (collectionConfig.auth.verify) {
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
if (reservedAPIKeyFieldNames.includes(field.name)) {
throw new ReservedFieldName(field, field.name);
}
// @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
if (reservedVerifyFieldNames.includes(field.name)) {
throw new ReservedFieldName(field, field.name);
}
}
}
}
// assert that field names do not contain forbidden characters
if (fieldAffectsData && field.name.includes('.')) {
throw new InvalidFieldName(field, field.name);
}
// Auto-label
if ('name' in field && field.name && typeof field.label !== 'object' && typeof field.label !== 'string' && typeof field.label !== 'function' && field.label !== false) {
field.label = toWords(field.name);
}
if (field.type === 'checkbox' && typeof field.defaultValue === 'undefined' && field.required === true) {
field.defaultValue = false;
}
if (field.type === 'join') {
sanitizeJoinField({
config,
field,
joinPath,
joins,
parentIsLocalized,
polymorphicJoins
});
}
if (field.type === 'relationship' || field.type === 'upload') {
// Validate that relationTo is not empty
if (Array.isArray(field.relationTo) && field.relationTo.length === 0) {
throw new Error(`Field "${field.name}" of type "${field.type}" has an empty relationTo array. At least one collection must be specified.`);
}
if (validRelationships) {
const relationships = Array.isArray(field.relationTo) ? field.relationTo : [
field.relationTo
];
relationships.forEach((relationship)=>{
if (!validRelationships.includes(relationship)) {
throw new InvalidFieldRelationship(field, relationship);
}
});
}
if (field.min && !field.minRows) {
console.warn(`(payload): The "min" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "minRows" instead.`);
field.minRows = field.min;
}
if (field.max && !field.maxRows) {
console.warn(`(payload): The "max" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "maxRows" instead.`);
field.maxRows = field.max;
}
}
if (field.type === 'upload') {
if (!field.admin || !('isSortable' in field.admin)) {
field.admin = {
isSortable: true,
...field.admin
};
}
}
if (field.type === 'array' && field.fields) {
const hasCustomID = field.fields.some((f)=>'name' in f && f.name === 'id');
if (!hasCustomID) {
field.fields.push(baseIDField);
}
}
if ((field.type === 'blocks' || field.type === 'array') && field.label) {
field.labels = field.labels || formatLabels(field.name);
}
if (fieldAffectsData) {
if (existingFieldNames.has(field.name)) {
throw new DuplicateFieldName(field.name);
} else if (![
'blockName',
'id'
].includes(field.name)) {
existingFieldNames.add(field.name);
}
if (typeof field.localized !== 'undefined') {
let shouldDisableLocalized = !config.localization;
if (process.env.NEXT_PUBLIC_PAYLOAD_COMPATIBILITY_allowLocalizedWithinLocalized !== 'true' && parentIsLocalized && // @todo PAYLOAD_DO_NOT_SANITIZE_LOCALIZED_PROPERTY=true will be the default in 4.0
process.env.PAYLOAD_DO_NOT_SANITIZE_LOCALIZED_PROPERTY !== 'true') {
shouldDisableLocalized = true;
}
if (shouldDisableLocalized) {
delete field.localized;
}
}
if (typeof field.validate === 'undefined') {
const defaultValidate = validations[field.type];
if (defaultValidate) {
field.validate = (val, options)=>defaultValidate(val, {
...field,
...options
});
} else {
field.validate = ()=>true;
}
}
if (!field.hooks) {
field.hooks = {};
}
if (!field.access) {
field.access = {};
}
setDefaultBeforeDuplicate(field, parentIsLocalized);
}
if (!field.admin) {
field.admin = {};
}
// Make sure that the richText field has an editor
if (field.type === 'richText') {
const sanitizeRichText = async (_config)=>{
if (!field.editor) {
if (_config.editor && !requireFieldLevelRichTextEditor) {
// config.editor should be sanitized at this point
field.editor = _config.editor;
} else {
throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor
;
}
}
if (typeof field.editor === 'function') {
field.editor = await field.editor({
config: _config,
isRoot: requireFieldLevelRichTextEditor,
parentIsLocalized: parentIsLocalized || field.localized
});
}
if (field.editor.i18n && Object.keys(field.editor.i18n).length >= 0) {
config.i18n.translations = deepMergeSimple(config.i18n.translations, field.editor.i18n);
}
};
if (richTextSanitizationPromises) {
richTextSanitizationPromises.push(sanitizeRichText);
} else {
await sanitizeRichText(config);
}
}
if (field.type === 'blocks' && field.blocks) {
if (field.blockReferences && field.blocks?.length) {
throw new Error('You cannot have both blockReferences and blocks in the same blocks field');
}
const blockSlugs = [];
for (const block of field.blockReferences ?? field.blocks){
const blockSlug = typeof block === 'string' ? block : block.slug;
if (blockSlugs.includes(blockSlug)) {
throw new DuplicateFieldName(blockSlug);
}
blockSlugs.push(blockSlug);
if (typeof block === 'string') {
continue;
}
if (block._sanitized === true) {
continue;
}
block._sanitized = true;
block.fields = block.fields.concat(baseBlockFields);
block.labels = !block.labels ? formatLabels(block.slug) : block.labels;
block.fields = await sanitizeFields({
collectionConfig,
config,
existingFieldNames: new Set(),
fields: block.fields,
isTopLevelField: false,
parentIndexPath: '',
parentIsLocalized: parentIsLocalized || field.localized,
parentSchemaPath: schemaPath + '.' + block.slug,
requireFieldLevelRichTextEditor,
richTextSanitizationPromises,
validRelationships
});
}
}
if ('fields' in field && field.fields) {
field.fields = await sanitizeFields({
collectionConfig,
config,
existingFieldNames: fieldAffectsData ? new Set() : existingFieldNames,
fields: field.fields,
isTopLevelField: isTopLevelField && !fieldAffectsData,
joinPath: fieldAffectsData ? `${joinPath ? joinPath + '.' : ''}${field.name}` : joinPath,
joins,
parentIndexPath: fieldAffectsData ? '' : indexPath,
parentIsLocalized: parentIsLocalized || fieldIsLocalized(field),
parentSchemaPath: schemaPath,
polymorphicJoins,
requireFieldLevelRichTextEditor,
richTextSanitizationPromises,
validRelationships
});
}
if (field.type === 'tabs') {
for(let j = 0; j < field.tabs.length; j++){
const tab = field.tabs[j];
const isNamedTab = tabHasName(tab);
if (isNamedTab && typeof tab.label === 'undefined') {
tab.label = toWords(tab.name);
}
const { indexPath: tabIndexPath, schemaPath: tabSchemaPath } = getFieldPaths({
field: tab,
index: j,
parentIndexPath: indexPath,
parentSchemaPath: schemaPath
});
if ('admin' in tab && tab.admin?.condition && typeof tab.admin.condition === 'function' && !tab.id) {
tab.id = tabSchemaPath;
}
tab.fields = await sanitizeFields({
collectionConfig,
config,
existingFieldNames: isNamedTab ? new Set() : existingFieldNames,
fields: tab.fields,
isTopLevelField: isTopLevelField && !isNamedTab,
joinPath: isNamedTab ? `${joinPath ? joinPath + '.' : ''}${tab.name}` : joinPath,
joins,
parentIndexPath: isNamedTab ? '' : tabIndexPath,
parentIsLocalized: parentIsLocalized || isNamedTab && tab.localized,
parentSchemaPath: tabSchemaPath,
polymorphicJoins,
requireFieldLevelRichTextEditor,
richTextSanitizationPromises,
validRelationships
});
field.tabs[j] = tab;
}
}
if (field.type === 'ui' && typeof field.admin.disableBulkEdit === 'undefined') {
field.admin.disableBulkEdit = true;
}
fields[i] = field;
// Insert our field after assignment
if (field.type === 'date' && field.timezone) {
const name = field.name + '_tz';
let defaultTimezone = field.timezone && typeof field.timezone === 'object' ? field.timezone.defaultTimezone : config.admin?.timezones?.defaultTimezone;
const required = field.required || field.timezone && typeof field.timezone === 'object' && field.timezone.required;
const supportedTimezones = field.timezone && typeof field.timezone === 'object' && field.timezone.supportedTimezones ? field.timezone.supportedTimezones : config.admin?.timezones?.supportedTimezones;
const options = typeof supportedTimezones === 'function' ? supportedTimezones({
defaultTimezones
}) : supportedTimezones;
validateTimezones({
source: `field "${field.name}" timezone.supportedTimezones`,
timezones: options
});
if (options && options.length === 1 && options[0]?.value) {
defaultTimezone = options[0].value;
}
// Generate label for timezone field
// Use parent field's label + ' Tz' if it's a simple string, otherwise fallback to name
const timezoneLabel = typeof field.label === 'string' ? `${field.label} Tz` : toWords(name);
// Need to set the options here manually so that any database enums are generated correctly
// The UI component will import the options from the config
const baseField = baseTimezoneField({
name,
defaultValue: defaultTimezone,
label: timezoneLabel,
options,
required
});
// Apply override if provided
const timezoneField = typeof field.timezone === 'object' && typeof field.timezone.override === 'function' ? field.timezone.override({
baseField
}) : baseField;
fields.splice(++i, 0, timezoneField);
}
if ('virtual' in field && typeof field.virtual === 'string') {
const virtualField = field;
const fields = (collectionConfig || globalConfig)?.fields;
if (fields) {
let flattenFields = flattenAllFields({
fields
});
const paths = field.virtual.split('.');
let isHasMany = false;
for (const [i, segment] of paths.entries()){
const field = flattenFields.find((e)=>e.name === segment);
if (!field) {
break;
}
if (field.type === 'group' || field.type === 'tab' || field.type === 'array') {
flattenFields = field.flattenedFields;
} else if ((field.type === 'relationship' || field.type === 'upload') && i !== paths.length - 1 && typeof field.relationTo === 'string') {
if (field.hasMany && (virtualField.type === 'text' || virtualField.type === 'number' || virtualField.type === 'select')) {
if (isHasMany) {
throw new InvalidConfiguration(`Virtual field ${virtualField.name} in ${globalConfig ? `global ${globalConfig.slug}` : `collection ${collectionConfig?.slug}`} references 2 or more hasMany relationships on the path ${virtualField.virtual} which is not allowed.`);
}
isHasMany = true;
virtualField.hasMany = true;
}
const relatedCollection = config.collections?.find((e)=>e.slug === field.relationTo);
if (relatedCollection) {
flattenFields = flattenAllFields({
fields: relatedCollection.fields
});
}
}
}
}
}
}
return fields;
};
//# sourceMappingURL=sanitize.js.map

View File

@@ -0,0 +1,120 @@
"use strict";
exports.intlFormat = intlFormat;
var _index = require("./toDate.cjs");
/**
* The locale string (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
* @deprecated
*
* [TODO] Remove in v4
*/
/**
* The format options (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options)
*/
/**
* The locale options.
*/
/**
* @name intlFormat
* @category Common Helpers
* @summary Format the date with Intl.DateTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).
*
* @description
* Return the formatted date string in the given format.
* The method uses [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) inside.
* formatOptions are the same as [`Intl.DateTimeFormat` options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options)
*
* > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default.
*
* @param date - The date to format
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 4 October 2019 in middle-endian format:
* const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456))
* //=> 10/4/2019
*/
/**
* @param date - The date to format
* @param localeOptions - An object with locale
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 4 October 2019 in Korean.
* // Convert the date with locale's options.
* const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), {
* locale: 'ko-KR',
* })
* //=> 2019. 10. 4.
*/
/**
* @param date - The date to format
* @param formatOptions - The format options
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 4 October 2019.
* // Convert the date with format's options.
* const result = intlFormat.default(new Date(2019, 9, 4, 12, 30, 13, 456), {
* year: 'numeric',
* month: 'numeric',
* day: 'numeric',
* hour: 'numeric',
* })
* //=> 10/4/2019, 12 PM
*/
/**
* @param date - The date to format
* @param formatOptions - The format options
* @param localeOptions - An object with locale
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
*
* @example
* // Represent 4 October 2019 in German.
* // Convert the date with format's options and locale's options.
* const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), {
* weekday: 'long',
* year: 'numeric',
* month: 'long',
* day: 'numeric',
* }, {
* locale: 'de-DE',
* })
* //=> Freitag, 4. Oktober 2019
*/
function intlFormat(date, formatOrLocale, localeOptions) {
let formatOptions;
if (isFormatOptions(formatOrLocale)) {
formatOptions = formatOrLocale;
} else {
localeOptions = formatOrLocale;
}
return new Intl.DateTimeFormat(localeOptions?.locale, formatOptions).format(
(0, _index.toDate)(date),
);
}
function isFormatOptions(opts) {
return opts !== undefined && !("locale" in opts);
}

View File

@@ -0,0 +1,4 @@
function _readOnlyError(r) {
throw new TypeError('"' + r + '" is read-only');
}
export { _readOnlyError as default };

View File

@@ -0,0 +1 @@
{"version":3,"file":"text-quote.js","sources":["../../../src/icons/text-quote.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TextQuote\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTcgNkgzIiAvPgogIDxwYXRoIGQ9Ik0yMSAxMkg4IiAvPgogIDxwYXRoIGQ9Ik0yMSAxOEg4IiAvPgogIDxwYXRoIGQ9Ik0zIDEydjYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/text-quote\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 TextQuote = createLucideIcon('TextQuote', [\n ['path', { d: 'M17 6H3', key: '16j9eg' }],\n ['path', { d: 'M21 12H8', key: 'scolzb' }],\n ['path', { d: 'M21 18H8', key: '1wfozv' }],\n ['path', { d: 'M3 12v6', key: 'fv4c87' }],\n]);\n\nexport default TextQuote;\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,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,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;AAC1C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,81 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const makeSerializable = require("../util/makeSerializable");
const NullDependency = require("./NullDependency");
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
/** @typedef {import("../Dependency")} Dependency */
/** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
class RequireResolveHeaderDependency extends NullDependency {
/**
* @param {Range} range range
*/
constructor(range) {
super();
if (!Array.isArray(range)) throw new Error("range must be valid");
this.range = range;
}
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
const { write } = context;
write(this.range);
super.serialize(context);
}
/**
* @param {ObjectDeserializerContext} context context
* @returns {RequireResolveHeaderDependency} RequireResolveHeaderDependency
*/
static deserialize(context) {
const obj = new RequireResolveHeaderDependency(context.read());
obj.deserialize(context);
return obj;
}
}
makeSerializable(
RequireResolveHeaderDependency,
"webpack/lib/dependencies/RequireResolveHeaderDependency"
);
RequireResolveHeaderDependency.Template = class RequireResolveHeaderDependencyTemplate extends (
NullDependency.Template
) {
/**
* @param {Dependency} dependency the dependency for which the template should be applied
* @param {ReplaceSource} source the current replace source which can be modified
* @param {DependencyTemplateContext} templateContext the context object
* @returns {void}
*/
apply(dependency, source, templateContext) {
const dep = /** @type {RequireResolveHeaderDependency} */ (dependency);
source.replace(dep.range[0], dep.range[1] - 1, "/*require.resolve*/");
}
/**
* @param {string} name name
* @param {RequireResolveHeaderDependency} dep dependency
* @param {ReplaceSource} source source
*/
applyAsTemplateArgument(name, dep, source) {
source.replace(dep.range[0], dep.range[1] - 1, "/*require.resolve*/");
}
};
module.exports = RequireResolveHeaderDependency;

View File

@@ -0,0 +1,113 @@
# mime-types
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
The ultimate javascript content-type utility.
Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except:
- __No fallbacks.__ Instead of naively returning the first available type,
`mime-types` simply returns `false`, so do
`var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
- No `.define()` functionality
- Bug fixes for `.lookup(path)`
Otherwise, the API is compatible with `mime` 1.x.
## Install
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```sh
$ npm install mime-types
```
## Adding Types
All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
so open a PR there if you'd like to add mime types.
## API
```js
var mime = require('mime-types')
```
All functions return `false` if input is invalid or not found.
### mime.lookup(path)
Lookup the content-type associated with a file.
```js
mime.lookup('json') // 'application/json'
mime.lookup('.md') // 'text/markdown'
mime.lookup('file.html') // 'text/html'
mime.lookup('folder/file.js') // 'application/javascript'
mime.lookup('folder/.htaccess') // false
mime.lookup('cats') // false
```
### mime.contentType(type)
Create a full content-type header given a content-type or extension.
When given an extension, `mime.lookup` is used to get the matching
content-type, otherwise the given content-type is used. Then if the
content-type does not already have a `charset` parameter, `mime.charset`
is used to get the default charset and add to the returned content-type.
```js
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
mime.contentType('file.json') // 'application/json; charset=utf-8'
mime.contentType('text/html') // 'text/html; charset=utf-8'
mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'
// from a full path
mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
```
### mime.extension(type)
Get the default extension for a content-type.
```js
mime.extension('application/octet-stream') // 'bin'
```
### mime.charset(type)
Lookup the implied default charset of a content-type.
```js
mime.charset('text/markdown') // 'UTF-8'
```
### var type = mime.types[extension]
A map of content-types by extension.
### [extensions...] = mime.extensions[type]
A map of extensions by content-type.
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
[node-version-image]: https://badgen.net/npm/node/mime-types
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
[npm-url]: https://npmjs.org/package/mime-types
[npm-version-image]: https://badgen.net/npm/v/mime-types

View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'førre' eeee 'kl.' p",
yesterday: "'i går kl.' p",
today: "'i dag kl.' p",
tomorrow: "'i morgon kl.' p",
nextWeek: "EEEE 'kl.' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,356 @@
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes.js';
import { spanToJSON } from '../../utils/spanUtils.js';
import { GEN_AI_OPERATION_NAME_ATTRIBUTE, GEN_AI_TOOL_CALL_ID_ATTRIBUTE, GEN_AI_TOOL_TYPE_ATTRIBUTE, GEN_AI_TOOL_NAME_ATTRIBUTE, GEN_AI_RESPONSE_MODEL_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE, GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE, GEN_AI_INPUT_MESSAGES_ATTRIBUTE, GEN_AI_TOOL_INPUT_ATTRIBUTE, GEN_AI_TOOL_OUTPUT_ATTRIBUTE, GEN_AI_REQUEST_MODEL_ATTRIBUTE } from '../ai/gen-ai-attributes.js';
import { toolCallSpanMap, INVOKE_AGENT_OPS, GENERATE_CONTENT_OPS, EMBEDDINGS_OPS, RERANK_OPS } from './constants.js';
import { accumulateTokensForParent, applyAccumulatedTokens, requestMessagesFromPrompt, getSpanOpFromName, convertAvailableToolsToJsonString } from './utils.js';
import { AI_TOOL_CALL_NAME_ATTRIBUTE, AI_TOOL_CALL_ID_ATTRIBUTE, AI_OPERATION_ID_ATTRIBUTE, AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE, AI_MODEL_ID_ATTRIBUTE, AI_PROMPT_TOOLS_ATTRIBUTE, OPERATION_NAME_ATTRIBUTE, AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE, AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE, AI_USAGE_PROMPT_TOKENS_ATTRIBUTE, AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE, AI_PROMPT_MESSAGES_ATTRIBUTE, AI_RESPONSE_TEXT_ATTRIBUTE, AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, AI_RESPONSE_OBJECT_ATTRIBUTE, AI_TOOL_CALL_ARGS_ATTRIBUTE, AI_TOOL_CALL_RESULT_ATTRIBUTE, AI_SCHEMA_ATTRIBUTE } from './vercel-ai-attributes.js';
function addOriginToSpan(span, origin) {
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin);
}
/**
* Maps Vercel AI SDK operation names to OpenTelemetry semantic convention values
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
*/
function mapVercelAiOperationName(operationName) {
// Top-level pipeline operations map to invoke_agent
if (INVOKE_AGENT_OPS.has(operationName)) {
return 'invoke_agent';
}
// .do* operations are the actual LLM calls
if (GENERATE_CONTENT_OPS.has(operationName)) {
return 'generate_content';
}
if (EMBEDDINGS_OPS.has(operationName)) {
return 'embeddings';
}
if (RERANK_OPS.has(operationName)) {
return 'rerank';
}
if (operationName === 'ai.toolCall') {
return 'execute_tool';
}
// Return the original value for unknown operations
return operationName;
}
/**
* Post-process spans emitted by the Vercel AI SDK.
* This is supposed to be used in `client.on('spanStart', ...)
*/
function onVercelAiSpanStart(span) {
const { data: attributes, description: name } = spanToJSON(span);
if (!name) {
return;
}
// Tool call spans
// https://ai-sdk.dev/docs/ai-sdk-core/telemetry#tool-call-spans
if (attributes[AI_TOOL_CALL_NAME_ATTRIBUTE] && attributes[AI_TOOL_CALL_ID_ATTRIBUTE] && name === 'ai.toolCall') {
processToolCallSpan(span, attributes);
return;
}
// V6+ Check if this is a Vercel AI span by checking if the operation ID attribute is present.
// V5+ Check if this is a Vercel AI span by name pattern.
if (!attributes[AI_OPERATION_ID_ATTRIBUTE] && !name.startsWith('ai.')) {
return;
}
processGenerateSpan(span, name, attributes);
}
function vercelAiEventProcessor(event) {
if (event.type === 'transaction' && event.spans) {
// Map to accumulate token data by parent span ID
const tokenAccumulator = new Map();
// First pass: process all spans and accumulate token data
for (const span of event.spans) {
processEndedVercelAiSpan(span);
// Accumulate token data for parent spans
accumulateTokensForParent(span, tokenAccumulator);
}
// Second pass: apply accumulated token data to parent spans
for (const span of event.spans) {
if (span.op !== 'gen_ai.invoke_agent') {
continue;
}
applyAccumulatedTokens(span, tokenAccumulator);
}
// Also apply to root when it is the invoke_agent pipeline
const trace = event.contexts?.trace;
if (trace && trace.op === 'gen_ai.invoke_agent') {
applyAccumulatedTokens(trace, tokenAccumulator);
}
}
return event;
}
/**
* Post-process spans emitted by the Vercel AI SDK.
*/
function processEndedVercelAiSpan(span) {
const { data: attributes, origin } = span;
if (origin !== 'auto.vercelai.otel') {
return;
}
renameAttributeKey(attributes, AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE, GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE);
renameAttributeKey(attributes, AI_USAGE_PROMPT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE);
renameAttributeKey(attributes, AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE, GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE);
// Parent spans (ai.streamText, ai.streamObject, etc.) use inputTokens/outputTokens instead of promptTokens/completionTokens
renameAttributeKey(attributes, 'ai.usage.inputTokens', GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE);
renameAttributeKey(attributes, 'ai.usage.outputTokens', GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE);
// AI SDK uses avgOutputTokensPerSecond, map to our expected attribute name
renameAttributeKey(attributes, 'ai.response.avgOutputTokensPerSecond', 'ai.response.avgCompletionTokensPerSecond');
// Input tokens is the sum of prompt tokens and cached input tokens
if (
typeof attributes[GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] === 'number' &&
typeof attributes[GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE] === 'number'
) {
attributes[GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] =
attributes[GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] + attributes[GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE];
}
if (
typeof attributes[GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] === 'number' &&
typeof attributes[GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] === 'number'
) {
attributes[GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE] =
attributes[GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] + attributes[GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE];
}
// Convert the available tools array to a JSON string
if (attributes[AI_PROMPT_TOOLS_ATTRIBUTE] && Array.isArray(attributes[AI_PROMPT_TOOLS_ATTRIBUTE])) {
attributes[AI_PROMPT_TOOLS_ATTRIBUTE] = convertAvailableToolsToJsonString(
attributes[AI_PROMPT_TOOLS_ATTRIBUTE] ,
);
}
// Rename AI SDK attributes to standardized gen_ai attributes
// Map operation.name to OpenTelemetry semantic convention values
if (attributes[OPERATION_NAME_ATTRIBUTE]) {
const operationName = mapVercelAiOperationName(attributes[OPERATION_NAME_ATTRIBUTE] );
attributes[GEN_AI_OPERATION_NAME_ATTRIBUTE] = operationName;
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete attributes[OPERATION_NAME_ATTRIBUTE];
}
renameAttributeKey(attributes, AI_PROMPT_MESSAGES_ATTRIBUTE, GEN_AI_INPUT_MESSAGES_ATTRIBUTE);
renameAttributeKey(attributes, AI_RESPONSE_TEXT_ATTRIBUTE, 'gen_ai.response.text');
renameAttributeKey(attributes, AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, 'gen_ai.response.tool_calls');
renameAttributeKey(attributes, AI_RESPONSE_OBJECT_ATTRIBUTE, 'gen_ai.response.object');
renameAttributeKey(attributes, AI_PROMPT_TOOLS_ATTRIBUTE, 'gen_ai.request.available_tools');
renameAttributeKey(attributes, AI_TOOL_CALL_ARGS_ATTRIBUTE, GEN_AI_TOOL_INPUT_ATTRIBUTE);
renameAttributeKey(attributes, AI_TOOL_CALL_RESULT_ATTRIBUTE, GEN_AI_TOOL_OUTPUT_ATTRIBUTE);
renameAttributeKey(attributes, AI_SCHEMA_ATTRIBUTE, 'gen_ai.request.schema');
renameAttributeKey(attributes, AI_MODEL_ID_ATTRIBUTE, GEN_AI_REQUEST_MODEL_ATTRIBUTE);
addProviderMetadataToAttributes(attributes);
// Change attributes namespaced with `ai.X` to `vercel.ai.X`
for (const key of Object.keys(attributes)) {
if (key.startsWith('ai.')) {
renameAttributeKey(attributes, key, `vercel.${key}`);
}
}
}
/**
* Renames an attribute key in the provided attributes object if the old key exists.
* This function safely handles null and undefined values.
*/
function renameAttributeKey(attributes, oldKey, newKey) {
if (attributes[oldKey] != null) {
attributes[newKey] = attributes[oldKey];
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete attributes[oldKey];
}
}
function processToolCallSpan(span, attributes) {
addOriginToSpan(span, 'auto.vercelai.otel');
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'gen_ai.execute_tool');
span.setAttribute(GEN_AI_OPERATION_NAME_ATTRIBUTE, 'execute_tool');
renameAttributeKey(attributes, AI_TOOL_CALL_NAME_ATTRIBUTE, GEN_AI_TOOL_NAME_ATTRIBUTE);
renameAttributeKey(attributes, AI_TOOL_CALL_ID_ATTRIBUTE, GEN_AI_TOOL_CALL_ID_ATTRIBUTE);
// Store the span in our global map using the tool call ID
// This allows us to capture tool errors and link them to the correct span
const toolCallId = attributes[GEN_AI_TOOL_CALL_ID_ATTRIBUTE];
if (typeof toolCallId === 'string') {
toolCallSpanMap.set(toolCallId, span);
}
// https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/#gen-ai-tool-type
if (!attributes[GEN_AI_TOOL_TYPE_ATTRIBUTE]) {
span.setAttribute(GEN_AI_TOOL_TYPE_ATTRIBUTE, 'function');
}
const toolName = attributes[GEN_AI_TOOL_NAME_ATTRIBUTE];
if (toolName) {
span.updateName(`execute_tool ${toolName}`);
}
}
function processGenerateSpan(span, name, attributes) {
addOriginToSpan(span, 'auto.vercelai.otel');
const nameWthoutAi = name.replace('ai.', '');
span.setAttribute('ai.pipeline.name', nameWthoutAi);
span.updateName(nameWthoutAi);
// If a telemetry name is set and the span represents a pipeline, use it as the operation name.
// This name can be set at the request level by adding `experimental_telemetry.functionId`.
const functionId = attributes[AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE];
if (functionId && typeof functionId === 'string') {
span.updateName(`${nameWthoutAi} ${functionId}`);
span.setAttribute('gen_ai.function_id', functionId);
}
requestMessagesFromPrompt(span, attributes);
if (attributes[AI_MODEL_ID_ATTRIBUTE] && !attributes[GEN_AI_RESPONSE_MODEL_ATTRIBUTE]) {
span.setAttribute(GEN_AI_RESPONSE_MODEL_ATTRIBUTE, attributes[AI_MODEL_ID_ATTRIBUTE]);
}
span.setAttribute('ai.streaming', name.includes('stream'));
// Set the op based on the span name
const op = getSpanOpFromName(name);
if (op) {
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, op);
}
// Update span names for .do* spans to include the model ID (only if model ID exists)
const modelId = attributes[AI_MODEL_ID_ATTRIBUTE];
if (modelId) {
switch (name) {
case 'ai.generateText.doGenerate':
span.updateName(`generate_text ${modelId}`);
break;
case 'ai.streamText.doStream':
span.updateName(`stream_text ${modelId}`);
break;
case 'ai.generateObject.doGenerate':
span.updateName(`generate_object ${modelId}`);
break;
case 'ai.streamObject.doStream':
span.updateName(`stream_object ${modelId}`);
break;
case 'ai.embed.doEmbed':
span.updateName(`embed ${modelId}`);
break;
case 'ai.embedMany.doEmbed':
span.updateName(`embed_many ${modelId}`);
break;
case 'ai.rerank.doRerank':
span.updateName(`rerank ${modelId}`);
break;
}
}
}
/**
* Add event processors to the given client to process Vercel AI spans.
*/
function addVercelAiProcessors(client) {
client.on('spanStart', onVercelAiSpanStart);
// Note: We cannot do this on `spanEnd`, because the span cannot be mutated anymore at this point
client.addEventProcessor(Object.assign(vercelAiEventProcessor, { id: 'VercelAiEventProcessor' }));
}
function addProviderMetadataToAttributes(attributes) {
const providerMetadata = attributes[AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE] ;
if (providerMetadata) {
try {
const providerMetadataObject = JSON.parse(providerMetadata) ;
// Handle OpenAI metadata (v5 uses 'openai', v6 Azure Responses API uses 'azure')
const openaiMetadata =
providerMetadataObject.openai ?? providerMetadataObject.azure;
if (openaiMetadata) {
setAttributeIfDefined(
attributes,
GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,
openaiMetadata.cachedPromptTokens,
);
setAttributeIfDefined(attributes, 'gen_ai.usage.output_tokens.reasoning', openaiMetadata.reasoningTokens);
setAttributeIfDefined(
attributes,
'gen_ai.usage.output_tokens.prediction_accepted',
openaiMetadata.acceptedPredictionTokens,
);
setAttributeIfDefined(
attributes,
'gen_ai.usage.output_tokens.prediction_rejected',
openaiMetadata.rejectedPredictionTokens,
);
setAttributeIfDefined(attributes, 'gen_ai.conversation.id', openaiMetadata.responseId);
}
if (providerMetadataObject.anthropic) {
const cachedInputTokens =
providerMetadataObject.anthropic.usage?.cache_read_input_tokens ??
providerMetadataObject.anthropic.cacheReadInputTokens;
setAttributeIfDefined(attributes, GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE, cachedInputTokens);
const cacheWriteInputTokens =
providerMetadataObject.anthropic.usage?.cache_creation_input_tokens ??
providerMetadataObject.anthropic.cacheCreationInputTokens;
setAttributeIfDefined(attributes, GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE, cacheWriteInputTokens);
}
if (providerMetadataObject.bedrock?.usage) {
setAttributeIfDefined(
attributes,
GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,
providerMetadataObject.bedrock.usage.cacheReadInputTokens,
);
setAttributeIfDefined(
attributes,
GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE,
providerMetadataObject.bedrock.usage.cacheWriteInputTokens,
);
}
if (providerMetadataObject.deepseek) {
setAttributeIfDefined(
attributes,
GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE,
providerMetadataObject.deepseek.promptCacheHitTokens,
);
setAttributeIfDefined(
attributes,
'gen_ai.usage.input_tokens.cache_miss',
providerMetadataObject.deepseek.promptCacheMissTokens,
);
}
} catch {
// Ignore
}
}
}
/**
* Sets an attribute only if the value is not null or undefined.
*/
function setAttributeIfDefined(attributes, key, value) {
if (value != null) {
attributes[key] = value;
}
}
export { addVercelAiProcessors };
//# sourceMappingURL=index.js.map

View File

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

View File

@@ -0,0 +1,46 @@
import { setISOWeek } from "../../../setISOWeek.mjs";
import { startOfISOWeek } from "../../../startOfISOWeek.mjs";
import { numericPatterns } from "../constants.mjs";
import { Parser } from "../Parser.mjs";
import { parseNDigits, parseNumericPattern } from "../utils.mjs";
// ISO week of year
export class ISOWeekParser extends Parser {
priority = 100;
parse(dateString, token, match) {
switch (token) {
case "I":
return parseNumericPattern(numericPatterns.week, dateString);
case "Io":
return match.ordinalNumber(dateString, { unit: "week" });
default:
return parseNDigits(token.length, dateString);
}
}
validate(_date, value) {
return value >= 1 && value <= 53;
}
set(date, _flags, value) {
return startOfISOWeek(setISOWeek(date, value));
}
incompatibleTokens = [
"y",
"Y",
"u",
"q",
"Q",
"M",
"L",
"w",
"d",
"D",
"e",
"c",
"t",
"T",
];
}

View File

@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=t=>()=>(e.throwIfEmpty(t,`Keys cannot be empty`),{path:`/files`,body:JSON.stringify(t),method:`DELETE`}),n=t=>()=>(e.throwIfEmpty(t,`Key cannot be empty`),{path:`/files/${t}`,method:`DELETE`});exports.deleteFile=n,exports.deleteFiles=t;
//# sourceMappingURL=files.cjs.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/forms/withCondition/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,YAAY,CAAC,UAAU,EAAE,WAAW,GAAG,MAAM,CAAC,SAC7E,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAC5B,KAAK,CAAC,EAAE,CAAC,CAAC,CAYZ,CAAA"}

View File

@@ -0,0 +1,22 @@
function _regeneratorDefine(e, r, n, t) {
var i = Object.defineProperty;
try {
i({}, "", {});
} catch (e) {
i = 0;
}
_regeneratorDefine = function regeneratorDefine(e, r, n, t) {
function o(r, n) {
_regeneratorDefine(e, r, function (e) {
return this._invoke(r, n, e);
});
}
r ? i ? i(e, r, {
value: n,
enumerable: !t,
configurable: !t,
writable: !t
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
}, _regeneratorDefine(e, r, n, t);
}
export { _regeneratorDefine as default };

View File

@@ -0,0 +1,35 @@
'use strict';
class DatePart {
constructor({token, date, parts, locales}) {
this.token = token;
this.date = date || new Date();
this.parts = parts || [this];
this.locales = locales || {};
}
up() {}
down() {}
next() {
const currentIdx = this.parts.indexOf(this);
return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
}
setTo(val) {}
prev() {
let parts = [].concat(this.parts).reverse();
const currentIdx = parts.indexOf(this);
return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
}
toString() {
return String(this.date);
}
}
module.exports = DatePart;

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